private void setCondition() { string datetime = ASPxDateEdit2.Date.ToShortDateString() + " 23:59:59"; string sql = "SELECT a.SN ,a.station_name ,a.create_time , b.user_name,a.pline_code ,a.item_code ,a.item_sn ,a.item_name ,a.item_vendor ," + " a.barcode FROM data_scan_item a left join code_user b on a.CREATE_USERID=b.USER_CODE "; if (txtSN.Text.Trim() != "") { string gzsql = "select a.plan_type from data_plan a left join data_plan_sn b on a.plan_code=b.plan_code where b.sn='" + txtSN.Text.Trim() + "' "; string type = dc.GetValue(gzsql); if (type != "C" || type != "D") { return; } sql = sql + " WHERE a.SN='" + txtSN.Text.Trim() + "' "; } else { sql = sql + "where a.CREATE_TIME>=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and a.CREATE_TIME<=to_date('" + datetime + "','yyyy-mm-dd hh24:mi:ss')"; } DataTable dt = dc.GetTable(sql); ASPxGridView1.DataSource = dt; ASPxGridView1.DataBind(); }
//查询计划 private void setCondition() { string beginDate = ASPxDateEdit1.Date.ToString("yyyy/MM/dd"); string endDate = ASPxDateEdit2.Date.ToString("yyyy/MM/dd"); string sql = "SELECT A.*,B.USER_CODE,'' FZQTY FROM DATA_PLAN A LEFT JOIN CODE_USER B ON A.CREATE_USERID = B.USER_ID" + " WHERE BEGIN_DATE >= TO_DATE('" + beginDate + "','YYYY/MM/DD HH24:MI:SS')" + " AND BEGIN_DATE <= TO_DATE('" + endDate + "','YYYY/MM/DD HH24:MI:SS')" + " AND A.PLINE_CODE IN (SELECT PLINE_CODE FROM VW_USER_ROLE_PROGRAM WHERE USER_ID = '" + theUserId + "' AND PROGRAM_CODE = '" + theProgramCode + "' AND COMPANY_CODE = '" + theCompanyCode + "')" + " AND A.CONFIRM_FLAG = 'Y' " + " ORDER BY A.BEGIN_DATE, A.PLAN_SEQ "; DataTable dt = dc.GetTable(sql); //不让敏感字出现 for (int i = 0; i < dt.Rows.Count; i++) { string remark1 = dt.Rows[i]["REMARK"].ToString(); string planCode1 = dt.Rows[i]["PLAN_CODE"].ToString(); sql = "select FUNC_GET_REMARK('" + planCode1 + "', '" + remark1 + "') from dual "; dc.setTheSql(sql); dt.Rows[i]["REMARK"] = dc.GetValue(); string FZqty = dc.GetValue("select FUNC_GET_FZQTY('" + planCode1 + "') from dual "); dt.Rows[i]["FZQTY"] = FZqty; } ASPxGridView1.DataSource = dt; ASPxGridView1.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); string sql11 = "select nvl(item_flag,'N') from data_plan where plan_code='" + Request["planCode"].ToString() + "' "; if (dc.GetValue(sql11) == "Y") { showAlert(this, "计划已库房确认,不能替换!"); return; } //先删除 BomReplaceFactory.MW_INSERT_SJBOMSOTHMUTI("DELETE", Request["so"].ToString(), "", "", userName, Request.UserHostAddress, Request["planCode"].ToString(), "", "", "", Request["plineCode"].ToString(), cmbGroup.Text, "", ""); //逐条新增 string sql = "select distinct a.oldpart ,b.pt_desc2 oldpart_name, a.newpart ,c.pt_desc2 newpart_name,a.sl from sjbomthset a" + " left outer join copy_pt_mstr b on a.oldpart=b.pt_part" + " left outer join copy_pt_mstr c on a.newpart=c.pt_part" + " left join DATA_PLAN_STANDARD_BOM d on a.oldpart = d.item_code and plan_code='" + Request["planCode"].ToString() + "' " + " where (so='" + Request["so"].ToString() + "' or so='" + thgxjx + "') and settype='1' and usetime<=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and endtime>=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and thgroup='" + cmbGroup.Text + "'"; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string locationcode1 = dc.GetValue("select location_code from (select location_code from DATA_PLAN_STANDARD_BOM where plan_code='" + Request["planCode"].ToString() + "' and item_code='" + dt.Rows[i]["oldpart"].ToString() + "' order by location_code) where rownum=1 "); BomReplaceFactory.MW_INSERT_SJBOMSOTHMUTI("ADD", Request["so"].ToString(), dt.Rows[i]["oldpart"].ToString(), dt.Rows[i]["newPart"].ToString(), userName, Request.UserHostAddress, Request["planCode"].ToString(), locationcode1, locationcode1, "", Request["plineCode"].ToString(), cmbGroup.Text, dt.Rows[i]["sl"].ToString(), ""); } initGrid2(); ////逐条新增 //string sql = "select a.oldpart ,b.pt_desc2 oldpart_name, a.newpart ,c.pt_desc2 newpart_name,a.sl,d.location_code from sjbomthset a" // + " left outer join copy_pt_mstr b on a.oldpart=b.pt_part" // + " left outer join copy_pt_mstr c on a.newpart=c.pt_part" // + " left join DATA_PLAN_STANDARD_BOM d on a.oldpart = d.item_code and plan_code='" + Request["planCode"].ToString() + "' " // + " where (so='" + Request["so"].ToString() + "' or so='" + thgxjx // + "') and settype='1' and usetime<=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and endtime>=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd') and thgroup='" + cmbGroup.Text + "'"; //DataTable dt = dc.GetTable(sql); //for (int i = 0; i < dt.Rows.Count; i++) //{ // BomReplaceFactory.MW_INSERT_SJBOMSOTHMUTI("ADD", Request["so"].ToString(), dt.Rows[i]["oldpart"].ToString(), // dt.Rows[i]["newPart"].ToString(), userName, Request.UserHostAddress, Request["planCode"].ToString(), // dt.Rows[i]["location_code"].ToString(), dt.Rows[i]["location_code"].ToString(), "", Request["plineCode"].ToString(), cmbGroup.Text, // dt.Rows[i]["sl"].ToString(), ""); //} }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string companyCode = theUserManager.getCompanyCode(); string urls = Request["Pic"].ToString(); string[] _urls = urls.Split('|'); string plinecode = "E"; if (_urls[_urls.Length - 1] != null) { if (_urls[_urls.Length - 1] != "") { plinecode = _urls[_urls.Length - 1]; } //plinecode = dc.GetValue("select pline_code from code_product_line where rmes_id='" + _urls[_urls.Length - 1] + "'"); } string sql = ""; string Iurl = ""; if (_urls[0] == "N") { sql = "select INTERNAL_VALUE FROM CODE_INTERNAL WHERE COMPANY_CODE='" + companyCode + "' AND INTERNAL_TYPE_CODE='PATH' AND INTERNAL_CODE='PROCESSNOTEPATH'"; Iurl = dc.GetValue(sql); for (int i = 1; i < _urls.Length - 1; i++) { string name = "ima" + i.ToString(); Image ima = new Image(); //ima.ImageUrl = "\\\\192.168.113.137\\mes共享\\FILES\\PROCESSNOTEPIC\\" + plinecode + "\\" + _urls[i].Split('\\')[_urls[i].Split('\\').Length - 1]; ima.ImageUrl = @Iurl + "\\" + plinecode + "\\" + _urls[i].Split('\\')[_urls[i].Split('\\').Length - 1]; ima.DataBind(); GraphPlaceHolder.Controls.Add(ima); } } else if (_urls[0] == "A") { sql = "select INTERNAL_VALUE FROM CODE_INTERNAL WHERE COMPANY_CODE='" + companyCode + "' AND INTERNAL_TYPE_CODE='PATH' AND INTERNAL_CODE='QUALITYALERTPATH'"; Iurl = dc.GetValue(sql); for (int i = 1; i < _urls.Length; i++) { string name = "ima" + i.ToString(); Image ima = new Image(); //ima.ImageUrl = "\\\\192.168.113.137\\mes共享\\FILES\\QUALITYALERTPIC\\" + plinecode + "\\" + _urls[i].Split('\\')[_urls[i].Split('\\').Length - 1]; ima.ImageUrl = @Iurl + "\\" + plinecode + "\\" + _urls[i].Split('\\')[_urls[i].Split('\\').Length - 1]; ima.DataBind(); GraphPlaceHolder.Controls.Add(ima); } } }
private void setCondition() { string sql = "select * from VW_DATA_PLAN where pline_code='" + ASPxComboBoxPline.Value.ToString() + "' and confirm_flag='Y' and item_flag='Y' and plan_qty>0 and run_flag<>'C' and run_flag<>'F' and begin_date>=to_date('" + ASPxDateEdit1.Date.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') and begin_date<=to_date('" + ASPxDateEdit2.Date.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') and pline_code in(select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "' ) order by begin_date,plan_seq "; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string remark1 = dt.Rows[i]["REMARK"].ToString(); sql = "select FUNC_GET_REMARK('" + dt.Rows[i]["PLAN_CODE"].ToString() + "','" + remark1 + "') from dual "; dc.setTheSql(sql); dt.Rows[i]["REMARK"] = dc.GetValue();; } ASPxGridView1.DataSource = dt; ASPxGridView1.DataBind(); }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strCode = e.Values["SO"].ToString(); string strTableName = "ATPUSOTJB"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //插入日志表 string logSql = "INSERT INTO ATPUSOTJLOG (SO,TJLX,YHMC,RQSJ,CZSM) " + "VALUES( '" + e.Values["SO"].ToString() + "','" + e.Values["TJLX"].ToString() + "','" + theUserName + "',sysdate,'DEL')"; dc.ExeSql(logSql); //确认删除 string Sql = "delete from ATPUSOTJB WHERE SO = '" + strCode + "'"; dc.ExeSql(Sql); } e.Cancel = true; setCondition(); }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strPART = e.Values["PART"].ToString(); string strPCode = e.Values["GZDD"].ToString(); string strTableName = "atpubkflpart"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strPART + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //确认删除 string Sql = "delete from atpubkflpart where part='" + strPART + "' and gzdd='" + strPCode + "' "; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
public Report_Exp2000_1(string pline_code, string dept_code, DateTime date) { InitializeComponent(); xrLabel3.Text = date.ToShortDateString(); string _b = date.ToShortDateString() + " 00:00:00"; string _e = date.ToShortDateString() + " 23:59:59"; dataConn theconn = new dataConn(); DataTable dt = new DataTable(); string dept_name = theconn.GetValue("select dept_name from code_dept where dept_code='" + dept_code + "'"); //DataTable plines = theconn.GetTable("select pline_code from REL_DEPT_PLINE where dept_code='" + dept_code + "'"); string sql = string.Format("select * from VW_DATA_COMPLETE_PER_DAY t left join (select count(instore_qty) as order_num,d.project_code from VW_DATA_COMPLETE_PER_DAY d where d.work_date between to_date('{0}','yyyy-mm-dd hh24:mi:ss') and to_date('{1}','yyyy-mm-dd hh24:mi:ss') and d.pline_code='{2}' group by d.project_code) a on a.project_code = t.project_code where t.work_date between to_date('{3}','yyyy-mm-dd hh24:mi:ss') and to_date('{4}','yyyy-mm-dd hh24:mi:ss') and t.pline_code='{5}'", _b, _e, pline_code, _b, _e, pline_code); dt.Merge(theconn.GetTable(sql)); dt.Columns.Add("DEPT"); int num = 0; for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["DEPT"] = dept_name; num += Convert.ToInt32(dt.Rows[i]["INSTORE_QTY"]); } //this.DataSource = dt; this.xrPivotGrid1.DataSource = dt; xrTableCell1.Text = "总计" + num + "台"; }
//新增 protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox pLine = ASPxGridView1.FindEditFormTemplateControl("comboPLine") as ASPxComboBox; ASPxComboBox zdmc = ASPxGridView1.FindEditFormTemplateControl("comboStationCode") as ASPxComboBox; //ASPxTextBox zddm = ASPxGridView1.FindEditFormTemplateControl("txtStationName") as ASPxTextBox; ASPxGridLookup gridlookup = ASPxGridView1.FindEditFormTemplateControl("comboLJDM") as ASPxGridLookup; ASPxComboBox part_ABC = ASPxGridView1.FindEditFormTemplateControl("comboLJLB") as ASPxComboBox; string zddm = dc.GetValue("select STATION_CODE from CODE_STATION where STATION_NAME='" + zdmc.Value.ToString() + "'"); string ljdm = gridlookup.Value.ToString(); string ljmc = gridlookup.Text.Trim(); string Sql = "INSERT INTO ATPUZDLJMLB (GZDD,ZDDM,ZDMC,LJDM,LJMC,INPUT_PERSON,INPUT_TIME,PART_ABC) " + "VALUES( '" + pLine.Value.ToString() + "','" + zddm + "','" + zdmc.Value.ToString() + "','" + ljdm + "','" + ljmc + "','" + theUserId + "',SYSDATE,'" + part_ABC.Value.ToString() + "')"; dc.ExeSql(Sql); //插入到日志表161103 try { string Sql2 = "INSERT INTO ATPUZDLJMLB_LOG (GZDD,ZDDM,ZDMC,LJDM,LJMC,user_code,flag,rqsj,PART_ABC)" + " SELECT GZDD,ZDDM,ZDMC,LJDM,LJMC,'" + theUserCode + "' , 'ADD', SYSDATE,PART_ABC FROM ATPUZDLJMLB WHERE GZDD = '" + pLine.Value.ToString() + "' and ZDMC = '" + zdmc.Value.ToString() + "' and LJDM = '" + ljdm + "'"; dc.ExeSql(Sql2); } catch { return; } e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strDelCode = e.Values["VENDOR_CODE"].ToString(); string strTableName = "CODE_VENDOR"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //删除操作 string Sql = "delete from CODE_VENDOR WHERE COMPANY_CODE = '" + theCompanyCode + "' and VENDOR_CODE = '" + strDelCode + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strD = e.Values["ABOM_COMP"].ToString(); string strTableName = "ATPUBOMKZB"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','MES','MES','MES','MES','" + strD + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //记录操作start string logSql = "insert into atpubomkzb_log(abom_comp,zdrq,rqbegin,rqend,rqsj,yhmc,czms) " + " select abom_comp,zdrq,rqbegin,rqend,sysdate,'" + theUserName + "','删除了该零件' " + " from atpubomkzb where abom_comp='" + strD + "'"; dc.ExeSql(logSql); //记录操作end //确认删除 string Sql = "delete from ATPUBOMKZB WHERE ABOM_COMP = '" + strD + "' "; dc.ExeSql(Sql); } e.Cancel = true; setCondition1(); }
protected void BtnUpdate1_Click(object sender, EventArgs e) { try { int count1 = ASPxGridView1.Selection.Count; if (count1 != 1) { showAlert(this, "请选择单条处理!"); return; } List <object> aa = ASPxGridView1.GetSelectedFieldValues("RMES_ID"); string sql = "select count(1) from data_process_note where rmes_id='" + aa[0] + "' and (note_type='C' or note_type='D' or note_type='E')"; if (dc.GetValue(sql) == "0") { showAlert(this, "待处理数据类型错误,只能选择so、组件相关装机提示!"); return; } dataConn theDataConn = new dataConn(); theDataConn.theComd.CommandType = CommandType.StoredProcedure; theDataConn.theComd.CommandText = "MW_UPDATE_ZJTS"; theDataConn.theComd.Parameters.Add("TYPE1", OracleDbType.Varchar2).Value = "ONE"; theDataConn.theComd.Parameters.Add("RMESID1", OracleDbType.Varchar2).Value = aa[0]; theDataConn.OpenConn(); theDataConn.theComd.ExecuteNonQuery(); theDataConn.CloseConn(); showAlert(this, "处理成功!"); } catch (Exception e1) { showAlert(this, e1.Message.ToString()); } }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strCode = e.Values["RMES_ID"].ToString(); string strSSeq = e.Values["STATION_SEQ"].ToString(); string strPCode = e.Values["PLINE_CODE"].ToString(); string strTableName = "CODE_STATION"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //确认删除 string Sql = "delete from CODE_STATION WHERE COMPANY_CODE = '" + theCompanyCode + "' and RMES_ID = '" + strCode + "' AND PLINE_CODE='" + strPCode + "' "; dc.ExeSql(Sql); string UpSql = "UPDATE CODE_STATION SET STATION_SEQ = STATION_SEQ-1 WHERE COMPANY_CODE = '" + theCompanyCode + "'and STATION_SEQ >= '" + strSSeq + "' AND PLINE_CODE='" + strPCode + "' "; dc.ExeSql(UpSql); } setCondition(); e.Cancel = true; }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strMCode = e.Values["MATERIAL_CODE"].ToString(); string strPCode = e.Values["GZDD"].ToString(); string strOLocation = e.Values["ONLINE_LOCATION"].ToString(); string strQadsite = e.Values["QADSITE"].ToString(); string strTableName = "ms_single_mat_inner"; string flag = e.Values["FLAG"].ToString(); dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strMCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); //弹框提示已经计算的不能删除 if (flag == "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Fail"); ASPxGridView1.JSProperties.Add("cpCallbackRet", "已经计算的不能删除!"); } else if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //确认删除 string Sql = "delete from ms_single_mat_inner where material_code='" + strMCode + "' and ONLINE_LOCATION='" + strOLocation + "' and flag='N' and gzdd='" + strPCode + "' and qadsite='" + strQadsite + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
protected void butConfirm_Click(object sender, EventArgs e) { int count = 0; string location, pline, station, loactionProC, itemProC; pline = comboPlineCode.Value.ToString(); station = comboStationCode.Value.ToString(); loactionProC = locationPro.Value.ToString(); if (comboItemPro.Value != null) { itemProC = comboItemPro.Value.ToString(); } else { itemProC = ""; } for (count = 0; count < listChosedLocation.Items.Count; count++) { location = listChosedLocation.Items[count].ToString(); string[] location1 = location.Split(';'); location = location1[0]; location = dc.GetValue("select rmes_id from code_location where location_code='" + location + "' "); //取RMES_ID的值 string sql_rmes_id = "SELECT SEQ_RMES_ID.NEXTVAL FROM DUAL "; dc.setTheSql(sql_rmes_id); string rmes_id = dc.GetTable().Rows[0][0].ToString(); //插入到日志表 try { string Sql2 = " INSERT INTO REL_STATION_LOCATION_LOG(rmes_id,company_code,pline_code,station_code,location_code,location_flag,location_flag1,user_code,flag,rqsj)" + " VALUES('" + rmes_id + "','" + theCompanyCode + "','" + pline + "','" + station + "','" + location + "','" + loactionProC + "','" + itemProC + "','" + theUserCode + "','ADD',SYSDATE)"; dc.ExeSql(Sql2); } catch { return; } string sql = "insert into rel_station_location(rmes_id,company_code,pline_code,station_code,location_code,LOCATION_FLAG,LOCATION_FLAG1)" + "values(SEQ_RMES_ID.NEXTVAL,'" + theCompanyCode + "','" + pline + "','" + station + "','" + location + "','" + loactionProC + "','" + itemProC + "')"; dc.ExeSql(sql); } Response.Write("<script type='text/javascript'>alert('新增站点工位关系成功!');window.opener.location.reload();location.href='epd3401.aspx';</script>");//window.opener.location.reload();window.close(); comboPlineCode.Text = ""; comboStationCode.Text = ""; locationPro.Text = ""; ASPxListBoxLocation.Items.Clear(); comboItemPro.Text = ""; }
private void setCondition() { if (txtPCode.Text.Trim() != "") { string pline_id = dc.GetValue("select rmes_id from code_product_line where pline_code='" + txtPCode.Value.ToString() + "'"); string sql = "select DISTINCT a.part ,a.czts ,a.gxdm ,b.LOCATION_CODE ,a.gzdd from rst_atpu_zjts a left join rel_location_process b on a.gxdm=b.process_code " + "where a.jhdm = '" + txtPlanCode.Text.Trim() + "' and a.jhso='" + txtSO.Text.Trim() + "' and a.gzdd='" + pline_id + "' ORDER BY A.PART "; DataTable dt = dc.GetTable(sql); ASPxGridView1.DataSource = dt; ASPxGridView1.DataBind(); } }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strDelCode = e.Values["XH"].ToString(); string ljlb = e.Values["ZYLJLB"].ToString(); string strTableName = ""; if (ljlb == "装配重要零件") { strTableName = "DMZYLJB"; } else { strTableName = "DMJCLJB"; } dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //插入到日志表 try { if (strTableName == "DMZYLJB") { string Sql2 = "INSERT INTO DMZYLJB_LOG (LJDM,LJMC,XH,GZDD,LJLB,user_code,flag,rqsj)" + " SELECT LJDM,LJMC,XH,GZDD,LJLB,'" + theUserCode + "' , 'DEL', SYSDATE FROM DMZYLJB WHERE XH = '" + strDelCode + "'"; dc.ExeSql(Sql2); } if (strTableName == "DMJCLJB") { string Sql2 = "INSERT INTO DMJCLJB_LOG (LJDM,LJMC,XH,GZDD,user_code,flag,rqsj)" + " SELECT LJDM,LJMC,XH,GZDD,LJLB,'" + theUserCode + "' , 'DEL', SYSDATE FROM DMJCLJB WHERE XH = '" + strDelCode + "'"; dc.ExeSql(Sql2); } } catch { return; } //确认删除 string Sql = "delete from " + strTableName + " WHERE XH = '" + strDelCode + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
//删除 protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strCode = e.Values["RMES_ID"].ToString(); string strTableName = "CODE_SN"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //确认删除 //插入到日志表20161101 try { string Sql1 = " SELECT * FROM CODE_SN WHERE rmes_id='" + strCode + "'"; dc.setTheSql(Sql1); string rmes_id = dc.GetTable().Rows[0]["RMES_ID"].ToString(); string company_code = dc.GetTable().Rows[0]["COMPANY_CODE"].ToString(); string pline_code = dc.GetTable().Rows[0]["PLINE_CODE"].ToString(); string INITIAL_VALUE = dc.GetTable().Rows[0]["INITIAL_VALUE"].ToString(); string CURRENT_VALUE = dc.GetTable().Rows[0]["CURRENT_VALUE"].ToString(); string MAX_VALUE = dc.GetTable().Rows[0]["MAX_VALUE"].ToString(); string INCREASE_FLAG = dc.GetTable().Rows[0]["INCREASE_FLAG"].ToString(); string ENABLE_FLAG = dc.GetTable().Rows[0]["ENABLE_FLAG"].ToString(); string WARNING_VALUE = dc.GetTable().Rows[0]["WARNING_VALUE"].ToString(); string VENDER_CODE = dc.GetTable().Rows[0]["VENDER_CODE"].ToString(); string Sql2 = "INSERT INTO CODE_SN_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,INITIAL_VALUE,CURRENT_VALUE,MAX_VALUE,INCREASE_FLAG,ENABLE_FLAG,WARNING_VALUE,VENDER_CODE,user_code,flag,rqsj)" + "VALUES('" + rmes_id + "','" + theCompanyCode + "','" + pline_code + "','" + INITIAL_VALUE + "','" + CURRENT_VALUE + "','" + MAX_VALUE + "','" + INCREASE_FLAG + "','" + ENABLE_FLAG + "','" + WARNING_VALUE + "','" + VENDER_CODE + "','" + theUserCode + "','DEL',SYSDATE)"; dc.ExeSql(Sql2); } catch { return; } string Sql = "delete from CODE_SN WHERE COMPANY_CODE = '" + theCompanyCode + "' and RMES_ID = '" + strCode + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strDelCode = e.Values["RMES_ID"].ToString(); string strTableName = "DATA_ROUNTING_REMARK"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //插入到日志表 try { string Sql1 = " SELECT * FROM DATA_ROUNTING_REMARK WHERE rmes_id='" + strDelCode + "'"; dc.setTheSql(Sql1); string rmes_id = dc.GetTable().Rows[0]["RMES_ID"].ToString(); string company_code = dc.GetTable().Rows[0]["COMPANY_CODE"].ToString(); string ROUNTING_REMARK = dc.GetTable().Rows[0]["ROUNTING_REMARK"].ToString(); string PLINE_CODE = dc.GetTable().Rows[0]["PLINE_CODE"].ToString(); string GS = dc.GetTable().Rows[0]["GS"].ToString(); string XL = dc.GetTable().Rows[0]["XL"].ToString(); string PL = dc.GetTable().Rows[0]["PL"].ToString(); string RL = dc.GetTable().Rows[0]["RL"].ToString(); string ISDK = dc.GetTable().Rows[0]["ISDK"].ToString(); string ISEGR = dc.GetTable().Rows[0]["ISEGR"].ToString(); string Sql2 = "INSERT INTO DATA_ROUNTING_REMARK_LOG (RMES_ID,COMPANY_CODE,rounting_remark,pline_code,gs,xl,pl,rl,isdk,isegr,user_code,flag,rqsj)" + "VALUES('" + strDelCode + "','" + theCompanyCode + "','" + ROUNTING_REMARK + "','" + PLINE_CODE + "','" + GS + "','" + XL + "','" + PL + "','" + RL + "','" + ISDK + "','" + ISEGR + "','" + theUserCode + "','DEL',SYSDATE)"; dc.ExeSql(Sql2); } catch { return; } //确认删除 string Sql = "delete from DATA_ROUNTING_REMARK WHERE RMES_ID = '" + strDelCode + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
protected void Page_Load(object sender, EventArgs e) { LabSO.Text = Request["so"].ToString(); LabPlanCode.Text = Request["planCode"].ToString(); LabOldPart.Text = Request["oldPart"].ToString(); LabNewPart.Text = Request["newPart"].ToString(); LabLocation.Text = Request["locationCode"].ToString(); LabPlineCode.Text = Request["plineCode"].ToString(); string itemQry = Request["itemQry"].ToString(); //统计当天计划里该零件总数 string sql = "select sum(item_qty) from VW_DATA_PLAN_STANDARD_BOM where ITEM_CODE='" + LabOldPart.Text + "' and begin_date=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd')"; dc.setTheSql(sql); string itemSumNum = dc.GetValue(); LabSumNum.Text = "0"; if (itemSumNum != "") { LabSumNum.Text = itemSumNum; } //统计当天已替换该零件数量 sql = "select sum(thsl) from sjbomsoth where jhdm in (select plan_code from data_plan where begin_date=to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd'))"; dc.setTheSql(sql); string itemNum = dc.GetValue(); LabNum.Text = "0"; if (itemNum != "") { LabNum.Text = itemNum; } LabRate.Text = "0"; if (LabSumNum.Text != "0") { LabRate.Text = Convert.ToString(Convert.ToDecimal(LabNum.Text) / Convert.ToDecimal(LabSumNum.Text)); } }
protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) { //判断是否有人在转换,如果是退出,提示随后再加 string sql = "select bomrunning,bomuser from atpusysstate1"; DataTable dt = dc.GetTable(sql); if (dt.Rows.Count > 0) { if (dt.Rows[0][0].ToString() == "1") { return; } } //加入转换用户 userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); sql = "update atpusysstate1 set bomuser='******',bomrunning=1"; //删除原来记录 sql = "DELETE FROM RST_QAD_MOVEPART"; dc.ExeSql(sql); string MachineName = Request.UserHostAddress; //批量生成 if (listPlan.Items.Count > 0) { for (int i = 0; i < listPlan.Items.Count; i++) { string str = listPlan.Items[i].Text; string[] strs = str.Split(';'); string planCode = strs[0].ToString(); string so = strs[1].ToString(); string qty = strs[2].ToString(); BomReplaceFactory.QAD_CREATE_MOVEPART_LQ2(cmbPline.Value.ToString(), so, planCode, qty); } } string qadsite = dc.GetValue("select FUNC_GET_PLANSITE( '" + cmbPline.Value.ToString() + "', 'D') from dual"); sql = "SELECT ABOM_COMP ,ABOM_WKCTR ,ABOM_KW ,SUM(ABOM_QTY) QTY1 from rst_qad_movepart WHERE gzdd='" + qadsite + "' GROUP BY ABOM_COMP,ABOM_WKCTR,ABOM_KW ORDER BY ABOM_COMP,ABOM_WKCTR"; //sql = "SELECT ABOM_COMP ,ABOM_WKCTR ,ABOM_KW ,SUM(ABOM_QTY) QTY1 from rst_qad_movepart WHERE abom_user='******' GROUP BY ABOM_COMP,ABOM_WKCTR,ABOM_KW ORDER BY ABOM_COMP,ABOM_WKCTR"; Session["mmsMaterialMoveLineside001"] = sql; ASPxGridView1.DataSource = dc.GetTable(sql); ASPxGridView1.DataBind(); }
public Report_Exp2100(DateTime time, string dept) { InitializeComponent(); dataConn theconn = new dataConn(); string _b = time.AddDays(-time.Day + 1).ToShortDateString() + " 00:00:00"; string _e = time.AddMonths(1).AddDays(-time.Day + 1).ToShortDateString() + " 00:00:00"; string dept_name = theconn.GetValue("select dept_name from code_dept where dept_code='" + dept + "'"); xrLabel2.Text = dept_name + time.Month + "月完工成品报表"; xrLabel3.Text = DateTime.Now.ToShortDateString(); string sql = string.Format("select t.*,a.period_qty from VW_DATA_DEPT_COMPLETE_1 t left join (select project_code,product_series,sum(temp_period_qty) as period_qty from VW_DATA_DEPT_COMPLETE_1 where work_date between to_date('{0}','yyyy-mm-dd hh24:mi:ss') and to_date('{1}','yyyy-mm-dd hh24:mi:ss') group by project_code,product_series) a on a.project_code=t.project_code and a.product_series=t.product_series where t.dept_code='{2}' and t.work_date between to_date('{3}','yyyy-mm-dd hh24:mi:ss') and to_date('{4}','yyyy-mm-dd hh24:mi:ss')", _b, _e, dept, _b, _e); this.xrPivotGrid1.DataSource = theconn.GetTable(sql); }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.VisibleIndex < 0) { return; } string plan_code = e.GetValue("JHDM").ToString(); string flag = dc.GetValue("select run_flag from data_plan where plan_code='" + plan_code + "'"); if (flag == "P") { e.Row.BackColor = Color.Red;//计划暂停的显示红色 } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); theProgramCode = "atpu2000"; setCondition(); initSO(); if (Request["opFlag"] == "getEditSeries") { string str1 = ""; string so = Request["SO"].ToString(); string sql = "select jx,config from copy_engine_property where SO='" + so.ToUpper() + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string config1 = dc.GetTable().Rows[0][1].ToString(); string jx1 = dc.GetTable().Rows[0][0].ToString(); if (jx1 == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } if (jx1.EndsWith("ZZ")) { jx1 = jx1.Substring(0, jx1.Length - 2); } str1 = jx1; sql = "select GET_CSKD('" + so + "') from dual"; dc.setTheSql(sql); string bz1 = dc.GetValue().ToString(); str1 = str1 + "," + bz1; this.Response.Write(str1); this.Response.End(); } }
protected void btnConfirm_Click(object sender, EventArgs e) { //全部确认 //string planCode = gridPlan.SelectedItem.GetValue("PLAN_CODE").ToString(); //string so = gridPlan.SelectedItem.GetValue("PLAN_SO").ToString(); string planCode = Plan_code; string so = Plan_so; string sql = "select IS_JHOFFLINE('" + planCode + "','" + so + "','" + plineCode + "') from dual"; if (dc.GetValue(sql) == "1") { Response.Write("<script>alert('计划已下线!');</script>"); return; } sql = "select nvl(item_flag,'N') from data_plan where plan_code='" + planCode + "' "; if (dc.GetValue(sql) == "Y") { Response.Write("<script>alert('计划已库房确认,不能替换!');</script>"); return; } sql = "select distinct thgroup from sjbomsothmuti where gzdd='" + plineCode + "' and jhdm='" + planCode + "' and so='" + so + "'"; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { //判断是否可以替换 if (isCanConfirm(dt.Rows[i][0].ToString(), planCode, so) && isCanConfirm2(dt.Rows[i][0].ToString(), planCode, so)) { BomReplaceFactory.MW_INSERT_SJBOMSOTHMUTI("CFM", so, "", "", userName, Request.UserHostAddress, planCode, "", "", "", plineCode, dt.Rows[i][0].ToString(), "", ""); Response.Write("<script>alert('处理成功!');</script>"); } else { //提交调度确认 Response.Write("<script>alert('计划已上线,将提交给调度确认!');</script>"); BomReplaceFactory.MW_MODIFY_SJBOMTHMUTICFM("ADD", planCode, so, dt.Rows[i][0].ToString(), userName, plineCode); Response.Write("<script>alert('已提交!');</script>"); } } }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strDelCode = e.Values["SO"].ToString(); string strTableName = "ATPUEPAINTPROCOLOR"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //插入到日志表 try { string Sql1 = " SELECT * FROM ATPUEPAINTPROCOLOR WHERE SO='" + strDelCode + "'"; dc.setTheSql(Sql1); string SITE = dc.GetTable().Rows[0]["SITE"].ToString(); string PROC = dc.GetTable().Rows[0]["PROC"].ToString(); string COLOR = dc.GetTable().Rows[0]["COLOR"].ToString(); string Sql2 = "INSERT INTO ATPUEPAINTPROCOLOR_LOG(SO,SITE,PROC,COLOR,USER_CODE,FLAG,RQSJ)" + "VALUES('" + strDelCode + "','" + SITE + "','" + PROC + "','" + COLOR + "','" + theUserCode + "','DEL',SYSDATE)"; dc.ExeSql(Sql2); } catch { return; } //确认删除 string Sql = "delete from ATPUEPAINTPROCOLOR WHERE SO = '" + strDelCode + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
protected void gridOnePlace_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); string QRYH = gridOnePlace.GetRowValues(e.VisibleIndex, "QRYH") as string; string flag = gridOnePlace.GetRowValues(e.VisibleIndex, "FLAG") as string; string JHDM = gridOnePlace.GetRowValues(e.VisibleIndex, "JHDM") as string; string SO = gridOnePlace.GetRowValues(e.VisibleIndex, "SO") as string; string LJDM1 = gridOnePlace.GetRowValues(e.VisibleIndex, "LJDM1") as string; string LJDM2 = gridOnePlace.GetRowValues(e.VisibleIndex, "LJDM2") as string; string GWDM = gridOnePlace.GetRowValues(e.VisibleIndex, "GWDM") as string; //删除 if (e.ButtonID == "Delete") { string sql = "delete from sjbomthcfm where jhdm='" + JHDM + "' and so='" + SO + "' and ljdm1='" + LJDM1 + "' and upper(gwdm)='" + GWDM + "'"; dc.ExeSql(sql); } //加入替换 if (e.ButtonID == "Replace") { string sql = "select is_zdgys('" + JHDM + "','" + SO + "','" + LJDM1 + "','" + cmbPline.Value.ToString() + "') from dual"; string isZdgys = dc.GetValue(sql); if (isZdgys == "1") { Response.Write("<script>alert('已经指定供应商,不能替换" + LJDM1 + "');</script>"); return; } BomReplaceFactory.PL_INSERT_SJBOMSOTH("ADD1", SO, LJDM1, LJDM2, "", "", "", userName, Request.UserHostAddress, JHDM, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), GWDM, "0", "", "0", cmbPline.Value.ToString()); } //确认 if (e.ButtonID == "Confirm") { string sql = "update sjbomthcfm set qrsj=sysdate,qryh='" + userName + "',flag='2' where jhdm='" + JHDM + "' and so='" + SO + "' and ljdm1='" + LJDM1 + "' and gwdm='" + GWDM + "'"; dc.ExeSql(sql); } setCondition(); }
object GetNotes(string id) { string sql = "SELECT REMARK FROM VW_DATA_PLAN WHERE RMES_ID='" + id + "'"; dataConn dc = new dataConn(sql); DataTable dt = dc.GetTable(); for (int i = 0; i < dt.Rows.Count; i++) { string remark1 = dt.Rows[i]["REMARK"].ToString(); sql = "select FUNC_GET_REMARK('" + remark1 + "') from dual "; dc.setTheSql(sql); dt.Rows[i]["REMARK"] = dc.GetValue(); ; } if (dt.Rows.Count > 0) { return dt.Rows[0]["REMARK"]; } return null; }
//删除 protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 string strJX = e.Values["JXREMARK"].ToString(); string strPD = e.Values["PANDUAN"].ToString(); string strTableName = "JWYF"; dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strJX + "') from dual"); theDataConn.OpenConn(); string theRet = theDataConn.GetValue(); if (theRet != "Y") { ASPxGridView2.JSProperties.Add("cpCallbackName", "Delete"); ASPxGridView2.JSProperties.Add("cpCallbackRet", theRet); theDataConn.CloseConn(); } else { //插入到日志表 try { string Sql2 = "INSERT INTO JWYF_LOG (JXREMARK,PANDUAN,user_code,flag,rqsj)" + " SELECT JXREMARK,PANDUAN,'" + theUserCode + "' , 'DEL', SYSDATE FROM JWYF WHERE PANDUAN = '" + strPD + "'"; dc.ExeSql(Sql2); } catch { return; } //确认删除 string Sql = "delete from JWYF WHERE JXREMARK = '" + strJX + "'and PANDUAN = '" + strPD + "'"; dc.ExeSql(Sql); } setCondition(); e.Cancel = true; }
//创建EDITFORM前 protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e) { //string Sql = " select distinct a.pline_code,b.pline_name as showtext from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "' "; //DataTable dt = dc.GetTable(Sql); //ASPxComboBox uPCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox; //uPCode.DataSource = dt; //uPCode.TextField = dt.Columns[1].ToString(); //uPCode.ValueField = dt.Columns[0].ToString(); string Sql2 = "", pline_id = ""; if (txtPCode.Text.Trim() != "") { pline_id = dc.GetValue("select rmes_id from code_product_line where pline_code='" + txtPCode.Value.ToString() + "'"); Sql2 = "select distinct LOCATION_CODE,LOCATION_CODE||' '||LOCATION_NAME from CODE_LOCATION where LOCATION_CODE not like 'OP%' and LOCATION_CODE not in (select location_code from ms_location_time where gzdd ='" + txtPCode.Value.ToString() + "')" + "and pline_code = '" + pline_id + "' order by LOCATION_CODE"; } else { Sql2 = "select distinct LOCATION_CODE,LOCATION_CODE||' '||LOCATION_NAME from CODE_LOCATION where LOCATION_CODE not like 'OP%' and LOCATION_CODE not in (select location_code from ms_location_time where gzdd in (select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "'))" + " and pline_code in (select pline_id from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') order by LOCATION_CODE"; } DataTable dt2 = dc.GetTable(Sql2); ASPxComboBox uLCode = ASPxGridView1.FindEditFormTemplateControl("txtLCode") as ASPxComboBox; uLCode.DataSource = dt2; uLCode.TextField = dt2.Columns[1].ToString(); uLCode.ValueField = dt2.Columns[0].ToString(); if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing) { ///主键不可以修改 (ASPxGridView1.FindEditFormTemplateControl("txtLCode") as ASPxComboBox).Enabled = false; //(ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled = false; } else { //uTcode.SelectedIndex = 0; } }