private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql; string yyyymm = "", deptid = "", indirectlabourid = ""; IndirectLabourPriceQuery.GetInfo(ref yyyymm, ref deptid, ref indirectlabourid); if (deptid == "0") { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "') i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } else if (indirectlabourid == "0") { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "' and j.dept_id = " + deptid + ") i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } else { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "' and j.dept_id = " + deptid + " and indirect_labour_id = " + indirectlabourid + ") i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[5].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; conn.Close(); }
private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePicker1.Text.ToString(); if (ilpqform.comboBoxDept.SelectedValue.ToString() == "0") { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "') i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } else if (ilpqform.comboBoxIndirectLabour.SelectedValue.ToString() == "0") { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "' and j.dept_id = " + comboBoxDept.SelectedValue.ToString() + ") i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } else { strsql = "select i.indirect_labour_id 员工id,i.yyyymm 年月,i.deptname 部门,i.cno 工号,i.cname 姓名,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select i.*,j.cno,j.cname,d.cid as deptid,d.cname as deptname from cost_indirect_labour_price i left join cost_direct_labour j on i.indirect_labour_id = j.cid left join cost_dept d on j.dept_id = d.cid where isnull(YYYYMM,'') ='" + yyyymm + "' and j.dept_id = " + comboBoxDept.SelectedValue.ToString() + " and indirect_labour_id = " + comboBoxIndirectLabour.SelectedValue.ToString() + ") i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE_id = j.cid "; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[5].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; conn.Close(); }
private void AsyncShowDetail(IAsyncResult result) { MethodCaller aysnDelegate = result.AsyncState as MethodCaller; if (aysnDelegate != null) { bool success = aysnDelegate.EndInvoke(result); if (success) { ConnDB conn = new ConnDB(); string strsql; strsql = "select employee_id_ 工号,name_ 姓名,DEPARTMENT_ 部门,员工等级 = case when cast(isnull(e_band,'0') as int)>0 then '*' else '' end from OPENQUERY (BARCODE, 'SELECT employee_id_ ,name_ ,DEPARTMENT_ ,e_band FROM IHPS_ID_USER_PROFILE where department_ like ''制造中心%''')"; DataSet ds = conn.ReturnDataSet(strsql); Action <DataSet> action = (data) => { gridControl1.DataSource = data.Tables[0].DefaultView; //gridView1.Columns[0].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; simpleButton导入.Enabled = true; labeMsg.Text = ""; }; Invoke(action, ds); conn.Close(); } } }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; if (comboBoxDept.SelectedValue.ToString() == "0") { strsql = "select cdate 日期,emp_no 工号,emp_name 姓名,wkname 星期,gz_int 正常上班,jb_ps_int 平时加班,jb_xx_int 休息日加班,jb_jr_int 节假日加班,t.dept4 部门,d.cname 本系统部门,rank 员工组,PERSON_TYPE 员工类型 from COST_DIRECT_LABOUR_ATTENDANCE t left join cost_dept_map m on T.DEPT4 = M.DEPT4 left join cost_dept d on m.dept_id = d.cid where t.cdate like '" + dateTimePickerMonth.Text + "%' order by cdate"; } else { strsql = "select cdate 日期,emp_no 工号,emp_name 姓名,wkname 星期,gz_int 正常上班,jb_ps_int 平时加班,jb_xx_int 休息日加班,jb_jr_int 节假日加班,t.dept4 部门,d.cname 本系统部门,rank 员工组,PERSON_TYPE 员工类型 from COST_DIRECT_LABOUR_ATTENDANCE t left join cost_dept_map m on T.DEPT4 = M.DEPT4 left join cost_dept d on m.dept_id = d.cid where t.cdate like '" + dateTimePickerMonth.Text + "%' and d.cid = '" + comboBoxDept.SelectedValue.ToString() + "' order by cdate"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; //gridView1.Columns[0].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 showDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePickerBegin.Text.ToString(); strsql = "select cid,begin_date 起始日期,end_date 截止日期,price '最低工资标准工时费(元/时)',insurance_price '社保公积金(元)' from COST_TEMP_EMPLOYEE_price where type = 2 and not (begin_date > '" + dateTimePickerEnd.Text + "' or end_date <'" + dateTimePickerBegin.Text + "')"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].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.ColumnPanelRowHeight = 35; //gridView1.OptionsView.AllowHtmlDrawHeaders = true; //gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; ////表头及行内容居中显示 ////gridView1.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePickerMonth.Text.ToString(); strsql = "select cid,ctype 费用类型id,b.cname 费用类型,expense 费用金额,note 描述 from COST_expense e left join cost_base_data b on e.ctype = b.sub_id and b.module_id = 2 where cmonth = '" + dateTimePickerMonth.Text + "'"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[1].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.ColumnPanelRowHeight = 35; //gridView1.OptionsView.AllowHtmlDrawHeaders = true; //gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; ////表头及行内容居中显示 ////gridView1.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; conn.Close(); }
private void ShowDetail() { string yyyymm = ""; int id = 0, level_begin = 0, level_end = 0; InDirectLabourLevelPriceQuery.GetInfo(ref id, ref yyyymm, ref level_begin, ref level_end); string strsql; if (yyyymm != "") { ConnDB conn = new ConnDB(); strsql = "select i.cid id,i.yyyymm 年月,i.level_begin '员工等级(起)',i.level_end '员工等级(止)',j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select * from cost_indirect_labour_level_price where isnull(YYYYMM,'') ='" + yyyymm + "' and level_begin = " + level_begin + " and level_end = " + level_end + ") i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE = j.cid "; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[4].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; conn.Close(); } }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; int saletypeid; saletypeid = (int)comboBoxSaleType.SelectedValue; if (saletypeid > 0) { strsql = "select j.cname 营业类型,d.cname 车间,i.cname ERP中线体,i.cname_mes MES中线体,d.sub_id,i.cid,j.cid,i.forbidden 禁用 from cost_linetype i left join cost_saletype j on i.saletype_id = j.cid left join cost_base_data d on d.module_id = 3 and i.work_shop = d.sub_id where i.saletype_id = " + Common.IsZero(saletypeid.ToString()) + " order by i.cname"; } else { strsql = "select j.cname 营业类型,d.cname 车间,i.cname ERP中线体,i.cname_mes MES中线体,d.sub_id,i.cid,j.cid,i.forbidden 禁用 from cost_linetype i left join cost_saletype j on i.saletype_id = j.cid left join cost_base_data d on d.module_id = 3 and i.work_shop = d.sub_id order by i.cname"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[4].Visible = false; gridView1.Columns[5].Visible = false; gridView1.Columns[6].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; IsForbidden(); conn.Close(); }
private void textEditCno_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ConnDB conn = new ConnDB(); string sql; sql = "select cname,cfrom,dept,shift from COST_TEMP_EMPLOYEE where cno = '" + textEditCno.Text.ToString().Trim() + "' and status != '离职'"; DataSet ds = conn.ReturnDataSet(sql); if (ds.Tables[0].Rows.Count > 0) { textEditName.Text = ds.Tables[0].Rows[0][0].ToString(); textEditDept.Text = ds.Tables[0].Rows[0][2].ToString(); textEditFrom.Text = ds.Tables[0].Rows[0][1].ToString(); comboBoxShift.SelectedIndex = -1; comboBoxShift.SelectedValue = ds.Tables[0].Rows[0][3].ToString(); } else { textEditName.Text = ""; textEditDept.Text = ""; textEditFrom.Text = ""; comboBoxShift.SelectedIndex = -1; comboBoxShift.SelectedValue = "0"; } bool right = TempEmpAttQuery.SubmitRight(textEditCno.Text.ToString().Trim()); } }
private void hyperlinkLabelControl1_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, password; password = Common.MD5Encrypt(textEditPsw.Text.ToString().Trim()); strsql = "select password from cost_user where cname = '" + textEditName.Text.ToString().Trim() + "'"; if (textEditName.Text.ToString().Trim() != "" && textEditPsw.Text.ToString().Trim() != "") { DataSet ds = conn.ReturnDataSet(strsql); if (ds.Tables[0].Rows[0][0].ToString() != "") { if (password == ds.Tables[0].Rows[0][0].ToString()) { ChangePass frm = new ChangePass(); frm.Show(); cname = textEditName.Text.ToString().Trim(); } else { MessageBox.Show("密码不正确!"); } } else { MessageBox.Show("用户名不存在!"); } } else { MessageBox.Show("用户名或密码不能为空!"); } conn.Close(); }
private void AsyncShowDetail(IAsyncResult result) { MethodCaller aysnDelegate = result.AsyncState as MethodCaller; if (aysnDelegate != null) { bool success = aysnDelegate.EndInvoke(result); if (success) { ConnDB conn = new ConnDB(); string strsql; strsql = "select CMONTH 月份,MAT_CODE 新物料编码,CUSTOMER 客户,PRODUCT_MODEL 产品型号,STANDARD_HOURS 标工 from COST_HH_STANDARD_HOURS where cmonth = '" + dateTimePickerMonth.Text + "'"; DataSet ds = conn.ReturnDataSet(strsql); Action <DataSet> action = (data) => { gridControl1.DataSource = data.Tables[0].DefaultView; gridView1.Columns[0].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; simpleButton导入.Enabled = true; simpleButton清空.Enabled = true; }; Invoke(action, ds); 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 ShowDetail() { ConnDB conn = new ConnDB(); string strsql, month; int deptid; deptid = (int)comboBoxDept.SelectedValue; month = dateTimePicker1.Text.ToString(); if (deptid == 0) { strsql = "select * from (select SALE_TYPE_NAME 营业类型,dept_name 部门,CONVERT(varchar(100), CDATE, 23) 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,EMS_HH_HOURS 产出工时,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单小时成本,STANDARD_POINT 标准单小时成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_DEPT_CALCULATE where cdate like '" + month + "%' and sale_type_id =13 union "; strsql = strsql + "select SALE_TYPE_NAME 营业类型,dept_name 部门,'汇总:' 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,EMS_HH_HOURS 产出工时,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单小时成本,STANDARD_POINT 标准单小时成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_DEPT_MONTH_CALCULATE where cmonth = '" + month + "' and sale_type_id =13) i order by 部门"; } else { strsql = "select * from (select SALE_TYPE_NAME 营业类型,dept_name 部门,CONVERT(varchar(100), CDATE, 23) 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,EMS_HH_HOURS 产出工时,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单小时成本,STANDARD_POINT 标准单小时成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_DEPT_CALCULATE where cdate like '" + month + "%' and sale_type_id =13 and dept_id = " + deptid; strsql = strsql + " union select SALE_TYPE_NAME 营业类型,dept_name 部门,'汇总:' 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,EMS_HH_HOURS 产出工时,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单小时成本,STANDARD_POINT 标准单小时成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_DEPT_MONTH_CALCULATE where cmonth = '" + month + "' and sale_type_id =13 and dept_id = " + deptid + ") i"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; //gridView1.Columns[0].OptionsColumn.ReadOnly = true; //gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; strsql = "select CNO 临时工号,e.CNAME 姓名,SEX 性别,REGISTER_DATE 报到日期,CFROM 输送渠道,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,DEPT 部门,ID_NUMBER 身份证号,phone_no 手机号码,shift 班次,STATUS 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where status = '在职'"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[6].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; gridView1.Columns[11].OptionsColumn.ReadOnly = true; gridView1.Columns[12].OptionsColumn.ReadOnly = true; gridView1.Columns[13].OptionsColumn.ReadOnly = true; conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePickerBegin.Text.ToString(); strsql = "select cid,e.emp_no 员工工号,t.cname 姓名,begin_date 日期,expense '交通补贴(元)' from COST_EXPENSE e left join COST_TEMP_EMPLOYEE t on e.emp_no = t.cno where ctype = 2 and begin_date <= '" + dateTimePickerEnd.Text + "' and begin_date >='" + dateTimePickerBegin.Text + "'"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].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.ColumnPanelRowHeight = 35; //gridView1.OptionsView.AllowHtmlDrawHeaders = true; //gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; ////表头及行内容居中显示 ////gridView1.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; conn.Close(); }
private void showDetailLocal() { ConnDB conn = new ConnDB(); string strsql; int saletypeid; saletypeid = (int)comboBoxSaleType.SelectedValue; if (saletypeid > 0) { strsql = "select CONVERT(varchar(100), cdate, 23) as 日期,line_type_name ERP拉别,l.cname 成本系统拉别,pointcount 点数 from cost_pointcount p left join cost_linetype l on p.line_type_name = l.cname where cdate like '%" + dateTimePickerMonth.Text + "%' and l.saletype_id = " + saletypeid; } else { strsql = "select CONVERT(varchar(100), cdate, 23) as 日期,line_type_name ERP拉别,l.cname 成本系统拉别,pointcount 点数 from cost_pointcount p left join cost_linetype l on p.line_type_name = l.cname left join cost_saletype s on l.saletype_id = s.cid where cdate like '%" + dateTimePickerMonth.Text + "%'"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[2].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; conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; int deptid; deptid = (int)comboBoxDept.SelectedValue; if (deptid > 0) { strsql = "select i.cno 工号,i.cname 姓名,j.cname 职位,i.PERSON_LEVEL 员工等级,e.cname 部门,i.cid,j.cid,e.cid,i.forbidden 禁用 from cost_direct_labour i left join cost_position j on i.position_id = j.cid left join cost_dept e on i.dept_id = e.cid where i.dept_id = " + Common.IsZero(deptid.ToString()) + " and i.person_type_id = 4 order by i.cname"; } else { strsql = "select i.cno 工号,i.cname 姓名,j.cname 职位,i.PERSON_LEVEL 员工等级,e.cname 部门,i.cid,j.cid,e.cid,i.forbidden 禁用 from cost_direct_labour i left join cost_position j on i.position_id = j.cid left join cost_dept e on i.dept_id = e.cid where i.person_type_id = 4 order by i.cname"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[5].Visible = false; gridView1.Columns[6].Visible = false; gridView1.Columns[7].Visible = false; gridView1.Columns[2].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; IsForbidden(); conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; int persontypeid; persontypeid = (int)comboBoxPersonType.SelectedValue; if (persontypeid > 0) { strsql = "select i.cname 职位,j.cname 人力类型,i.cid,j.cid,i.forbidden 禁用 from cost_position i left join cost_person_type j on i.person_type_id = j.cid where i.person_type_id = " + Common.IsZero(persontypeid.ToString()) + " order by i.cname"; } else { strsql = "select i.cname 职位,j.cname 人力类型,i.cid,j.cid,i.forbidden 禁用 from cost_position i left join cost_person_type j on i.person_type_id = j.cid order by i.cname"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[2].Visible = false; gridView1.Columns[3].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; IsForbidden(); conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql, yyyy; yyyy = dateTimePicker1.Text.ToString(); if (comboBoxQuarter.SelectedValue.ToString() == "0") { strsql = "select i.cid,i.yyyy 年,i.quarter_id 季度id,q.cname 季度,i.sale_type_id 营业类型id,j.cname 营业类型,d.cid 部门id,d.cname 部门,i.cost_rate 成本比率 from cost_rate i left join cost_saletype j on i.sale_type_id = j.cid left join cost_dept d on i.dept_id = d.cid left join cost_quarter q on i.quarter_id = q.cid where i.yyyy = '" + yyyy + "' and i.dept_id >0 order by i.yyyy,i.quarter_id"; } else { strsql = "select i.cid,i.yyyy 年,i.quarter_id 季度id,q.cname 季度,i.sale_type_id 营业类型id,j.cname 营业类型,d.cid 部门id,d.cname 部门,i.cost_rate 成本比率 from cost_rate i left join cost_saletype j on i.sale_type_id = j.cid left join cost_dept d on i.dept_id = d.cid left join cost_quarter q on i.quarter_id = q.cid where i.yyyy = '" + yyyy + "' and i.quarter_id = " + comboBoxQuarter.SelectedValue.ToString() + " and i.dept_id >0 order by i.yyyy,i.quarter_id"; } 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[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(); }
/// <summary> /// 回调函数 /// </summary> /// <param name="result"></param> private void AsyncShowDetail(IAsyncResult result) { MethodCaller aysnDelegate = result.AsyncState as MethodCaller; if (aysnDelegate != null) { bool success = aysnDelegate.EndInvoke(result); if (success) { ConnDB conn = new ConnDB(); string strsql; strsql = "select cdate 日期,hours HH产出工时 from COST_EMS_HH_HOURS where cdate like '" + dateTimePickerMonth.Text + "%'"; DataSet ds = conn.ReturnDataSet(strsql); Action <DataSet> action = (data) => { gridControl1.DataSource = data.Tables[0].DefaultView; //gridView1.Columns[0].Visible = false; gridView1.Columns[0].OptionsColumn.ReadOnly = true; gridView1.Columns[1].OptionsColumn.ReadOnly = true; simpleButtonImport.Enabled = true; simpleButtonClear.Enabled = true; }; Invoke(action, ds); conn.Close(); } } }
private void AsyncShowDetail(IAsyncResult result) { MethodCaller aysnDelegate = result.AsyncState as MethodCaller; if (aysnDelegate != null) { bool success = aysnDelegate.EndInvoke(result); if (success) { ConnDB conn = new ConnDB(); string strsql; DateTime begin_date, end_date; begin_date = Common.FirstDayOfMonth(dateTimePickerMonth.Value); end_date = Common.LastDayOfMonth(dateTimePickerMonth.Value); strsql = "select MATL_NO 料号,MATL_NAME 物料名称,PRICE 单价,BEGIN_DATE 价格开始日期,END_DATE 价格结束日期 from COST_MATL_PRICE where not (begin_date > '" + end_date + "' or end_date <'" + begin_date + "')"; DataSet ds = conn.ReturnDataSet(strsql); Action <DataSet> action = (data) => { gridControl1.DataSource = data.Tables[0].DefaultView; gridView1.Columns[0].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; simpleButton导入.Enabled = true; simpleButton清空.Enabled = true; }; Invoke(action, ds); conn.Close(); } } }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql, yyyy; yyyy = dateTimePicker1.Text.ToString(); if (comboBoxQuarter.SelectedValue.ToString() == "0") { strsql = "select i.cid,i.yyyy 年,i.quarter_id 季度id,q.cname 季度,i.rate 终端台数比率 from COST_QUANTITY_RATE i left join cost_quarter q on i.quarter_id = q.cid where i.yyyy = '" + yyyy + "' order by i.yyyy,i.quarter_id"; } else { strsql = "select i.cid,i.yyyy 年,i.quarter_id 季度id,q.cname 季度,i.rate 终端台数比率 from COST_QUANTITY_RATE i left join cost_quarter q on i.quarter_id = q.cid where i.yyyy = '" + yyyy + "' and i.quarter_id = " + comboBoxQuarter.SelectedValue.ToString() + " order by i.yyyy,i.quarter_id"; } DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[2].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; conn.Close(); }
private void AsyncShowDetail(IAsyncResult result) { MethodCaller aysnDelegate = result.AsyncState as MethodCaller; if (aysnDelegate != null) { bool success = aysnDelegate.EndInvoke(result); if (success) { ConnDB conn = new ConnDB(); string strsql; strsql = "select cid,e.emp_no 员工工号,t.cname 姓名,begin_date 日期,expense '交通补贴(元)' from COST_EXPENSE e left join COST_TEMP_EMPLOYEE t on e.emp_no = t.cno where ctype = 2 and begin_date <= '" + dateTimePickerEnd.Text + "' and begin_date >='" + dateTimePickerBegin.Text + "'"; DataSet ds = conn.ReturnDataSet(strsql); Action <DataSet> action = (data) => { gridControl1.DataSource = data.Tables[0].DefaultView; gridView1.Columns[0].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; simpleButton导入.Enabled = true; }; Invoke(action, ds); conn.Close(); } } }
private void showDetailAll() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePicker1.Text.ToString(); if (comboBoxDept.SelectedValue.ToString() != "") { strsql = "select cno 临时工号,e.cname 姓名,sex 性别,register_date 报道日期,leave_date 离职日期,cfrom 输送渠道,from_type 输送类型id,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,dept 部门,id_number 身份证号,phone_no 手机号码,shift 班次,status 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where dept = '" + comboBoxDept.SelectedValue + "' and isnull(status,'在职')= case when '" + comboBoxStatus.Text + "' = '全部' then isnull(status,'在职') else '" + comboBoxStatus.Text + "' end"; } else if (comboBoxDept3.SelectedValue.ToString() != "") { strsql = "select cno 临时工号,e.cname 姓名,sex 性别,register_date 报道日期,leave_date 离职日期,cfrom 输送渠道,from_type 输送类型id,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,dept 部门,id_number 身份证号,phone_no 手机号码,shift 班次,status 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where dept3 = '" + comboBoxDept3.SelectedValue + "' and dept2 = '" + comboBoxDept2.SelectedValue + "' and dept1 = '" + comboBoxDept1.SelectedValue + "' and isnull(status,'在职')= case when '" + comboBoxStatus.Text + "' = '全部' then isnull(status,'在职') else '" + comboBoxStatus.Text + "' end"; } else if (comboBoxDept2.SelectedValue.ToString() != "") { strsql = "select cno 临时工号,e.cname 姓名,sex 性别,register_date 报道日期,leave_date 离职日期,cfrom 输送渠道,from_type 输送类型id,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,dept 部门,id_number 身份证号,phone_no 手机号码,shift 班次,status 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where dept2 = '" + comboBoxDept2.SelectedValue + "' and dept1 = '" + comboBoxDept1.SelectedValue + "' and isnull(status,'在职')= case when '" + comboBoxStatus.Text + "' = '全部' then isnull(status,'在职') else '" + comboBoxStatus.Text + "' end"; } else if (comboBoxDept1.SelectedValue.ToString() != "") { strsql = "select cno 临时工号,e.cname 姓名,sex 性别,register_date 报道日期,leave_date 离职日期,cfrom 输送渠道,from_type 输送类型id,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,dept 部门,id_number 身份证号,phone_no 手机号码,shift 班次,status 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where dept1 = '" + comboBoxDept1.SelectedValue + "' and isnull(status,'在职')= case when '" + comboBoxStatus.Text + "' = '全部' then isnull(status,'在职') else '" + comboBoxStatus.Text + "' end"; } else { strsql = "select cno 临时工号,e.cname 姓名,sex 性别,register_date 报道日期,leave_date 离职日期,cfrom 输送渠道,from_type 输送类型id,b.cname 输送类型,dept1 一级部门,dept2 二级部门,dept3 三级部门,dept 部门,id_number 身份证号,phone_no 手机号码,shift 班次,status 状态 from COST_TEMP_EMPLOYEE e left join cost_base_data b on e.from_type = b.sub_id and module_id = 1 where isnull(status,'在职')= case when '" + comboBoxStatus.Text + "' = '全部' then isnull(status,'在职') else '" + comboBoxStatus.Text + "' end"; } tods = conn.ReturnDataSet(strsql); gridControl1.DataSource = tods.Tables[0].DefaultView; gridView1.Columns[6].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; gridView1.Columns[11].OptionsColumn.ReadOnly = true; gridView1.Columns[12].OptionsColumn.ReadOnly = true; gridView1.Columns[13].OptionsColumn.ReadOnly = true; gridView1.Columns[14].OptionsColumn.ReadOnly = true; gridView1.Columns[15].OptionsColumn.ReadOnly = true; //表头设置 gridView1.ColumnPanelRowHeight = 35; gridView1.OptionsView.AllowHtmlDrawHeaders = true; gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; //表头及行内容居中显示 //gridView1.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; conn.Close(); isall = true; }
private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql, month, sqlsum; month = dateTimePicker1.Text.ToString(); strsql = "select SALE_TYPE_NAME 营业类型,CONVERT(varchar(100), CDATE, 23) 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,cast(round(DEPRECIATION, 2) as decimal(18, 2)) 折旧费,cast(round(OPERATION_TRANSFER, 2) as decimal(18, 2)) 运营部费用转嫁,cast(round(TRIAL_TRANSFER, 2) as decimal(18, 2)) 试产费用转嫁,cast(round(COMPOSITE_EXPENSE, 2) as decimal(18, 2)) 主营综合费用,cast(round(POINTCOUNT, 2) as decimal(18, 2)) 产出信道数,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单信道成本,STANDARD_POINT 标准单信道成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_DAY_CALCULATE where cdate like '" + month + "%' and sale_type_id =15 order by cdate"; DataSet ds = conn.ReturnDataSet(strsql); sqlsum = "select SALE_TYPE_NAME 营业类型,'汇总:' 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,cast(round(DEPRECIATION, 2) as decimal(18, 2)) 折旧费,cast(round(OPERATION_TRANSFER, 2) as decimal(18, 2)) 运营部费用转嫁,cast(round(TRIAL_TRANSFER, 2) as decimal(18, 2)) 试产费用转嫁,cast(round(COMPOSITE_EXPENSE, 2) as decimal(18, 2)) 主营综合费用,cast(round(POINTCOUNT, 2) as decimal(18, 2)) 产出信道数,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单信道成本,STANDARD_POINT 标准单信道成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_MONTH_CALCULATE where cmonth = '" + month + "' and sale_type_id =15"; DataSet ds2 = conn.ReturnDataSet(sqlsum); ds.Merge(ds2, true, MissingSchemaAction.AddWithKey); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; //gridView1.Columns[0].OptionsColumn.ReadOnly = true; //gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }
private void showDetail2() { 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 上班类型,i.hours 小时数 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 上班类型,i.hours 小时数 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 上班类型,i.hours 小时数 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; if (gridView1.GetDataRow(0) != null && gridView1.GetDataRow(0).ItemArray[9].ToString() != "0" && gridView1.GetDataRow(0).ItemArray[9].ToString() != "") { comboBoxWorkType.SelectedIndex = -1; comboBoxWorkType.SelectedValue = Convert.ToInt32(gridView1.GetDataRow(0).ItemArray[9].ToString()); } conn.Close(); }
private void showDetail() { ConnDB conn = new ConnDB(); string strsql; strsql = "select cdate 日期,hours HH产出工时 from COST_EMS_HH_HOURS where cdate like '" + dateTimePickerMonth.Text + "%'"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; //gridView1.Columns[0].Visible = false; gridView1.Columns[0].OptionsColumn.ReadOnly = true; gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }
private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePicker1.Text.ToString(); strsql = "select CID,CNAME 上班类型,'0' as '费率(元/小时)' from COST_WORK_TYPE where forbidden = 'false'"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }
private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql, yyyymm; yyyymm = dateTimePicker1.Text.ToString(); strsql = "select j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select * from cost_direct_labour_price where isnull(YYYYMM,'') ='" + yyyymm + "') i right join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE = j.cid "; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }
private void ShowDetail() { ConnDB conn = new ConnDB(); string strsql, month; month = dateTimePicker1.Text.ToString(); strsql = "select SALE_TYPE_NAME 营业类型,cmonth 日期,DIRECT_HOURS 直接人工小时数,cast(round(DIRECT_COST, 2) as decimal(18, 2)) 直接人工成本,INDIRECT_HOURS 间接人工小时数,cast(round(INDIRECT_COST, 2) as decimal(18, 2)) 间接人工成本,cast(round(DEPRECIATION, 2) as decimal(18, 2)) 折旧费,cast(round(RENT_EXPENSE, 2) as decimal(18, 2)) 租赁费,cast(round(WATER_ELECTRICITY, 2) as decimal(18, 2)) 水电费,cast(round(POINTCOUNT, 2) as decimal(18, 2)) 点数,cast(round(COST, 2) as decimal(18, 2)) 预估成本,COST_POINT 预估单点成本,STANDARD_POINT 标准单点成本,cast(round(STANDARD_COST, 2) as decimal(18, 2)) 标准成本,cast(round(PROFIT, 2) as decimal(18, 2)) 盈亏 from COST_MONTH_CALCULATE where cmonth = '" + month + "' and sale_type_id = 10"; DataSet ds = conn.ReturnDataSet(strsql); gridControl1.DataSource = ds.Tables[0].DefaultView; gridView1.Columns[0].Visible = false; //gridView1.Columns[0].OptionsColumn.ReadOnly = true; //gridView1.Columns[1].OptionsColumn.ReadOnly = true; conn.Close(); }