private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update COST_TEMP_EMPLOYEE_price set begin_date = '" + dateTimePickerBegin.Text + "',end_date='" + dateTimePickerEnd.Text + "',price='" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "',insurance_price='" + Common.IsNull(textEditInsurance.Text.ToString().Trim()) + "'"; sql = sql + " where cid = '" + id + "'"; string sql2 = "select * from cost_temp_employee_price where cid <> '" + id + "' and type = 2 and not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "')"; int rows = conn.ReturnRecordCount(sql2); if (rows > 0) { MessageBox.Show("此时间范围的记录已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); TempEmpStandardPriceQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } conn.Close(); }
public static TempEmpStandardPriceQuery GetInstance() { if (weqform == null || weqform.IsDisposed) { weqform = new TempEmpStandardPriceQuery(); } return(weqform); }
private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e) { TempEmpStandardPriceQuery Frm = TempEmpStandardPriceQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void LineType_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; TempEmpStandardPriceQuery Frm = TempEmpStandardPriceQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void TempWorkerPriceUpdate_Load(object sender, EventArgs e) { TempEmpStandardPriceQuery.GetInfo(ref id, ref begin_date, ref end_date, ref price, ref insurance_price); if (id != "") { dateTimePickerBegin.Text = begin_date; dateTimePickerEnd.Text = end_date; textEditPrice.Text = price; textEditInsurance.Text = insurance_price; } }
private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e) { string id = "", begin_date = "", end_date = "", price = "", insurance_price = ""; TempEmpStandardPriceQuery.GetInfo(ref id, ref begin_date, ref end_date, ref price, ref insurance_price); if (id != "") { TempEmpStandardPriceUpdate Frm = new TempEmpStandardPriceUpdate(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); } }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into COST_TEMP_EMPLOYEE_PRICE(TYPE,BEGIN_DATE,END_DATE,PRICE,INSURANCE_PRICE) values(2,'" + dateTimePickerBegin.Text.ToString() + "','" + dateTimePickerEnd.Text.ToString() + "','" + textEditPrice.Text.ToString().Trim() + "','" + textEditInsurance.Text.ToString().Trim() + "')"; strsql2 = "select price from COST_TEMP_EMPLOYEE_PRICE where not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "') and type = 2"; if (textEditPrice.Text.ToString().Trim() != "" || textEditInsurance.Text.ToString().Trim() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("此时间范围的记录已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); TempEmpStandardPriceQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("关键数据不能为空!"); } conn.Close(); }
private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e) { TempEmpStandardPriceQuery.RefreshEX(); }