public static void GetInfo(ref int id, ref string cno, ref string cname, ref int deptid, ref string deptname, ref int positionid, ref string positionname, ref int linetypeid, ref string linetypename) { if (dlqform == null || dlqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); cno = ""; } else if (dlqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); cno = ""; } else { cno = dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString(); cname = dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); deptname = dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString(); positionname = dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString(); linetypename = dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString(); id = int.Parse(Common.IsNull(dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[5].ToString())); positionid = int.Parse(Common.IsNull(dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[6].ToString())); linetypeid = int.Parse(Common.IsNull(dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[7].ToString())); deptid = int.Parse(Common.IsNull(dlqform.gridView1.GetDataRow(dlqform.gridView1.GetSelectedRows()[0]).ItemArray[8].ToString())); } }
public static void GetInfo(ref int id, ref string yyyymm, ref decimal steelnetrate) { if (weqform == null || weqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); } else if (weqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); } else { id = Convert.ToInt32(Common.IsNull(weqform.gridView1.GetDataRow(weqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); yyyymm = weqform.gridView1.GetDataRow(weqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); steelnetrate = Convert.ToDecimal(Common.IsNull(weqform.gridView1.GetDataRow(weqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); } }
public static void GetInfo(ref int id, ref string yyyymm, ref int saletypeid, ref decimal rentexpense) { if (reqform == null || reqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); } else if (reqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); } else { id = Convert.ToInt32(Common.IsNull(reqform.gridView1.GetDataRow(reqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); yyyymm = reqform.gridView1.GetDataRow(reqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); saletypeid = Convert.ToInt32(Common.IsNull(reqform.gridView1.GetDataRow(reqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); rentexpense = Convert.ToDecimal(Common.IsNull(reqform.gridView1.GetDataRow(reqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString())); } }
public static void GetInfo(ref int id, ref string yyyy, ref int quarterid, ref int saletypeid, ref decimal price) { if (crqform == null || crqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); } else if (crqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); } else { id = Convert.ToInt32(Common.IsNull(crqform.gridView1.GetDataRow(crqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); yyyy = crqform.gridView1.GetDataRow(crqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); quarterid = Convert.ToInt32(Common.IsNull(crqform.gridView1.GetDataRow(crqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); saletypeid = Convert.ToInt32(Common.IsNull(crqform.gridView1.GetDataRow(crqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString())); price = Convert.ToDecimal(Common.IsNull(crqform.gridView1.GetDataRow(crqform.gridView1.GetSelectedRows()[0]).ItemArray[6].ToString())); } }
public static void GetInfo(ref int id, ref string yyyymm, ref string taskname, ref int organizationid, ref int toorganizationid) { if (spqform == null || spqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); } else if (spqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); } else { id = Convert.ToInt32(Common.IsNull(spqform.gridView1.GetDataRow(spqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); yyyymm = spqform.gridView1.GetDataRow(spqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); taskname = spqform.gridView1.GetDataRow(spqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString(); organizationid = Convert.ToInt32(Common.IsNull(spqform.gridView1.GetDataRow(spqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString())); toorganizationid = Convert.ToInt32(Common.IsNull(spqform.gridView1.GetDataRow(spqform.gridView1.GetSelectedRows()[0]).ItemArray[5].ToString())); } }
public static void GetInfo(ref int id, ref string yyyymm, ref int saletypeid, ref int deptid, ref decimal deptstandardpoint) { if (dspqform == null || dspqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); } else if (dspqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); } else { id = Convert.ToInt32(Common.IsNull(dspqform.gridView1.GetDataRow(dspqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); yyyymm = dspqform.gridView1.GetDataRow(dspqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); saletypeid = Convert.ToInt32(Common.IsNull(dspqform.gridView1.GetDataRow(dspqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); deptid = Convert.ToInt32(Common.IsNull(dspqform.gridView1.GetDataRow(dspqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString())); deptstandardpoint = Convert.ToDecimal(Common.IsNull(dspqform.gridView1.GetDataRow(dspqform.gridView1.GetSelectedRows()[0]).ItemArray[6].ToString())); } }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update cost_rate set cost_rate = ltrim(rtrim('" + Common.IsNull(textEditCostRate.Text.ToString()) + "'))"; sql = sql + " where cid = " + textEditID.Text.ToString(); bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); CostRateQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } conn.Close(); }
public static void GetInfo(ref int id, ref string cname, ref int persontypeid, ref string persontypename) { if (pqform == null || pqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else if (pqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else { cname = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString(); persontypename = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); id = int.Parse(Common.IsNull(pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); persontypeid = int.Parse(Common.IsNull(pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString())); } }
public static void GetInfo(ref int id, ref string month, ref int level_begin, ref int level_end) { if (dlpqform == null || dlpqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); month = ""; } else if (dlpqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); month = ""; } else { id = int.Parse(Common.IsNull(dlpqform.gridView1.GetDataRow(dlpqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); month = dlpqform.gridView1.GetDataRow(dlpqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); level_begin = int.Parse(Common.IsNull(dlpqform.gridView1.GetDataRow(dlpqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString())); level_end = int.Parse(Common.IsNull(dlpqform.gridView1.GetDataRow(dlpqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString())); } }
public static void GetInfo(ref int id, ref string cname) { if (wtqform == null || wtqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else if (wtqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else { //return wtqform.gridView1.CheckedItems[0].SubItems[0].Text.ToString(); id = int.Parse(Common.IsNull(wtqform.gridView1.GetDataRow(wtqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); cname = wtqform.gridView1.GetDataRow(wtqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); } //return ""; }
public static void GetInfo(ref int deptid, ref string cname, ref string attendance, ref string attendance3rd, ref string attendance4th) { if (pqform == null || pqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else if (pqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else { deptid = int.Parse(Common.IsNull(pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); cname = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); attendance = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString(); attendance3rd = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString(); attendance4th = pqform.gridView1.GetDataRow(pqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString(); } }
public static void GetInfo(ref int id, ref string cname, ref string cnamemes, ref int saletypeid, ref string saletypename, ref int workshopid, ref string workshop) { if (ltqform == null || ltqform.IsDisposed) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else if (ltqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要修改的记录!"); cname = ""; } else { cname = ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString(); cnamemes = ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString(); saletypename = ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString(); workshop = ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); workshopid = int.Parse(Common.IsNull(ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString())); id = int.Parse(Common.IsNull(ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[5].ToString())); saletypeid = int.Parse(Common.IsNull(ltqform.gridView1.GetDataRow(ltqform.gridView1.GetSelectedRows()[0]).ItemArray[6].ToString())); } }
public static void GetInfo(ref int id, ref string logname, ref string personname, ref string dept1, ref string dept2, ref string dept3, ref string dept, ref string remark) { if (dqform == null || dqform.IsDisposed) { MessageBox.Show("没有选中记录!"); logname = ""; } else if (dqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中记录!"); logname = ""; } else { id = int.Parse(Common.IsNull(dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[0].ToString())); logname = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString(); personname = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[2].ToString(); dept1 = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[3].ToString(); dept2 = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[4].ToString(); dept3 = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[5].ToString(); dept = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[6].ToString(); remark = dqform.gridView1.GetDataRow(dqform.gridView1.GetSelectedRows()[0]).ItemArray[7].ToString(); } }
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(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_rate(yyyy,quarter_id,sale_type_id,cost_rate) values('" + dateTimePicker1.Text.ToString() + "'," + comboBoxQuarter.SelectedValue.ToString() + "," + comboBoxSaleType.SelectedValue.ToString() + ",ltrim(rtrim(" + Common.IsNull(textEditCostRate.Text.ToString()) + ")))"; strsql2 = "select * from cost_rate where yyyy ='" + dateTimePicker1.Text.ToString() + "' and sale_type_id = " + Common.IsZero(comboBoxSaleType.SelectedValue.ToString()) + " and quarter_id = " + Common.IsZero(comboBoxQuarter.SelectedValue.ToString()); if (comboBoxQuarter.SelectedValue.ToString() == "0") { MessageBox.Show("请选择季度"); } else if (comboBoxSaleType.SelectedValue.ToString() == "0") { MessageBox.Show("请选择营业类型"); } else if (textEditCostRate.Text.ToString() == "") { MessageBox.Show("成本比率不能为空!"); } else { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("该成本比率已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); CostRateQuery.RefreshEX(); this.Close(); } } } conn.Close(); }
private bool Exist() { ConnDB conn = new ConnDB(); string strsql; int rows; strsql = "select * from COST_INDIRECT_LABOUR_LEVEL_PRICE where YYYYMM = '" + dateTimePicker1.Text.ToString() + "' and level_begin = " + Common.IsNull(ilpiform.textEditLevelBegin.Text.ToString().Trim()) + " and level_end = " + Common.IsNull(ilpiform.textEditLevelEnd.Text.ToString().Trim()); rows = conn.ReturnRecordCount(strsql); if (rows > 0) { labelControlCheck.Text = "该数据已经存在!"; gridControl1.Enabled = false; return(true); } else { labelControlCheck.Text = ""; gridControl1.Enabled = true; return(false); } }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; int linetypeid, deptid; linetypeid = (int)comboBoxLineType.SelectedValue; deptid = (int)comboBoxDept.SelectedValue; if (deptid > 0) { if (linetypeid > 0) { strsql = "select isnull(i.cid,0) id,'" + dateEditDate.Text + "' 日期,d.cid 部门id,d.cname 部门,l.cid 拉别id,l.cname 拉别,j.cid 直接人工id,j.cno 工号,j.cname 姓名,i.work_type_id 上班类型id,w.cname 上班类型,'" + Common.IsNull(textEditHours.Text.ToString()) + "' 小时数 from (select * from COST_DIRECT_LABOUR_ATTENDANCE where cdate = '" + dateEditDate.Text + "') i right join COST_DIRECT_LABOUR j on i.DIRECT_LABOUR_ID = j.CID left join COST_LINETYPE l on j.LINETYPE_ID = l.CID left join cost_work_type w on i.work_type_id = w.cid left join cost_dept d on j.dept_id = d.cid where j.LINETYPE_ID = " + linetypeid + " and j.dept_id = " + deptid + " and j.person_type_id = 3 order by l.cname"; } else { strsql = "select isnull(i.cid,0) id,'" + dateEditDate.Text + "' 日期,d.cid 部门id,d.cname 部门,l.cid 拉别id,l.cname 拉别,j.cid 直接人工id,j.cno 工号,j.cname 姓名,i.work_type_id 上班类型id,w.cname 上班类型,'" + Common.IsNull(textEditHours.Text.ToString()) + "' 小时数 from(select * from COST_DIRECT_LABOUR_ATTENDANCE where cdate = '" + dateEditDate.Text + "') i right join COST_DIRECT_LABOUR j on i.DIRECT_LABOUR_ID = j.CID left join COST_LINETYPE l on j.LINETYPE_ID = l.CID left join cost_work_type w on i.work_type_id = w.cid left join cost_dept d on j.dept_id = d.cid where j.dept_id = " + deptid + " and j.person_type_id = 3 order by l.cname"; } } else { strsql = "select isnull(i.cid,0) id,'" + dateEditDate.Text + "' 日期,d.cid 部门id,d.cname 部门,l.cid 拉别id,l.cname 拉别,j.cid 直接人工id,j.cno 工号,j.cname 姓名,i.work_type_id 上班类型id,w.cname 上班类型,'" + Common.IsNull(textEditHours.Text.ToString()) + "' 小时数 from(select * from COST_DIRECT_LABOUR_ATTENDANCE where cdate = '" + dateEditDate.Text + "') i right join COST_DIRECT_LABOUR j on i.DIRECT_LABOUR_ID = j.CID left join COST_LINETYPE l on j.LINETYPE_ID = l.CID left join cost_work_type w on i.work_type_id = w.cid left join cost_dept d on j.dept_id = d.cid where j.person_type_id = 3 order by l.cname"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[2].Visible = false; gridView1.Columns[4].Visible = false; gridView1.Columns[6].Visible = false; gridView1.Columns[9].Visible = false; gridView1.Columns[0].OptionsColumn.ReadOnly = true; gridView1.Columns[1].OptionsColumn.ReadOnly = true; gridView1.Columns[2].OptionsColumn.ReadOnly = true; gridView1.Columns[3].OptionsColumn.ReadOnly = true; gridView1.Columns[4].OptionsColumn.ReadOnly = true; gridView1.Columns[5].OptionsColumn.ReadOnly = true; gridView1.Columns[6].OptionsColumn.ReadOnly = true; gridView1.Columns[7].OptionsColumn.ReadOnly = true; gridView1.Columns[8].OptionsColumn.ReadOnly = true; gridView1.Columns[9].OptionsColumn.ReadOnly = true; gridView1.Columns[10].OptionsColumn.ReadOnly = true; conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql; strsql = "insert into COST_EXPENSE(CTYPE,TYPE_DES,CMONTH,EXPENSE,NOTE) values('" + comboBoxType.SelectedValue.ToString() + "','" + comboBoxType.Text.ToString() + "','" + dateTimePickerMonth.Text.ToString() + "','" + Common.IsNull(textEditExpense.Text.ToString().Trim()) + "','" + textEditNote.Text.ToString().Trim() + "')"; if (textEditExpense.Text.ToString().Trim() != "") { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); TempEmpExpenseQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } else { MessageBox.Show("费用金额不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_depreciation(yyyymm,sale_type_id,depreciation) values('" + dateTimePicker1.Text.ToString() + "'," + comboBoxSaleType.SelectedValue.ToString() + ",ltrim(rtrim(" + Common.IsNull(textEditDepreciation.Text.ToString()) + ")))"; strsql2 = "select yyyymm from cost_depreciation where yyyymm ='" + dateTimePicker1.Text.ToString() + "' and sale_type_id = " + comboBoxSaleType.SelectedValue.ToString(); if (textEditDepreciation.Text.ToString() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("该折旧费已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); DepreciationQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("折旧费不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_temp_worker(cdate,sale_type_id,dept_id,labour_num,hours) values('" + dateEditDate.Text.ToString() + "','" + Common.IsZero(comboBoxSaleType.SelectedValue.ToString()) + "','" + Common.IsZero(comboBoxDept.SelectedValue.ToString()) + "'," + Common.IsNull(textEditLabourNum.Text.ToString().Trim()) + "," + textEditHours.Text.ToString().Trim() + ")"; strsql2 = "select cdate from cost_temp_worker where cdate ='" + dateEditDate.Text.ToString() + "' and sale_type_id = " + comboBoxSaleType.SelectedValue.ToString() + " and dept_id = " + comboBoxDept.SelectedValue.ToString(); if (textEditHours.Text.ToString() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("此日期记录已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); TempWorkerQuery.RefreshEX(); this.Close(); } } } else { MessageBox.Show("投入工时不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update COST_TEMP_EMPLOYEE_price set supplier = '" + textEditSupplier.Text.ToString().Trim() + "',begin_date = '" + dateTimePickerBegin.Text + "',end_date='" + dateTimePickerEnd.Text + "',from_type='" + comboBoxType.SelectedValue.ToString() + "',price='" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "',meal_price='" + Common.IsNull(textEditMeal.Text.ToString().Trim()) + "',night_price='" + Common.IsNull(textEditNight.Text.ToString().Trim()) + "',travel_price='" + Common.IsNull(textEditTravel.Text.ToString().Trim()) + "',regular_price='" + Common.IsNull(textEditRegular.Text.ToString().Trim()) + "'"; sql = sql + " where cid = '" + id + "'"; string sql2 = "select * from cost_temp_employee_price where cid <> '" + id + "' and supplier = '" + textEditSupplier.Text.ToString().Trim() + "' and not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "') and from_type = '" + comboBoxType.SelectedValue.ToString() + "' and type =1"; int rows = conn.ReturnRecordCount(sql2); if (rows > 0) { MessageBox.Show("此时间范围的价格信息已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); TempEmpPriceQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } conn.Close(); }
public static void Save() { if (ilpiform == null || ilpiform.IsDisposed) { } else { ConnDB conn = new ConnDB(); string strsql; bool isok = false; DateTime dt1 = Convert.ToDateTime(ilpiform.dateTimePicker1.Text); DateTime dt2 = System.DateTime.Now; int month = (dt2.Year - dt1.Year) * 12 + (dt2.Month - dt1.Month); if (ilpiform.textEditLevelBegin.Text.ToString().Trim() == "" || ilpiform.textEditLevelEnd.Text.ToString().Trim() == "") { MessageBox.Show("员工等级不能为空!"); } else if (!ilpiform.Exist()) { if (month < -1) { MessageBox.Show("月份错误!"); } else { ilpiform.gridView1.FocusInvalidRow(); for (int i = 0; i < ilpiform.gridView1.RowCount; i++) { strsql = "insert into COST_INDIRECT_LABOUR_LEVEL_PRICE(yyyymm,level_begin,level_end,work_type,price) values('" + ilpiform.dateTimePicker1.Text.ToString() + "'," + ilpiform.textEditLevelBegin.Text.ToString().Trim() + "," + ilpiform.textEditLevelEnd.Text.ToString().Trim() + "," + ilpiform.gridView1.GetDataRow(i).ItemArray[0].ToString() + "," + Common.IsNull(ilpiform.gridView1.GetDataRow(i).ItemArray[2].ToString()) + ")"; isok = conn.EditDatabase(strsql); } if (isok) { MessageBox.Show("保存成功!"); InDirectLabourLevelPriceQuery.RefreshEX(); ilpiform.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("该数据已经存在!"); } ilpiform.ischange = false; conn.Close(); } }
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,SUPPLIER,BEGIN_DATE,END_DATE,FROM_TYPE,PRICE,MEAL_PRICE,NIGHT_PRICE,TRAVEL_PRICE,REGULAR_PRICE) values(1,'" + textEditSupplier.Text.ToString().Trim() + "','" + dateTimePickerBegin.Text.ToString() + "','" + dateTimePickerEnd.Text.ToString() + "','" + comboBoxType.SelectedValue.ToString() + "','" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "','" + Common.IsNull(textEditMeal.Text.ToString().Trim()) + "','" + Common.IsNull(textEditNight.Text.ToString().Trim()) + "','" + Common.IsNull(textEditTravel.Text.ToString().Trim()) + "','" + Common.IsNull(textEditRegular.Text.ToString().Trim()) + "')"; strsql2 = "select price from COST_TEMP_EMPLOYEE_PRICE where SUPPLIER ='" + textEditSupplier.Text.ToString().Trim() + "' and not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "') and from_type = '" + comboBoxType.SelectedValue.ToString() + "' and type = 1"; if (textEditSupplier.Text.ToString().Trim() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("此时间范围的价格信息已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); TempEmpPriceQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("供应商不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update COST_expense set ctype = '" + comboBoxType.SelectedValue.ToString() + "',type_des = '" + comboBoxType.Text.ToString() + "',cmonth='" + dateTimePickerMonth.Text + "',expense='" + Common.IsNull(textEditExpense.Text.ToString().Trim()) + "',note='" + textEditExpense.Text.ToString().Trim() + "'"; sql = sql + " where cid = '" + id + "'"; bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); TempEmpExpenseQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } conn.Close(); }
public static void Save() { if (dlpiform == null || dlpiform.IsDisposed) { } else { ConnDB conn = new ConnDB(); string strsql; bool isok = false; DateTime dt1 = Convert.ToDateTime(dlpiform.dateTimePicker1.Text); DateTime dt2 = System.DateTime.Now; int month = (dt2.Year - dt1.Year) * 12 + (dt2.Month - dt1.Month); if (!dlpiform.Exist()) { if (month < -1) { MessageBox.Show("月份错误!"); } else { dlpiform.gridView1.FocusInvalidRow(); for (int i = 0; i < dlpiform.gridView1.RowCount; i++) { strsql = "insert into cost_direct_labour_price(yyyymm,work_type,price) values('" + dlpiform.dateTimePicker1.Text.ToString() + "'," + dlpiform.gridView1.GetDataRow(i).ItemArray[0].ToString() + "," + Common.IsNull(dlpiform.gridView1.GetDataRow(i).ItemArray[2].ToString()) + ")"; isok = conn.EditDatabase(strsql); } if (isok) { MessageBox.Show("保存成功!"); DirectLabourPriceQuery.RefreshEX(); } else { MessageBox.Show("失败!"); } } } dlpiform.ischange = false; conn.Close(); } }
private void showDetail2() { ConnDB conn = new ConnDB(); string strsql; int deptid; deptid = (int)comboBoxDept.SelectedValue; if (deptid > 0) { strsql = "select isnull(i.cid,0) id,'" + dateEditDate.Text + "' 日期,d.cid 部门id,d.cname 部门,j.cid 直接人工id,j.cno 工号,j.cname 姓名,i.work_type_id 上班类型id,w.cname 上班类型,'" + Common.IsNull(textEditHours.Text.ToString()) + "' 小时数 from (select * from COST_DIRECT_LABOUR_ATTENDANCE where cdate = '" + dateEditDate.Text + "') i right join COST_DIRECT_LABOUR j on i.DIRECT_LABOUR_ID = j.CID left join COST_DEPT D on j.DEPT_ID = D.CID left join cost_work_type w on i.work_type_id = w.cid where j.person_type_id = 4 and D.cid = " + Common.IsZero(deptid.ToString()) + " order by d.cname"; } else { strsql = "select isnull(i.cid,0) id,'" + dateEditDate.Text + "' 日期,d.cid 部门id,d.cname 部门,j.cid 直接人工id,j.cno 工号,j.cname 姓名,i.work_type_id 上班类型id,w.cname 上班类型,'" + Common.IsNull(textEditHours.Text.ToString()) + "' 小时数 from(select * from COST_DIRECT_LABOUR_ATTENDANCE where cdate = '" + dateEditDate.Text + "') i right join COST_DIRECT_LABOUR j on i.DIRECT_LABOUR_ID = j.CID left join COST_DEPT D on j.DEPT_ID = D.CID left join cost_work_type w on i.work_type_id = w.cid where j.person_type_id = 4 order by d.cname"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[2].Visible = false; gridView1.Columns[4].Visible = false; gridView1.Columns[7].Visible = false; gridView1.Columns[0].OptionsColumn.ReadOnly = true; gridView1.Columns[1].OptionsColumn.ReadOnly = true; gridView1.Columns[2].OptionsColumn.ReadOnly = true; gridView1.Columns[3].OptionsColumn.ReadOnly = true; gridView1.Columns[4].OptionsColumn.ReadOnly = true; gridView1.Columns[5].OptionsColumn.ReadOnly = true; gridView1.Columns[6].OptionsColumn.ReadOnly = true; gridView1.Columns[7].OptionsColumn.ReadOnly = true; gridView1.Columns[8].OptionsColumn.ReadOnly = true; conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update COST_EXPENSE set emp_no = '" + textEditEmpno.Text.ToString().Trim() + "',begin_date = '" + dateTimePickerDate.Text + "',expense='" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "'"; sql = sql + " where cid = '" + id + "'"; string sql2 = "select * from COST_EXPENSE where cid <> '" + id + "' and emp_no = '" + textEditEmpno.Text.ToString().Trim() + "' and begin_date = '" + dateTimePickerDate.Text.ToString() + "' and ctype =2"; int rows = conn.ReturnRecordCount(sql2); if (rows > 0) { MessageBox.Show("该员工这天的交通补贴信息已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); TempEmpTravelExpenseQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update cost_direct_labour set cno = ltrim(rtrim('" + textEditNo.Text.ToString() + "')),cname = ltrim(rtrim('" + textEditName.Text.ToString() + "')),position_id =" + Common.IsZero(comboBoxPosition.SelectedValue.ToString()) + ",person_level = " + textEditLevel.Text.ToString() + ",dept_id =" + comboBoxDept.SelectedValue.ToString(); sql = sql + " where cid = " + textEditID.Text.ToString(); string sql2 = "select cname from cost_direct_labour where cno = '" + textEditNo.Text.ToString().Trim() + "' and cid <> " + textEditID.Text; string sql3 = "select * from cost_direct_labour where cno = '" + textEditNo.Text.ToString().Trim() + "' and cname ='" + textEditName.Text.ToString().Trim() + "' and position_id = " + comboBoxPosition.SelectedValue.ToString() + " and dept_id =" + comboBoxDept.SelectedValue.ToString() + " and person_level = " + Common.IsNull(textEditLevel.Text.ToString().Trim()); if (textEditNo.Text.ToString().Trim() != "" && textEditName.Text.ToString().Trim() != "" && comboBoxPosition.SelectedValue.ToString() != "0" && comboBoxDept.SelectedValue.ToString() != "0" && textEditLevel.Text.ToString().Trim() != "") { int rows = conn.ReturnRecordCount(sql2); int rows2 = conn.ReturnRecordCount(sql3); if (rows > 0) { MessageBox.Show("该工号已经存在!"); } else if (rows2 > 0) { MessageBox.Show("该人员已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); IndirectLabourQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("不能为空值!"); } conn.Close(); }