|
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(576, 317);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.BtnExit,
this.BtnDelete,
this.BtnEdit,
this.BtnSave,
this.BtnAddNew,
this.TxtDeptNo,
this.TxtESal,
this.TxtEName,
this.TxtEmpNo,
this.label4,
this.label3,
this.label2,
this.label1});
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.Name = "FrmEmp";
this.Text = "Employee Data Form";
this.Load += new System.EventHandler(this.FrmEmp_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new FrmEmp());
}
private void FrmEmp_Load(object sender, System.EventArgs e)
{
}
private void BtnExit_Click(object sender, System.EventArgs e)
{
Conn.Close();
this.Close();
}
private void BtnAddNew_Click(object sender, System.EventArgs e)
{
TxtEmpNo.Text = "";
TxtEName.Text = "";
TxtESal.Text = "";
TxtDeptNo.Text = "";
TxtEmpNo.Focus();
}
private void BtnSave_Click(object sender, System.EventArgs e)
{
try
{
if (blnEdit == false)
{
DataRow1 = DataSet1.Tables["Emp"].NewRow();
DataRow1["EmpNo"] = Int16.Parse(TxtEmpNo.Text);
DataRow1["EName"] = TxtEName.Text;
DataRow1["Sal"] = Double.Parse(TxtESal.Text);
DataRow1["DeptNo"] = Int32.Parse(TxtDeptNo.Text);
DataSet1.Tables["Emp"].Rows.Add(DataRow1);
DataAdpt.Update(DataSet1,"Emp");
MessageBox.Show("record saved!");
}
[1] [2] [3] [4] 下一页 [ORACLE]通过c#连结oracle数据库(一) [ORACLE]通过c#连结oracle数据库(二) [ORACLE]通过c#连结oracle数据库(四) [ORACLE]通过c#连结oracle数据库(五)
|