using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace OAM
|
{
|
public partial class node_add1 : Form
|
{
|
public bool up_flag;
|
public string Fnumber;
|
public string Fname;
|
public string fitemid;
|
|
TreeNode CurNode = new TreeNode();
|
public node_add1()
|
{
|
InitializeComponent();
|
}
|
|
private void cmdOk_Click(object sender, EventArgs e)
|
{
|
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
|
DataSet Ds;
|
if (DBUtility.ClsPub.isStrNull(txtFnumber.Text) == "")
|
{
|
MessageBox.Show("²¿ÃűàºÅ²»ÄÜΪ¿Õ£¡", "Ìáʾ");
|
return;
|
}
|
if (DBUtility.ClsPub.isStrNull(txtFname.Text) == "")
|
{
|
MessageBox.Show("²¿ÃÅÃû³Æ²»ÄÜΪ¿Õ£¡", "Ìáʾ");
|
return;
|
}
|
if (up_flag == false)
|
{
|
oCn.RunProc("Update deptlist set " +
|
"Fname= '" + txtFname.Text.Trim() + "'Where fitemid ='" + fitemid + "'", ref DBUtility.ClsPub.sExeReturnInfo);
|
MessageBox.Show("Ð޸ijɹ¦");
|
|
txtFnumber.Text = "";
|
txtFname.Text = "";
|
this.Close();
|
}
|
else
|
{
|
//string fnumber;
|
//Ds = oCn.RunProcReturn("Select * from deptlist Where fitemid='" + fnumber + "'", "deptlist");
|
//fnumber = Ds.Tables[0].Rows[0]["Fnumber"].ToString().Trim();
|
//if (txtFnumber.Text == fnumber)
|
//{
|
//}
|
//else
|
//{
|
oCn.RunProc("Insert into deptlist " +
|
" (Fnumber,Fname) " +
|
" Values('" + txtFnumber.Text.Trim() + "','" + txtFname.Text.Trim() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
|
|
MessageBox.Show("ÐÂÔö³É¹¦");
|
txtFnumber.Text = "";
|
txtFname.Text = "";
|
this.Close();
|
//}
|
|
}
|
|
}
|
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled = false;
|
txtFname.Text = Fname;
|
txtFnumber.Text = Fnumber;
|
//return;
|
}
|
|
}
|
}
|