using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace PayM { public partial class Pay_MonthSubsidyEntryBillAdd : Form { public Pay_MonthSubsidyEntryBillAdd() { InitializeComponent(); } private void cmdHEmpID_Click(object sender, EventArgs e) { DAL.ClsGy_Employee_View oEmp = new DAL.ClsGy_Employee_View(); if (oEmp.RefreshView()) { this.txtHEmpID.Text = oEmp.oModel.HName; this.txtHEmpNumber.Text = oEmp.oModel.HNumber; this.txtHEmpID.Tag = oEmp.oModel.HItemID.ToString(); } else { this.txtHEmpID.Text = ""; this.txtHEmpNumber.Text = ""; } } private void txtHEmpID_TextChanged(object sender, EventArgs e) { if (txtHEmpID.Text.Trim() == "") { txtHEmpID.Tag = "0"; this.txtHEmpNumber.Text = ""; } } private void button1_Click(object sender, EventArgs e) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); oCn.RunProc("insert into Pay_MonthSubsidyEntryBill (HYear,HPeriod"+ ",HDeptCode,HDate,HMaker,HMakeDate,HRemark,HEmpCode,HExpenseType,HQty,HPrice,HMoney,HEmpName)"+ "values(" + cmbYear.Text + "," + cmbPeriod.Text + ",'',getdate(),'" + DBUtility.ClsPub.CurUserName + "',getdate(),'','" + txtHEmpNumber.Text + "','手工'," + txtHQty.Text + "," + txtHPrice.Text + "," + txtHMoney.Text + ",'"+ txtHEmpID.Text +"')"); MessageBox.Show("保存成功!","提示"); txtHEmpID.Text = ""; txtHEmpNumber.Text = ""; txtHMoney.Text = ""; txtHPrice.Text = ""; txtHQty.Text = ""; } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void txtHQty_TextChanged(object sender, EventArgs e) { txtHMoney.Text =DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDoule( txtHQty.Text) * DBUtility.ClsPub.isDoule( txtHPrice.Text)); } private void txtHPrice_TextChanged(object sender, EventArgs e) { txtHMoney.Text = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDoule(txtHQty.Text) * DBUtility.ClsPub.isDoule(txtHPrice.Text)); } } }