//protected void comboPline_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) //{ // string user = e.Parameter; // ASPxComboBox pline = sender as ASPxComboBox; // string sql = "SELECT PLINE_CODE,PLINE_NAME FROM CODE_PRODUCT_LINE WHERE COMPANY_CODE = '" + theCompanyCode + "' ORDER BY PLINE_CODE "; // DataTable dt = dc.GetTable(sql); // pline.DataSource = dt; // pline.ValueField = "PLINE_CODE"; // pline.TextField = "PLINE_NAME"; // pline.DataBind(); //} protected void butConfirm_Click(object sender, EventArgs e) { int count = 0; string pline, user, program; user = comboUser.SelectedItem.Value.ToString(); List <object> plines = GridLookupCode.GridView.GetSelectedFieldValues("PLINE_CODE"); for (count = 0; count < ASPxListBoxProgram.SelectedValues.Count; count++) { program = ASPxListBoxProgram.SelectedValues[count].ToString(); for (int i = 0; i < plines.Count; i++) { pline = plines[i].ToString(); string sql1 = "delete from REL_USER_PLINE_PROGRAM where company_code='" + theCompanyCode + "' and user_id='" + user + "' and program_code='" + program + "' and pline_code='" + pline + "'"; dc.ExeSql(sql1); string sql = "insert into REL_USER_PLINE_PROGRAM(company_code,user_id,program_code,pline_code)" + "values('" + theCompanyCode + "','" + user + "','" + program + "','" + pline + "')"; dc.ExeSql(sql); } } Response.Write("<script type='text/javascript'>alert('新增关系成功!');window.opener.location.reload();location.href='sam2001.aspx';</script>"); }
protected void gridMultiPlace_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); string THEGROUP = gridMultiPlace.GetRowValues(e.VisibleIndex, "THEGROUP") as string; string flag = gridMultiPlace.GetRowValues(e.VisibleIndex, "FLAG") as string; string JHDM = gridMultiPlace.GetRowValues(e.VisibleIndex, "JHDM") as string; string SO = gridMultiPlace.GetRowValues(e.VisibleIndex, "SO") as string; //删除 if (e.ButtonID == "Delete") { string sql = "delete from SJBOMTHMUTICFM_DEL where jhdm='" + JHDM + "' and so='" + SO + "' and THEGROUP='" + THEGROUP + "' "; dc.ExeSql(sql); } //确认 if (e.ButtonID == "Confirm") { string sql = "delete from SJBOMSOTHMUTI where jhdm='" + JHDM + "' and so='" + SO + "' and thgroup='" + THEGROUP + "' and gzdd='" + cmbPline.Value.ToString() + "'"; dc.ExeSql(sql); sql = "delete from SJBOMTHMUTICFM_DEL where jhdm='" + JHDM + "' and so='" + SO + "' and THEGROUP='" + THEGROUP + "' "; dc.ExeSql(sql); } setCondition(); }
//新增 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 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.Text.Trim() + "','" + 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_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { //ASPxLabel billId = ASPxGridView1.FindEditFormTemplateControl("LabBillId") as ASPxLabel; ASPxTextBox assetcode = ASPxGridView1.FindEditFormTemplateControl("txtAssetCode") as ASPxTextBox; ASPxTextBox srlno = ASPxGridView1.FindEditFormTemplateControl("txtSrlNo") as ASPxTextBox; ASPxGridLookup lkpVendor = ASPxGridView1.FindEditFormTemplateControl("GridLookupVendor") as ASPxGridLookup; ASPxGridLookup lkpManuf = ASPxGridView1.FindEditFormTemplateControl("GridLookupManuf") as ASPxGridLookup; ASPxGridLookup lkpDept = ASPxGridView1.FindEditFormTemplateControl("GridLookupDept") as ASPxGridLookup; ASPxDateEdit dtePurchDate = ASPxGridView1.FindEditFormTemplateControl("CalPCDate") as ASPxDateEdit; ASPxTextBox txtPurchCost = ASPxGridView1.FindEditFormTemplateControl("txtPrice") as ASPxTextBox; ASPxDateEdit wrtStartDate = ASPxGridView1.FindEditFormTemplateControl("CalWRTStartDate") as ASPxDateEdit; ASPxDateEdit wrtEndDate = ASPxGridView1.FindEditFormTemplateControl("CalWRTEndDate") as ASPxDateEdit; ASPxTextBox txtAssetColor = ASPxGridView1.FindEditFormTemplateControl("txtColor") as ASPxTextBox; ASPxTextBox txtBarCode = ASPxGridView1.FindEditFormTemplateControl("txtBarCode") as ASPxTextBox; ASPxGridLookup lkpRspPerson = ASPxGridView1.FindEditFormTemplateControl("lkpResponsePerson") as ASPxGridLookup; ASPxCheckBox chkActiveFlag = ASPxGridView1.FindEditFormTemplateControl("chkActiveFlag") as ASPxCheckBox; ASPxMemo assetRemark = ASPxGridView1.FindEditFormTemplateControl("txtRemark") as ASPxMemo; string deptCode = "", vendorCode = "", manufCode = "", rspPerson = ""; ASPxGridLookup gridLookupVendor = ASPxGridView1.FindEditFormTemplateControl("GridLookupVendor") as ASPxGridLookup; ASPxTextBox txtSVendor = ASPxGridView1.FindEditFormTemplateControl("txtSVendor") as ASPxTextBox; if (lkpDept.Value != null) { deptCode = lkpDept.Value.ToString(); } if (lkpManuf.Value != null) { manufCode = lkpManuf.Value.ToString(); } if (lkpVendor.Value != null) { vendorCode = lkpVendor.Value.ToString(); } if (lkpRspPerson.Value != null) { rspPerson = lkpRspPerson.Value.ToString(); } string activeflag = chkActiveFlag.Checked ? "Y":"N"; string upSql = "UPDATE data_asset_detail SET vendor_code='" + vendorCode + "',manufacturer_code='" + lkpManuf.Value + "'," + "response_dept_code='" + deptCode + "',purchase_date=to_date('" + dtePurchDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss'),purchase_cost=" + txtPurchCost.Text + "," + "warranty_start_date=to_date('" + wrtStartDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss'),warranty_end_date=to_date('" + wrtEndDate.Value.ToString() + "','yyyy-mm-dd hh24:mi:ss')," + "response_person_code='" + lkpRspPerson.Value.ToString() + "',asset_color='" + txtAssetColor.Text + "',asset_remark='" + assetRemark.Text + "',active_flag='" + activeflag + "' " + " WHERE COMPANY_CODE = '" + theCompanyCode + "' AND serial_number='" + srlno.Text + "'"; theDc.ExeSql(upSql); e.Cancel = true; ASPxGridView1.CancelEdit(); queryFunction(); }
protected void gridMultiPlace_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); string THEGROUP = gridMultiPlace.GetRowValues(e.VisibleIndex, "THEGROUP") as string; string flag = gridMultiPlace.GetRowValues(e.VisibleIndex, "FLAG") as string; string JHDM = gridMultiPlace.GetRowValues(e.VisibleIndex, "JHDM") as string; string SO = gridMultiPlace.GetRowValues(e.VisibleIndex, "SO") as string; //删除 if (e.ButtonID == "Delete") { string sql = "delete from SJBOMTHMUTICFM where jhdm='" + JHDM + "' and so='" + SO + "' and THEGROUP='" + THEGROUP + "' "; dc.ExeSql(sql); } //加入替换 if (e.ButtonID == "Replace") { BomReplaceFactory.MW_INSERT_SJBOMSOTHMUTI("KFCONFIRM", SO, "", "", userName, Request.UserHostAddress, JHDM, "", "", "", cmbPline.Value.ToString(), THEGROUP, "", ""); //BomReplaceFactory.PL_INSERT_SJBOMSOTH("ADD", 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 SJBOMTHMUTICFM set qrsj=sysdate,qryh='" + userName + "',flag='2' where jhdm='" + JHDM + "' and THEGROUP='" + THEGROUP + "' "; dc.ExeSql(sql); } setCondition(); }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxTextBox aCode = ASPxGridView1.FindEditFormTemplateControl("txtAlineCode") as ASPxTextBox; ASPxTextBox aName = ASPxGridView1.FindEditFormTemplateControl("txtAlineName") as ASPxTextBox; ASPxComboBox PlineId = ASPxGridView1.FindEditFormTemplateControl("ASPxComboBox1") as ASPxComboBox; string plineCode = ""; string plineName = ""; string chSql = "select pline_code,pline_name from code_product_line where rmes_id='" + PlineId.Value.ToString() + "'"; dataConn dc1 = new dataConn(chSql); DataTable dt1 = dc1.GetTable(); if (dt1.Rows.Count > 0) { plineCode = dt1.Rows[0]["pline_code"].ToString(); plineName = dt1.Rows[0]["pline_name"].ToString(); } string upSql = "UPDATE ATPU_ACROSSLINE SET ALINE_NAME='" + aName.Text.Trim() + "'," + "PLINE_ID='" + PlineId.Value.ToString() + "',PLINE_CODE='" + plineCode + "',PLINE_NAME='" + plineName + "'" + " WHERE COMPANY_CODE = '" + theCompanyCode + "' and ALINE_CODE='" + aCode.Text.Trim() + "'"; theDc.ExeSql(upSql); e.Cancel = true; ASPxGridView1.CancelEdit(); queryFunction(); }
protected void ASPxGridView1_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { //取消 if (e.ButtonID == "cancelSure") { string RunValue = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "ADD_TIME").ToString(); string gSite = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "GZDD").ToString().ToUpper(); string sSql = "update ms_discard_mt set handle_flag='3',take_time=sysdate,take_user='******' where add_time=to_date('" + RunValue + "','YYYY-MM-DD HH24:MI:SS') and gzdd='" + gSite + "' and handle_flag='N'"; dc.ExeSql(sSql); setCondition(); } //接收 if (e.ButtonID == "takeSure") { string RunValue = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "ADD_TIME").ToString(); string gSite = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "GZDD").ToString().ToUpper(); string sSql = "update ms_discard_mt set handle_flag='2',take_time=sysdate,take_user='******' where add_time=to_date('" + RunValue + "','YYYY-MM-DD HH24:MI:SS') and gzdd='" + gSite + "' and handle_flag='1'"; dc.ExeSql(sSql); setCondition(); } }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ////删除 string id = e.Keys["RMES_ID"].ToString(); //插入到日志表 try { string Sql2 = "INSERT INTO CODE_STATION_SUB_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,SUBSTATION_ID,SUBSTATION_CODE,SUBSTATION_NAME," + "CFSTATION_ID,ZPSTATION_ID,SUB_ZC,CHECK_FLAG,user_code,flag,rqsj)" + " SELECT RMES_ID,COMPANY_CODE,PLINE_CODE,SUBSTATION_ID,SUBSTATION_CODE,SUBSTATION_NAME," + "CFSTATION_ID,ZPSTATION_ID,SUB_ZC,CHECK_FLAG,'" + theUserCode + "' , 'DEL', SYSDATE FROM CODE_STATION_SUB WHERE rmes_id='" + id + "'"; dc.ExeSql(Sql2); } catch { return; } string sql = "delete from CODE_STATION_SUB where rmes_id='" + id + "'"; 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_del where jhdm='" + JHDM + "' and so='" + SO + "' and ljdm1='" + LJDM1 + "' and upper(gwdm)='" + GWDM + "'"; dc.ExeSql(sql); } //确认 if (e.ButtonID == "Confirm") { string sql = "delete FROM SJBOMSOTH WHERE JHDM='" + JHDM + "' and ljdm1='" + LJDM1 + "' and ljdm2='" + LJDM2 + "' and so='" + SO + "' AND GWMC='" + GWDM + "' AND GZDD='" + cmbPline.Value.ToString() + "' and ygmc='" + userName + "'"; dc.ExeSql(sql); sql = "delete from sjbomthcfm_del where jhdm='" + JHDM + "' and so='" + SO + "' and ljdm1='" + LJDM1 + "' and upper(gwdm)='" + GWDM + "'"; dc.ExeSql(sql); } setCondition(); }
protected void butConfirm_Click(object sender, EventArgs e) { project = comboProject.SelectedItem.Value.ToString(); //替换物料 int rows = dc.ExeSql("update DATA_XK_OLDBOM set ITEM_CODE='" + newBom + "', ITEM_NAME='" + newName + "' where ITEM_CODE = '" + oldBom + "' and ITEM_NAME='" + oldName + "' and PROJECT_CODE = '" + project + "'"); //写入事件日志 string IPaddress = GetIP(); KeyWorklogEntity log = new KeyWorklogEntity { CREATE_TIME = DateTime.Now, USER_ID = theUserID, USER_IP = IPaddress, WORK_TYPE = "物料替换", DELETE_FLAG = "N", CONTENT_LOG1 = "从物料代码:" + oldBom, CONTENT_LOG2 = "替换成:" + newBom, CONTENT_LOG3 = "合同号:" + project + ";替换规则ID:" + rmesID, AFFECT_ROWS = rows }; string rmesId = db.Insert(log).ToString(); Response.Write("<script type='text/javascript'>alert('项目物料替换成功!');window.opener.location.reload();window.close();</script>"); }
//新增 protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox uRGzdd = ASPxGridView1.FindEditFormTemplateControl("txtRGzdd") as ASPxComboBox; ASPxComboBox uRLocation = ASPxGridView1.FindEditFormTemplateControl("txtRLocation") as ASPxComboBox; ASPxComboBox uIGzdd = ASPxGridView1.FindEditFormTemplateControl("txtIGzdd") as ASPxComboBox; ASPxComboBox uILocation = ASPxGridView1.FindEditFormTemplateControl("txtILocation") as ASPxComboBox; string strRGzdd = uRGzdd.Value.ToString(); string strRLocation = uRLocation.Value.ToString(); string strIGzdd = uIGzdd.Value.ToString(); string strILocation = uILocation.Value.ToString(); strRGzdd = strRGzdd.Substring(0, 1); string Sql = "INSERT INTO MS_ISSUE_LOCATION (REAL_GZDD,REAL_LOCATION,ISSUE_GZDD,ISSUE_LOCATION,input_person,input_time)VALUES('" + strRGzdd + "','" + strRLocation + "','" + strIGzdd + "','" + strILocation + "','" + theUserId + "',sysdate)"; dc.ExeSql(Sql); //插入到日志表 try { string Sql2 = "INSERT INTO MS_ISSUE_LOCATION_LOG (REAL_GZDD,REAL_LOCATION,ISSUE_GZDD,ISSUE_LOCATION,user_code,flag,rqsj)" + " SELECT REAL_GZDD,REAL_LOCATION,ISSUE_GZDD,ISSUE_LOCATION,'" + theUserCode + "' , 'ADD', SYSDATE FROM MS_ISSUE_LOCATION WHERE real_gzdd='" + strRGzdd + "' and real_location='" + strRLocation + "' and issue_gzdd='" + strIGzdd + "' and issue_location='" + strILocation + "' "; dc.ExeSql(Sql2); } catch { } e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ////删除 string id = e.Keys["RMES_ID"].ToString(); //插入到日志表 try { string Sql2 = "INSERT INTO REL_STATION_DETECT_LOG (rmes_id,company_code,pline_code,station_code,product_series,detect_code,detect_name,detect_type,detect_standard," + "detect_max,detect_min,detect_unit,DETECT_SEQ,TEMP01,TEMP02,TEMP03,user_code,flag,rqsj)" + " SELECT rmes_id,company_code,pline_code,station_code,product_series,detect_code,detect_name,detect_type,detect_standard," + "detect_max,detect_min,detect_unit,DETECT_SEQ,TEMP01,TEMP02,TEMP03,'" + theUserCode + "' , 'DEL', SYSDATE FROM REL_STATION_DETECT WHERE rmes_id = '" + id + "' "; dc.ExeSql(Sql2); } catch { return; } string sql = "delete from REL_STATION_DETECT where rmes_id='" + id + "'"; dc.ExeSql(sql); setCondition(); e.Cancel = true; }
// 修改 protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxComboBox pUserID = ASPxGridView1.FindEditFormTemplateControl("drpUID") as ASPxComboBox; ASPxComboBox pTagCode = ASPxGridView1.FindEditFormTemplateControl("drpTagCode") as ASPxComboBox; ASPxCheckBox chkTagFlag = ASPxGridView1.FindEditFormTemplateControl("chkTagFlag") as ASPxCheckBox; //string tagCodeFather = theDC.GetTable("SELECT * FROM CODE_TAG WHERE TAG_CODE='" + pTagCode + "'").Rows[0]["TAG_CODE_FATHER"].ToString(); string tagFlag = ""; if (chkTagFlag.Checked == true) { tagFlag = "Y"; } else { tagFlag = "N"; } string upSql = "UPDATE REL_USER_TAG SET TAG_FLAG='" + tagFlag + "' WHERE COMPANY_CODE = '" + theCompanyCode + "' AND USER_ID='" + pUserID.Value.ToString().Trim() + "' AND TAG_CODE='" + pTagCode.Value.ToString().Trim() + "'"; theDC.ExeSql(upSql); e.Cancel = true; ASPxGridView1.CancelEdit(); queryFunction(); }
// 修改 protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxTextBox pCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxTextBox; ASPxTextBox pName = ASPxGridView1.FindEditFormTemplateControl("txtPName") as ASPxTextBox; ASPxTextBox pNameEn = ASPxGridView1.FindEditFormTemplateControl("txtPNameEn") as ASPxTextBox; ASPxTextBox pValue = ASPxGridView1.FindEditFormTemplateControl("txtPValue") as ASPxTextBox; ASPxCheckBox chRFlag = ASPxGridView1.FindEditFormTemplateControl("chRFlag") as ASPxCheckBox; string rFlag = ""; if (chRFlag.Checked == true) { rFlag = "Y"; } else { rFlag = "N"; } string upSql = "UPDATE CODE_PROGRAM SET PROGRAM_NAME='" + pName.Text.Trim() + "',PROGRAM_NAME_EN='" + pNameEn.Text.Trim() + "',PROGRAM_VALUE='" + pValue.Text.Trim() + "'," + "RIGHT_FLAG='" + rFlag + "' WHERE COMPANY_CODE = '" + theCompanyCode + "' AND PROGRAM_CODE='" + pCode.Text.Trim() + "'"; theDc.ExeSql(upSql); e.Cancel = true; ASPxGridView1.CancelEdit(); queryFunction(); }
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 ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxTextBox uSO = ASPxGridView2.FindEditFormTemplateControl("TextSO") as ASPxTextBox; string strSO = uSO.Text.Trim(); string Sql = "INSERT INTO NONPPIF_ATPU (SO,input_person,input_time)VALUES( '" + strSO + "','" + theUserId + "',sysdate) "; dc.ExeSql(Sql); //插入到日志表 try { string Sql2 = "INSERT INTO NONPPIF_ATPU_LOG (SO,user_code,flag,rqsj)" + " SELECT SO,'" + theUserCode + "' , 'ADD', SYSDATE FROM NONPPIF_ATPU WHERE SO = '" + strSO + "' "; dc.ExeSql(Sql2); } catch { return; } e.Cancel = true; ASPxGridView2.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox uPCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox; ASPxTextBox uMCode = ASPxGridView1.FindEditFormTemplateControl("txtMCode") as ASPxTextBox; ASPxTextBox uMName = ASPxGridView1.FindEditFormTemplateControl("txtMName") as ASPxTextBox; ASPxTextBox uGCode = ASPxGridView1.FindEditFormTemplateControl("txtGCode") as ASPxTextBox; ASPxTextBox uGName = ASPxGridView1.FindEditFormTemplateControl("txtGName") as ASPxTextBox; ASPxComboBox uLocation = ASPxGridView1.FindEditFormTemplateControl("txtLocation") as ASPxComboBox; ASPxComboBox uQSite = ASPxGridView1.FindEditFormTemplateControl("txtQSite") as ASPxComboBox; ASPxTextBox uMNum = ASPxGridView1.FindEditFormTemplateControl("txtMNum") as ASPxTextBox; ASPxDateEdit uOnTime = ASPxGridView1.FindEditFormTemplateControl("txtOnTime") as ASPxDateEdit; string strPCode = uPCode.Value.ToString(); string strQSite = uQSite.Value.ToString(); string strMCode = uMCode.Text.Trim(); string strMName = uMName.Text.Trim(); string strGName = uGName.Text.Trim(); string strGCode = uGCode.Text.Trim(); string strMNum = uMNum.Text.Trim(); string locationCode = uLocation.Text.Trim(); string Sql = "insert into ms_single_mat_inner(material_code,material_num,online_time,online_location,add_time,flag,gzdd,gys_code,qadsite)" + "VALUES('" + strMCode + "','" + strMNum + "',to_date('" + uOnTime.Value + "','yyyy-mm-dd hh24:mi:ss'),'" + locationCode + "'," + "sysdate ,'N','" + strPCode + "','" + strGCode + "','" + strQSite + "')"; dc.ExeSql(Sql); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
//protected void ASPxGridView2_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) //{ // setCondition(); //} protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string id = e.Keys["RMES_ID"].ToString(); //插入到日志表 try { string Sql1 = " SELECT * FROM rel_station_location WHERE rmes_id='" + id + "'"; 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 location_code = dc.GetTable().Rows[0]["LOCATION_CODE"].ToString(); string station_code = dc.GetTable().Rows[0]["STATION_CODE"].ToString(); string location_flag = dc.GetTable().Rows[0]["LOCATION_FLAG"].ToString(); string location_flag1 = dc.GetTable().Rows[0]["LOCATION_FLAG1"].ToString(); string Sql2 = " INSERT INTO REL_STATION_LOCATION_LOG(rmes_id,company_code,pline_code,location_code,station_code,location_flag,location_flag1,user_code,flag,rqsj)" + " VALUES( '" + rmes_id + "', '" + company_code + "','" + pline_code + "','" + location_code + "','" + station_code + "','" + location_flag + "','" + location_flag1 + "','" + theUserCode + "','DEL',SYSDATE)"; dc.ExeSql(Sql2); } catch { return; } ////删除 string sql = "delete from rel_station_location where rmes_id='" + id + "'"; dc.ExeSql(sql); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string rmes_id = e.Values["RMES_ID"].ToString(); DetectDataEntity detEntity = new DetectDataEntity { RMES_ID = rmes_id }; //插入到日志表20161101 try { string Sql2 = "INSERT INTO CODE_DETECT_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,PRODUCT_SERIES,DETECT_CODE,DETECT_NAME,DETECT_TYPE,DETECT_STANDARD,DETECT_MAX,DETECT_MIN,DETECT_UNIT,ASSOCIATION_TYPE,TEMP01,TEMP02,user_code,flag,rqsj)" + " SELECT RMES_ID,COMPANY_CODE,PLINE_CODE,PRODUCT_SERIES,DETECT_CODE,DETECT_NAME,DETECT_TYPE,DETECT_STANDARD,DETECT_MAX,DETECT_MIN,DETECT_UNIT,ASSOCIATION_TYPE,TEMP01,TEMP02,'" + theUserCode + "' , 'DEL', SYSDATE FROM CODE_DETECT WHERE RMES_ID = '" + rmes_id + "' "; dc.ExeSql(Sql2); } catch { return; } dc.ExeSql("update CODE_DETECT set temp01='N' where RMES_ID = '" + rmes_id + "' "); //db.Delete(detEntity); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { if (txtPCode.Text.Trim() == "") { return; } else { ASPxTextBox uPSo = ASPxGridView1.FindEditFormTemplateControl("txtPSo") as ASPxTextBox; //ASPxComboBox uPCode = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox; ASPxTextBox uPNum = ASPxGridView1.FindEditFormTemplateControl("txtPNum") as ASPxTextBox; ASPxComboBox uPlanCode = ASPxGridView1.FindEditFormTemplateControl("txtPlanCode") as ASPxComboBox; ASPxComboBox uOnLocation = ASPxGridView1.FindEditFormTemplateControl("txtOnLocation") as ASPxComboBox; ASPxDateEdit uOnlinetime = ASPxGridView1.FindEditFormTemplateControl("DateOnlinetime") as ASPxDateEdit; string strPSo = uPSo.Text.Trim(); string strPCode = txtPCode.Value.ToString(); string strPNum = uPNum.Text.Trim(); string strPlanCode = uPlanCode.Value.ToString(); string strOnLocation = uOnLocation.Value.ToString(); string strOnlinetime = uOnlinetime.Text.Trim(); string Sql = "INSERT INTO MS_SINGLE_PLAN(PLAN_CODE,PLAN_SO,PLAN_NUM,ONLINE_LOCATION,ONLINE_TIME,FLAG,ADD_TIME,GZDD)" + "VALUES('" + strPlanCode + "','" + strPSo + "','" + strPNum + "','" + strOnLocation + "',to_date('" + uOnlinetime.Value + "','yyyy-mm-dd hh24:mi:ss'),'N',sysdate,'" + strPCode + "')"; dc.ExeSql(Sql); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); string hostIPAddress = Page.Request.UserHostAddress; //IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(hostIPAddress); GV_MachineName = hostIPAddress; //GV_MachineName = System.Net.Dns.GetHostName(); theProgramCode = "epd3700"; theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); string sql = "select a.pline_code,b.rmes_id,b.pline_name from VW_USER_ROLE_PROGRAM a " + "left join code_product_line b on a.pline_code=b.pline_code " + "where a.COMPANY_CODE = '" + theCompanyCode + "' and a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' order by b.PLINE_NAME"; comboPlineCode.DataSource = dc.GetTable(sql); comboPlineCode.DataBind(); setCondition(); if (!IsPostBack) { string sqlD = "DELETE from REL_STATION_PRESTATION_TEMP"; dc.ExeSql(sqlD); } }
//新增 protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox ljdm = ASPxGridView1.FindEditFormTemplateControl("comboLJDM") as ASPxComboBox; ASPxDateEdit begindate1 = ASPxGridView1.FindEditFormTemplateControl("dateStart") as ASPxDateEdit; ASPxDateEdit enddate1 = ASPxGridView1.FindEditFormTemplateControl("dateEnd") as ASPxDateEdit; string ljmc = ""; string sqlC = "select PT_DESC2 from COPY_PT_MSTR where pt_part='" + ljdm.Value.ToString() + "'"; DataTable dt = dc.GetTable(sqlC); if (dt.Rows.Count > 0) { ljmc = dt.Rows[0]["PT_DESC2"].ToString(); } string Sql = "INSERT INTO ATPUBOMKZB (ABOM_COMP,ZDRQ,RQBEGIN,RQEND,LJMC) " + " VALUES ( '" + ljdm.Value.ToString() + "',sysdate,to_date('" + begindate1.Text.Trim() + "','yyyy-MM-dd'),to_date('" + enddate1.Text.Trim() + "','yyyy-MM-dd'),'" + ljmc + "')"; dc.ExeSql(Sql); //记录操作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='" + ljdm.Value.ToString() + "'"; dc.ExeSql(logSql); //记录操作end e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition1(); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string rmesId = e.Keys["RMES_ID"].ToString(); //插入到日志表 try { string Sql2 = "INSERT INTO data_QUALITY_ALERT_LOG (rmes_id,company_code,pline_code,rounting_remark,plan_so,process_code," + "quality_alert,quality_alert_color,quality_alert_font,alert_type,component_code,from_date,to_date,alert_pic,user_code,flag,rqsj)" + " SELECT rmes_id,company_code,pline_code,rounting_remark,plan_so,process_code," + "quality_alert,quality_alert_color,quality_alert_font,alert_type,component_code,from_date,to_date,alert_pic,'" + theUserCode + "' , 'DEL', SYSDATE" + " FROM data_QUALITY_ALERT WHERE RMES_ID = '" + rmesId + "'"; dc.ExeSql(Sql2); } catch { return; } string sql = "delete from data_QUALITY_ALERT where rmes_id='" + rmesId + "'"; dc.ExeSql(sql); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //判断当前记录是否可以删除 //string strDelCode = e.Values["PLAN_CODE"].ToString(); string rmes_id = e.Values["RMES_ID"].ToString(); FaultEntity fauEntity = new FaultEntity { RMES_ID = rmes_id }; //插入到日志表20161101 try { string Sql2 = "INSERT INTO CODE_FAULT_LOG (RMES_ID,COMPANY_CODE,FAULT_CODE,FAULT_NAME,FAULT_DESC,FAULT_CLASS,FAULT_TYPE,user_code,flag,rqsj)" + " SELECT RMES_ID,COMPANY_CODE,FAULT_CODE,FAULT_NAME,FAULT_DESC,FAULT_CLASS,FAULT_TYPE,'" + theUserCode + "' , 'DEL', SYSDATE FROM CODE_FAULT WHERE RMES_ID = '" + rmes_id + "'"; dc.ExeSql(Sql2); } catch { return; } db.Delete(fauEntity); setCondition(); e.Cancel = true; }
//修改 protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxTextBox uPmCode = ASPxGridView1.FindEditFormTemplateControl("TextPmCode") as ASPxTextBox; ASPxTextBox uPmValue = ASPxGridView1.FindEditFormTemplateControl("TextPmValue") as ASPxTextBox; ASPxTextBox uPmDesc = ASPxGridView1.FindEditFormTemplateControl("TextPmDesc") as ASPxTextBox; ASPxTextBox uPmTemp02 = ASPxGridView1.FindEditFormTemplateControl("TextPmTemp02") as ASPxTextBox; ASPxTextBox uGzdd = ASPxGridView1.FindEditFormTemplateControl("TextGzdd") as ASPxTextBox; ASPxDateEdit dPmValue = ASPxGridView1.FindEditFormTemplateControl("DatePmValue") as ASPxDateEdit; string strPmCode = uPmCode.Text.Trim(); string strPmValue = uPmValue.Text.Trim(); string strPmDesc = uPmDesc.Text.Trim(); string strPmTemp02 = uPmTemp02.Text.Trim(); string strGzdd = uGzdd.Text.Trim(); //插入到日志表 try { string Sql2 = "INSERT INTO MS_JIT_PARAMETER_LOG (PARAMETER_CODE,PARAMETER_VALUE,PARAMETER_DESC,TEMP01,TEMP02,GZDD,user_code,flag,rqsj)" + " SELECT PARAMETER_CODE,PARAMETER_VALUE,PARAMETER_DESC,TEMP01,TEMP02,GZDD,'" + theUserCode + "' , 'BEFOREEDIT', SYSDATE FROM MS_JIT_PARAMETER WHERE PARAMETER_CODE = '" + strPmCode + "' and GZDD = '" + strGzdd + "'"; dc.ExeSql(Sql2); } catch { return; } if (strPmCode == "$INNER_INIT_CALCULATE_TIME" || strPmCode == "$THIRD_INIT_CALCULATE_TIME" || strPmCode == "$THIRD_INIT_PLANDATE" || strPmCode == "$INNER_INIT_PLANDATE") { //TextPmDesc.Visible = false; string Sql = "UPDATE MS_JIT_PARAMETER SET PARAMETER_DESC='" + strPmDesc + "',parameter_value='" + dPmValue.Text + "',temp02='" + strPmTemp02 + "' " + " WHERE PARAMETER_CODE = '" + strPmCode + "' and GZDD = '" + strGzdd + "'"; dc.ExeSql(Sql); } else { string Sql = "UPDATE MS_JIT_PARAMETER SET PARAMETER_DESC='" + strPmDesc + "',parameter_value='" + strPmValue + "',temp02='" + strPmTemp02 + "',input_person='" + theUserId + "',input_time=sysdate " + " WHERE PARAMETER_CODE = '" + strPmCode + "' and GZDD = '" + strGzdd + "'"; dc.ExeSql(Sql); } //插入到日志表 try { string Sql2 = "INSERT INTO MS_JIT_PARAMETER_LOG (PARAMETER_CODE,PARAMETER_VALUE,PARAMETER_DESC,TEMP01,TEMP02,GZDD,user_code,flag,rqsj)" + " SELECT PARAMETER_CODE,PARAMETER_VALUE,PARAMETER_DESC,TEMP01,TEMP02,GZDD,'" + theUserCode + "' , 'AFTEREDIT', SYSDATE FROM MS_JIT_PARAMETER WHERE PARAMETER_CODE = '" + strPmCode + "' and GZDD = '" + strGzdd + "'"; dc.ExeSql(Sql2); } catch { return; } e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) { string FUNC1 = "", BC1, ZD1, GZDD1 = "", MACHINENAME1; if (txtChose.Text.Trim() != "") { FUNC1 = txtChose.Value.ToString(); } BC1 = txtBc.Text.Trim(); ZD1 = txtSCode.Text.Trim(); if (txtPCode.Text.Trim() != "") { GZDD1 = txtPCode.Value.ToString(); } MACHINENAME1 = MachineName; string sql = "DELETE FROM RSTZZPQD WHERE MACHINENAME='" + MachineName + "'"; dc.ExeSql(sql); string InSql = "INSERT INTO RSTZZPQD (GHTM,SO,RQSJ,GZRQ,ZDMC,GGXHMC,YGMC,BCMC,BZMC,MACHINENAME,JHDM) " + " SELECT a.SN,a.PLAN_SO,a.START_TIME,a.WORK_DATE,c.STATION_NAME,a.PRODUCT_MODEL,b.user_name,d.shift_name,e.team_name,'" + MachineName + "',a.PLAN_CODE " + " FROM DATA_COMPLETE a left join code_user b on a.user_id=b.user_code left join code_station c on c.station_code=a.station_code left join code_shift d on a.shift_code=d.shift_code left join code_team e on e.team_code=a.team_code WHERE 1=1 "; if (FUNC1 == "BC") { if (BC1 == "全部" || BC1 == "") { InSql = InSql + " and WORK_DATE=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') "; } else { InSql = InSql + " and WORK_DATE=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and d.shift_name='" + BC1 + "'"; } if (ZD1 == "全部" || ZD1 == "") { InSql = InSql + " and a.pline_code='" + GZDD1 + "' "; } else { InSql = InSql + " and a.pline_code='" + GZDD1 + "' and c.STATION_NAME='" + ZD1 + "' "; } } else { InSql = InSql + " and WORK_DATE>=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and WORK_DATE<=to_date('" + ASPxDateEdit2.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') "; if (ZD1 == "全部" || ZD1 == "") { InSql = InSql + " and a.pline_code='" + GZDD1 + "' "; } else { InSql = InSql + " and a.pline_code='" + GZDD1 + "' and c.STATION_NAME='" + ZD1 + "' "; } } dc.ExeSql(InSql); setCondition(); ASPxGridView1.Selection.UnselectAll(); }
protected void btnDelete_Click(object sender, EventArgs e) { //ASPxGridView atl1 = (ASPxGridView)sender; List <object> rowid = grid.GetSelectedFieldValues("ROWID"); //List<object> planCode = grid.GetSelectedFieldValues("JHDM"); //List<object> oldPart = grid.GetSelectedFieldValues("LJDM1"); //List<object> newPart = grid.GetSelectedFieldValues("LJDM2"); //List<object> SO = grid.GetSelectedFieldValues("SO"); //List<object> locationCode = grid.GetSelectedFieldValues("GWMC"); //List<object> isTrue = grid.GetSelectedFieldValues("ISTRUE"); userManager theUserManager = (userManager)Session["theUserManager"]; string userName = theUserManager.getUserName(); string companyCode = theUserManager.getCompanyCode(); for (int i = 0; i < rowid.Count; i++) { string planCode = dc.GetValue("select jhdm from sjbomsoth where rowid='" + rowid[i].ToString() + "'"); string SO = dc.GetValue("select SO from sjbomsoth where rowid='" + rowid[i].ToString() + "'");; string oldPart = dc.GetValue("select LJDM1 from sjbomsoth where rowid='" + rowid[i].ToString() + "'");; string newPart = dc.GetValue("select LJDM2 from sjbomsoth where rowid='" + rowid[i].ToString() + "'");; string locationCode = dc.GetValue("select GWMC from sjbomsoth where rowid='" + rowid[i].ToString() + "'"); string sql = "select IS_JHOFFLINE('" + planCode.ToString() + "','" + SO.ToString() + "','" + plineCode.ToString() + "') from dual"; if (dc.GetValue(sql) == "1") { Response.Write("<script>alert('计划已经全部下线,不能删除');</script>"); continue; } sql = "select IS_JHONLINE('" + planCode.ToString() + "','" + SO.ToString() + "','" + plineCode + "') from dual"; //yxh 修改 增加未确认的直接删除逻辑 { } //如果已经确认,删除将提交确认流程 xuying 2016.9.9 //if (isTrue[i].ToString() == "1") { if (dc.GetValue(sql) == "1") { Response.Write("<script>alert('计划已上线,进入审批流程');</script>"); BomReplaceFactory.MW_MODIFY_SJBOMTHCFM_DEL("ADD", planCode.ToString(), SO.ToString(), oldPart.ToString(), newPart.ToString(), userName, locationCode.ToString(), plineCode); } else { sql = "delete FROM SJBOMSOTH WHERE JHDM='" + planCode.ToString() + "' and ljdm1='" + oldPart.ToString() + "' and ljdm2='" + newPart.ToString() + "' and so='" + SO.ToString() + "' AND GWMC='" + locationCode.ToString() + "' AND GZDD='" + plineCode + "' and ygmc='" + userName + "'"; dc.ExeSql(sql); } } setCondition(""); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string id = e.Values["RMES_ID"].ToString(); string sql = "delete from REL_DEPT_PLINE WHERE RMES_ID=" + id; dc.ExeSql(sql); setCondition(); e.Cancel = true; }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //删除 string delSql = "DELETE FROM REL_TEAM_USER WHERE COMPANY_CODE='" + theCompanyCode + "' AND PLINE_CODE='" + thePlCode + "' AND USER_ID='" + e.Keys["USER_ID"].ToString() + "'"; theDc.ExeSql(delSql); queryFunction(); e.Cancel = true; }
protected void btnAdd_Click(object sender, EventArgs e) { if (txtIteam.Text.Trim() == "") { return; } string sql = "insert into PART_FZLX(part)values('" + txtIteam.Text.Trim() + "') "; dc.ExeSql(sql); ASPxListBoxUnused_Init(); }