private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_shift(cname,cbegin,cend,rest_hours,overtime_rest_hours,overtime_begin) values('" + textEditName.Text.ToString().Trim() + "','" + dateTimePickerBegin.Text.ToString() + "','" + dateTimePickerEnd.Text.ToString() + "','" + textEditRest.Text.ToString().Trim() + "','" + textEditOverTimeRest.Text.ToString().Trim() + "','" + dateTimePickerOvertimeBegin.Text.ToString() + "')"; strsql2 = "select cname from cost_shift where cname = '" + textEditName.Text.ToString().Trim() + "'"; if (textEditName.Text.ToString().Trim() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("该考勤班次已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); ShiftQuery.RefreshEX(); this.Close(); } } } else { MessageBox.Show("名称不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update cost_shift set cname = '" + textEditName.Text.ToString().Trim() + "',cbegin = '" + dateTimePickerBegin.Text + "',cend = '" + dateTimePickerEnd.Text + "',rest_hours = '" + textEditRest.Text.ToString().Trim() + "',overtime_rest_hours = '" + textEditOvertimeRest.Text.ToString().Trim() + "',overtime_begin = '" + dateTimePickerOvertimeBegin.Text.ToString() + "' where cname ='" + cname + "'"; string sql2 = "select cname from cost_shift where cname = '" + textEditName.Text.ToString().Trim() + "'"; if (textEditName.Text.ToString().Trim() != "") { int rows = conn.ReturnRecordCount(sql2); if (rows > 0 && textEditName.Text.ToString().Trim() != cname) { MessageBox.Show("该考勤班次已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); ShiftQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("名称不能为空!"); } conn.Close(); }
public static ShiftQuery GetInstance() { if (wtqform == null || wtqform.IsDisposed) { wtqform = new ShiftQuery(); } return(wtqform); }
private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e) { ShiftQuery Frm = ShiftQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void SaleType_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; ShiftQuery Frm = ShiftQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); //Frm.Width = this.Width - 15; //Frm.Height = this.Width - 60; }
private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e) { string cname = "", cbegin = "", cend = "", overtime_begin = ""; decimal rest_hours = 0, overtime_rest_hours = 0; ShiftQuery.GetInfo(ref cname, ref cbegin, ref cend, ref rest_hours, ref overtime_rest_hours, ref overtime_begin); if (cname != "") { //SaleTypeUpdate Frm = SaleTypeUpdate.GetInstance(); ShiftUpdate Frm = new ShiftUpdate(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); } }
private void SaleTypeUpdate_Load(object sender, EventArgs e) { //this.WindowState = FormWindowState.Maximized; string cbegin = "", cend = "", overtime_begin = ""; decimal rest_hours = 0, overtime_rest_hours = 0; ShiftQuery.GetInfo(ref cname, ref cbegin, ref cend, ref rest_hours, ref overtime_rest_hours, ref overtime_begin); if (cname != "") { textEditName.Text = cname; dateTimePickerBegin.Text = cbegin; dateTimePickerEnd.Text = cend; textEditRest.Text = rest_hours.ToString(); textEditOvertimeRest.Text = overtime_rest_hours.ToString(); dateTimePickerOvertimeBegin.Text = overtime_begin; } //this.WindowState = FormWindowState.Maximized; }
private void barButtonItem禁用_ItemClick(object sender, ItemClickEventArgs e) { ShiftQuery.cDisable(); ShiftQuery.RefreshEX(); }
private void barButtonItem删除_ItemClick(object sender, ItemClickEventArgs e) { ShiftQuery.Delete(); ShiftQuery.RefreshEX(); }