using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
using Pub_Class;
|
|
namespace OAM
|
{
|
|
public partial class frmOA_LY : Form
|
{
|
public string UserName;
|
public frmOA_LY()
|
{
|
InitializeComponent();
|
}
|
public long ID;
|
|
private void cmdOK_Click(object sender, EventArgs e)
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
if(txtcontext.Text=="")
|
{
|
MessageBox.Show("ÁôÑÔ²»ÄÜΪ¿Õ");
|
|
}
|
else
|
{
|
oCn.RunProc("Insert into OA_LY " +
|
" (Operator,Fdate,context) " +
|
" Values('" + Pub_Class.ClsPub.CurUserName + "','" + DateTime.Now.ToString() + "','" + txtcontext.Text.Trim() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
|
MessageBox.Show("ÒÑÁôÑÔ");
|
this.Close();
|
}
|
}
|
public void Display()
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
|
try
|
{
|
//²éѯ±í
|
DataSet Ds;
|
Ds = oCn.RunProcReturn("Select * from OA_LY Where ID='" + ID + "'", "OA_LY");
|
if (Ds.Tables[0].Rows.Count == 0)
|
{
|
txtOperator.Text = Pub_Class.ClsPub.CurUserName;
|
return;
|
}
|
//¸³Öµ
|
txtID.Text = Ds.Tables[0].Rows[0]["ID"].ToString().Trim();
|
txtOperator.Text = Ds.Tables[0].Rows[0]["Operator"].ToString().Trim();
|
txtcontext.Text = Ds.Tables[0].Rows[0]["context"].ToString().Trim();
|
return;
|
}
|
catch (Exception e)
|
{
|
return;
|
}
|
|
}
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled = false;
|
Display();
|
}
|
private void cmdCancel_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
private void cmdsc_Click(object sender, EventArgs e)
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
if (txtOperator.Text == DBUtility.ClsPub.CurUserName)
|
{
|
if (ID == 0)
|
{
|
MessageBox.Show("ÎÞ´ËÁôÑÔ");
|
}
|
else
|
{
|
DialogResult dr = MessageBox.Show("È·¶¨ÒªÉ¾³ý´Ëµ¥¾ÝÂð£¿", "Ìáʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
if (dr == DialogResult.Yes)
|
{
|
//if (!DBUtility.ClsPub.Security_Log("OA_Manager", 1, true, DBUtility.ClsPub.CurUserName))
|
//{
|
// return;
|
//}
|
oCn.RunProc("DELETE FROM OA_LY WHERE id =" + ID + " ", ref DBUtility.ClsPub.sExeReturnInfo);
|
MessageBox.Show("ÁôÑÔÒÑɾ³ý");
|
this.Close();
|
}
|
else
|
{
|
}
|
|
}
|
}
|
else
|
{
|
|
MessageBox.Show("¶Ô²»Æð!Ö»ÓÐÁôÑÔÈ˲ÅÄÜɾ£¡");
|
}
|
|
}
|
|
|
}
|
}
|