protected void Page_Load(object sender, EventArgs e) { //数据库读取装机提示图片路径 userManager theUserManager = (userManager)Session["theUserManager"]; string companyCode = theUserManager.getCompanyCode(); theUserCode = theUserManager.getUserCode(); theUserId = theUserManager.getUserId(); if (!IsPostBack) { string sql = "select INTERNAL_VALUE FROM CODE_INTERNAL WHERE COMPANY_CODE='" + companyCode + "' AND INTERNAL_TYPE_CODE='PATH' AND INTERNAL_CODE='QUALITYALERTPATH'"; Session["path"] = dc.GetValue(sql); //编辑,带出值 if (Request["opFlag"].ToString() == "edit") { string rmesId = Request["rmesId"].ToString(); sql = "select * from DATA_QUALITY_ALERT where rmes_id='" + rmesId + "'"; DataTable dt = dc.GetTable(sql); cmbPlineType.Value = dt.Rows[0]["pline_code"].ToString(); cmbRoutingRemark.Value = dt.Rows[0]["rounting_remark"].ToString(); cmbSO.Value = dt.Rows[0]["plan_so"].ToString(); cmbComponet.Value = dt.Rows[0]["component_code"].ToString(); cmbProcessCode.Value = dt.Rows[0]["process_code"].ToString(); if (dt.Rows[0]["from_date"].ToString() != "") { DateFrom.Date = Convert.ToDateTime(dt.Rows[0]["from_date"].ToString()); } if (dt.Rows[0]["to_date"].ToString() != "") { DateTo.Date = Convert.ToDateTime(dt.Rows[0]["to_date"].ToString()); } txtQualityAlert.Text = dt.Rows[0]["quality_alert"].ToString(); cmbColor.Text = dt.Rows[0]["quality_alert_color"].ToString(); cmbFont.Value = dt.Rows[0]["quality_alert_font"].ToString(); cmbType.Value = dt.Rows[0]["alert_type"].ToString(); if (dt.Rows[0]["quality_alert_color"].ToString() != "") { txtQualityAlert.ForeColor = Color.FromName(dt.Rows[0]["quality_alert_color"].ToString()); } if (dt.Rows[0]["quality_alert_font"].ToString() != "") { txtQualityAlert.Font.Size = FontUnit.Point(Convert.ToInt32(dt.Rows[0]["quality_alert_font"].ToString())); } string pics = dt.Rows[0]["alert_pic"].ToString(); PubCs pc = new PubCs(); la = pc.SplitBySeparator(pics, "$"); for (int i = 0; i < la.Count; i++) { if (la[i].ToString() != "") { ListFiles.Items.Add(la[i].ToString()); } } cmbType.ClientEnabled = false; cmbPlineType.ClientEnabled = false; cmbRoutingRemark.ClientEnabled = false; cmbSO.ClientEnabled = false; cmbComponet.ClientEnabled = false; cmbProcessCode.ClientEnabled = false; btnConfirm.Visible = false; } if (Request["opFlag"].ToString() == "add") { btnConfirmEdit.Visible = false; } ListFiles.ClientSideEvents.ItemDoubleClick = "function(s,e) {var index = ListFiles.GetSelectedIndex();if(index!=-1) ListFiles.RemoveItem(index);}"; } }
protected void Page_Load(object sender, EventArgs e) { theProgramCode = "rept3300"; userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); //test //theUserCode = "ZZ098"; if (!IsPostBack) { } initPlineCode(); setCondition(); System.Data.DataTable dt; if (Request["opFlag"] == "getEditSeries") { string result = ""; string sn = Request["SN"].ToString().Trim(); string plineCode = Request["PLINE_CODE"].ToString().Trim(); string sql = "select A.SN,A.PLAN_CODE,B.PLAN_SO,A.PLINE_CODE from DATA_PLAN_SN A LEFT JOIN DATA_PLAN B ON A.PLAN_CODE=B.PLAN_CODE WHERE A.SN = '" + sn + "'" + " AND (B.PLAN_TYPE='C' OR PLAN_TYPE ='D' )AND A.PLINE_CODE='" + plineCode + "' AND A.IS_VALID='Y'"; //+ " and ZDMC='管理' " //只有返修改制计划的流水号才可以 //+ " and PLAN_CODE in (select PLAN_CODE from DATA_PLAN where ( PLAN_TYPE = 'C' OR PLAN_TYPE = 'D') AND PLINE_CODE='" + plineCode + "')"; dt = dc.GetTable(sql); if (dt.Rows.Count > 0) { //??或者是取不到list里的数据,或者是已被清空,待测试 前端是用ClientInstanceName取,后台用ID? for (int i = 0; i < listLsh.Items.Count; i++) { //根据“&”分割出SN string[] str = listLsh.Items[i].ToString().Trim().Split("&".ToCharArray()); if (sn == str[0]) { //为1时前端显示“流水号已录入!” result = "1"; } } sn = dt.Rows[0][0].ToString(); string planCode = dt.Rows[0][1].ToString().Trim(); string planSO = dt.Rows[0][2].ToString().Trim(); string plineCode1 = dt.Rows[0][3].ToString(); result = sn + "&" + planCode + "&" + planSO + "&" + plineCode1; } else { //为0时前端显示“流水号不存在!” result = "0"; } this.Response.Write(result); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); MachineName = System.Net.Dns.GetHostName(); theProgramCode = "rept1400"; setCondition(); initCode(); if (!IsPostBack) { } if (Request["opFlag"] == "getEditSeries") { string str1 = "", strSo = "", strPseries = "", strPmodel = "", strPlancode = "", strFR = "", strtime1 = "", strtime2 = ""; //DateTime Time1 = DateTime.Now, Time2 = DateTime.Now.AddDays(1); string sn = Request["SN"].ToString().Trim().ToUpper(); string Sql = "select a.*,b.fr from data_product a left join atpuplannameplate b on a.plan_Code=b.plan_code where a.sn='" + sn + "'"; DataTable DT = dc.GetTable(Sql); if (DT.Rows.Count > 0) { strSo = DT.Rows[0]["PLAN_SO"].ToString(); strPseries = DT.Rows[0]["PRODUCT_SERIES"].ToString(); strPmodel = DT.Rows[0]["PRODUCT_MODEL"].ToString(); strPlancode = DT.Rows[0]["PLAN_CODE"].ToString(); string plinecode = dc.GetValue("select pline_code from data_plan where plan_code='" + txtPlanCode + "'"); strFR = dc.GetValue("select GET_FR('" + strSo + "','" + plinecode + "') from dual "); str1 = strSo + "@" + strPseries + "@" + strPmodel + "@" + strPlancode + "@" + strFR; string Sql2 = "SELECT min(WORK_DATE),max(WORK_DATE) FROM VW_DATA_COMPLETE where SN='" + sn + "'"; DataTable DT2 = dc.GetTable(Sql2); if (DT2.Rows.Count > 0) { //Time1 = Convert.ToDateTime(DT2.Rows[0][0].ToString()); //Time2 = Convert.ToDateTime(DT2.Rows[0][1].ToString()); strtime1 = DT2.Rows[0][0].ToString(); strtime2 = DT2.Rows[0][1].ToString(); str1 = str1 + "@" + strtime1 + "@" + strtime2; } } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str1 = ""; string ghtm = "", fdjxh = "", cgqxh = "", cgqbh = "", rygg = "", jygg = "", syry = "", sydz = ""; string sn = Request["SN"].ToString().Trim(); string Sql3 = "SELECT * FROM NJJ_TEST_INFO WHERE ghtm='" + sn + "'"; DataTable DT3 = dc.GetTable(Sql3); if (DT3.Rows.Count > 0) { ghtm = DT3.Rows[0]["GHTM"].ToString(); fdjxh = DT3.Rows[0]["FDJXH"].ToString(); cgqxh = DT3.Rows[0]["CGQXH"].ToString(); cgqbh = DT3.Rows[0]["CGQBH"].ToString(); rygg = DT3.Rows[0]["RYGG"].ToString(); jygg = DT3.Rows[0]["JYGG"].ToString(); syry = DT3.Rows[0]["SYRY"].ToString(); sydz = DT3.Rows[0]["SYDZ"].ToString(); } str1 = ghtm + "@" + fdjxh + "@" + cgqxh + "@" + cgqbh + "@" + rygg + "@" + jygg + "@" + syry + "@" + sydz; this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries3") { string str1 = ""; //DateTime Time1 = DateTime.Now, Time2 = DateTime.Now.AddDays(1); string sn = Request["SN3"].ToString().Trim(); string Sql = "select sn from data_product where sn='" + sn + "'"; DataTable DT = dc.GetTable(Sql); if (DT.Rows.Count > 0) { str1 = DT.Rows[0][0].ToString(); } this.Response.Write(str1); this.Response.End(); } }
public void ProcessRequest(HttpContext httpContext) { //截获请求,判断程序权限 string theUrl = httpContext.Request.ServerVariables["URL"]; int ii = theUrl.IndexOf("/", 1); if (ii < 0) ii = 0; string theUrlTemp = theUrl.Substring(0, ii); string thePath = httpContext.Request.Path; //string theProgramValue = thePath.Substring(theUrlTemp.Length, thePath.Length - theUrlTemp.Length); string theProgramValue = theUrl; string theClientIp = httpContext.Request.UserHostAddress; string requestedUrl = "" ; string targetUrl=""; int urlLength=0; // save requested, target url requestedUrl = httpContext.Request.RawUrl; targetUrl = requestedUrl; // save target url length urlLength = targetUrl.IndexOf("?"); if (urlLength == -1) urlLength = targetUrl.Length; string theUserId = ""; //得到session里面的当前用户,结合上面得到的程序,判断是否有权限访问 userManager theUserManagerTemp = (userManager)httpContext.Session["theUserManager"]; if (theUserManagerTemp == null) { if (targetUrl.Length>14 && targetUrl.Substring(1, 14) != "RmesLogin.aspx") //modified by liuzhy 2013/12/24,这里把参数改了一下(原来是从后往前找,如果带参会不正确),修正了url不对的情况会提示超时。。 { //targetUrl = theUrlTemp + "/Rmes/Login/RmesReLogin.aspx"; //改自动重新登录到默认出错页面 targetUrl = "~/Rmes/Exception/DefaultException.aspx"; urlLength = targetUrl.IndexOf("?"); if (urlLength == -1) urlLength = targetUrl.Length; } } else { theUserId = theUserManagerTemp.getUserId().ToString(); theCompanyCode = theUserManagerTemp.getCompanyCode().ToString(); } //根据这两个值进行判断是否有登录权限,判断逻辑由存储过程完成 string theRetStr = ""; string theRetProgramCode = ""; string theRetProgramName = ""; MW_CHECK_USERRIGHT sp = new MW_CHECK_USERRIGHT() { THECOMPANYCODE1 = theCompanyCode, THEUSERID1 = theUserId, THECLIENTIP1 = theClientIp, THEPROGRAMVALUE1 = theProgramValue, THERETSTR1="", THERETPROGRAMCODE1="", THERETPROGRAMNAME1="" }; Procedure.run(sp); theRetStr = sp.THERETSTR1; theRetProgramCode = sp.THERETPROGRAMCODE1; theRetProgramName = sp.THERETPROGRAMNAME1; //dataConn theDataConn = new dataConn(); //theDataConn.theComd.CommandType = CommandType.StoredProcedure; //theDataConn.theComd.CommandText = "MW_CHECK_USERRIGHT"; //theDataConn.theComd.Parameters.Clear(); //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Value = theCompanyCode; ////theDataConn.theComd.Parameters.Add("@THECOMPANYCODE1", SqlDbType.VarChar).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Value = theUserId; ////theDataConn.theComd.Parameters.Add("@THEUSERCODE1", SqlDbType.VarChar).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THECLIENTIP1", OracleDbType.Varchar2).Value = theClientIp; ////theDataConn.theComd.Parameters.Add("@THEUSERCODE1", SqlDbType.VarChar).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THEPROGRAMVALUE1", OracleDbType.Varchar2).Value = theProgramValue; ////theDataConn.theComd.Parameters.Add("@THEPROGRAMVALUE1", SqlDbType.VarChar).Direction = ParameterDirection.Input; //theDataConn.theComd.Parameters.Add("THERETSTR1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.Output; //theDataConn.theComd.Parameters.Add("THERETPROGRAMCODE1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.Output; //theDataConn.theComd.Parameters.Add("THERETPROGRAMNAME1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.Output; //theDataConn.OpenConn(); //theDataConn.theComd.ExecuteNonQuery(); //theRetStr = theDataConn.theComd.Parameters["THERETSTR1"].Value.ToString(); //theRetProgramCode = theDataConn.theComd.Parameters["THERETPROGRAMCODE1"].Value.ToString(); //theRetProgramName = theDataConn.theComd.Parameters["THERETPROGRAMNAME1"].Value.ToString(); //theDataConn.CloseConn(); //根据返回数据判断,进行不同的处理 switch (theRetStr) { case "0": //无需授权访问,只是继续请求,不做任何处理,包括未定义的程序,定义为无需授权的程序,比如登录和一些公用查询程序 //保证登录程序的顺利执行,在session里面传递公司号过去 try { httpContext.Session["theCompanyCode"] = theCompanyCode; httpContext.RewritePath(targetUrl); IHttpHandler handler = PageParser.GetCompiledPageInstance( targetUrl.Substring(0, urlLength), null, httpContext); handler.ProcessRequest(httpContext); } catch (Exception ex) { } break; case "1": //没有权限,终止请求 //httpContext.Response.StatusCode = 400; //httpContext.Response.StatusDescription = "你没有访问权限,请联系系统管理员!"; //映射到错误处理界面 targetUrl = "~/Rmes/Exception/DefaultException.aspx"; urlLength = targetUrl.IndexOf("?"); if (urlLength == -1) urlLength = targetUrl.Length; httpContext.Session["theCompanyCode"] = theCompanyCode; httpContext.RewritePath(targetUrl); IHttpHandler handler2 = PageParser.GetCompiledPageInstance( targetUrl.Substring(0, urlLength), null, httpContext); handler2.ProcessRequest(httpContext); break; case "2": //有权限访问,更新当前会话的程序号和程序名称信息 theUserManagerTemp.setProgCode(theRetProgramCode); theUserManagerTemp.setProgName(theRetProgramName); httpContext.Session["theUserManager"] = theUserManagerTemp; //try //{ httpContext.RewritePath(targetUrl); IHttpHandler handler1 = PageParser.GetCompiledPageInstance( targetUrl.Substring(0, urlLength), null, httpContext); //IHttpHandler handler1 = PageParser.GetCompiledPageInstance(thePath, null, httpContext); handler1.ProcessRequest(httpContext); //} //catch //{ // httpContext.RewritePath(targetUrl.Substring(0, urlLength)); // IHttpHandler handler1 = PageParser.GetCompiledPageInstance( // targetUrl.Substring(0, urlLength), null, httpContext); // handler1.ProcessRequest(httpContext); //} break; default: //没有权限,终止请求 httpContext.Response.StatusCode = 400; httpContext.Response.StatusDescription = "你没有访问权限,请联系系统管理员!"; break; } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserCode = theUserManager.getUserCode(); theUserId = theUserManager.getUserId(); theUserName = theUserManager.getUserName(); theProgramCode = "inv9700"; if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit2.Date = DateTime.Now; } initCode(); setCondition(); if (Request["opFlag"] == "getBatch") { string str1 = "", str2 = "", str = "", rc = "", str3 = ""; string DateEdit1 = Request["DATEEDIT1"].ToString().Trim(); string DateEdit2 = Request["DATEEDIT2"].ToString().Trim(); string Chose = Request["CHOSE"].ToString().Trim(); string PCode = Request["PCODE"].ToString().Trim(); //Server.UrlDecode(request.form["a"].ToString()) DateTime dt1 = Convert.ToDateTime(DateEdit1); DateTime dt2 = Convert.ToDateTime(DateEdit2); //dt1.AddDays(30); if (Chose == "RK") { rc = "入库"; } else { rc = "出库"; } // select distinct destination from dp_rckwcb where gzrq>='" + Format(FromRq.Value, "yyyy-mm-dd hh:mm:ss") + "' and gzrq<='" + Format(ToRq.Value, "yyyy-mm-dd hh-mm-ss") + "' AND GZDD='" + GV_Depot + "' and Rc='出库' order by Destination"I //string activeflag = chkActiveFlag.Checked ? "Y" : "N";//条件表达式 if (dt1.AddDays(31) < dt2) { str1 = "Overtime"; } else { str1 = "ok"; string sql = "select distinct gzrq from dp_rckwcb where to_date(gzrq,'yyyy-mm-dd hh24:mi:ss')>= to_date('" + DateEdit1 + "', 'yyyy-mm-dd hh24:mi:ss') and to_date(gzrq,'yyyy-mm-dd hh24:mi:ss')<= to_date('" + DateEdit2 + "', 'yyyy-mm-dd hh24:mi:ss') AND GZDD='" + PCode + "' and Rc='" + rc + "' order by Gzrq"; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string batch = dt.Rows[i][0].ToString(); str2 = str2 + "@" + batch; } if (rc == "出库") { string sql3 = "select distinct destination from dp_rckwcb where to_date(gzrq,'yyyy-mm-dd hh24:mi:ss')>= to_date('" + DateEdit1 + "', 'yyyy-mm-dd hh24:mi:ss') and to_date(gzrq,'yyyy-mm-dd hh24:mi:ss')<= to_date('" + DateEdit2 + "', 'yyyy-mm-dd hh24:mi:ss') AND GZDD='" + PCode + "' and Rc='出库' order by Destination"; DataTable dt3 = dc.GetTable(sql3); for (int i = 0; i < dt3.Rows.Count; i++) { string destination = dt3.Rows[i][0].ToString(); str3 = str3 + "@" + destination; } } } str = str1 + "," + str2 + "," + str3; this.Response.Write(str); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theProgramCode = "rept1800"; //MachineName = System.Net.Dns.GetHostName(); string hostIPAddress = Page.Request.UserHostAddress; //IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(hostIPAddress); MachineName = hostIPAddress; //MachineName = "EATPU-Z670"; //测试数据:SO=SO11223 ,站点代码:z670 if (!IsPostBack) { initCode(); //for (int i = 0; i < ASPxGridView2.Rows.Count; i++) //{ // if (ASPxGridView2.Rows[i].Cells[5].Text == "批准") // { // //将当行设置为红色 // ASPxGridView2.GetRow[0][].Rows[i].Cells[5].BackColor = System.Drawing.Color.Red; // } //} } string Site = "", Flag = "", So = ""; if (Request["opFlag"] == "getEditSeries2") { string str1 = ""; //string so = Request["SO"].ToString().Trim().ToUpper(); string plancode = Request["PLANCODE"].ToString().Trim(); string sql = "SELECT CUSTOMER_NAME,PLAN_QTY,ROUNTING_SITE,LQ_FLAG,PLAN_SO FROM DATA_PLAN WHERE PLAN_CODE='" + plancode + "' "; DataTable dt = dc.GetTable(sql); str1 = dt.Rows[0][0].ToString(); Site = dt.Rows[0][2].ToString(); Flag = dt.Rows[0][3].ToString(); So = dt.Rows[0][4].ToString(); str1 = str1 + "@" + Site + "@" + Flag + "@" + So; this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "openPic") {//装机图片用$隔开的 string str1 = "", sql3 = ""; string sname = Request["SNAME"].ToString().Trim().ToUpper(); string pcode = Request["PCODE"].ToString().Trim(); string flag = Request["FLAG"].ToString().Trim(); string getScode = "SELECT STATION_CODE FROM CODE_STATION WHERE STATION_NAME='" + sname + "'"; string Scode = dc.GetValue(getScode); if (pcode != "L" && flag != "L") { sql3 = "select a.wjpath from rstbomts_MWS a where a.zdDM='" + Scode + "' AND a.MACHINENAME='" + MachineName + "' AND a.wjpath is not null AND a.GWdm NOT IN (SELECT REAL_LOCATION FROM MS_ISSUE_LOCATION WHERE ISSUE_GZDD='L') order by a.gwdm"; } else { sql3 = "select a.wjpath from rstbomts_MWS a where a.zdDM='" + Scode + "' AND a.MACHINENAME='" + MachineName + "' AND a.wjpath is not null order by a.gwdm"; } //string sql = "select wjpath from rstbomts_MWS a left join rstbomts b on a.gwdm=b.gwdm and a.czts=b.czts and a.zddm=b.zddm where a.zdDM='" + Scode + "' AND a.MACHINENAME='" + MachineName + "' AND a.GWdm NOT IN (SELECT REAL_LOCATION FROM MS_ISSUE_LOCATION WHERE ISSUE_GZDD='L') order by a.gwdm"; //string path = dc.GetValue(sql); DataTable dt = dc.GetTable(sql3); for (int i = 0; i < dt.Rows.Count; i++) { string path = dt.Rows[i][0].ToString(); str1 += path + "$"; } this.Response.Write(str1); this.Response.End(); } setCondition(); }
public void ASPxGridView1_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; string _ids = e.Parameters; string[] ids = _ids.Split(','); //int index = Convert.ToInt32(e.Parameters); //string rmesID = ASPxGridView1.GetRowValues(index, "RMES_ID").ToString(); DB.GetInstance().BeginTransaction(); try { string batch_temp = "'B'||TO_CHAR(SYSDATE,'yyyymmdd')||to_char(SEQ_BATCHID.NEXTVAL,'fm0000')"; string sql = "select " + batch_temp + " from dual"; string batch_id = DB.GetInstance().ExecuteScalar <string>(sql); DateTime time = DateTime.Now; int num = 0; foreach (var id in ids) { ItemLineSideEntity entity = ItemLineSideFactory.GetByID(id); ItemLineSideStore2LineEntity tempStoreEntity = new ItemLineSideStore2LineEntity { COMPANY_CODE = "01", WORKSHOP = "8101", ITEM_CODE = entity.ITEM_CODE, ITEM_NAME = entity.ITEM_NAME, ITEM_QTY = entity.STAND_QTY, CREATE_TIME = DateTime.Now, CREATE_USER_ID = theUserManager.getUserId(), T_LINESIDESTORE = entity.LINESIDE_STORE_CODE, S_LINESIDESTORE = entity.RESOURCE_STORE, }; DB.GetInstance().Insert(tempStoreEntity); IMESStore2LineEntity storeEntity = new IMESStore2LineEntity { WERKS = "8101", AUFNR = DateTime.Now.ToString("yyyyMMdd").Insert(0, "A000"), SUBMAT = entity.ITEM_CODE, MATKT = entity.ITEM_NAME, MENGE = entity.STAND_QTY.ToString(), SLGORT = entity.RESOURCE_STORE, TLGORT = entity.LINESIDE_STORE_CODE, SERIAL = DateTime.Now.ToString("yyyyMMddhhmmss"), WKDT = time, BATCH = batch_id, CHARG1 = batch_id, CHARG2 = batch_id, PRIND = "0" }; DB.GetInstance().Insert(storeEntity); num++; SAPMessageTransEntity msgEntity = new SAPMessageTransEntity { MESSAGE_CODE = "0046", WORK_DATE = DateTime.Now, HANDLE_FLAG = "0", }; DB.GetInstance().Insert(msgEntity); } string sql1 = "update IMES_DATA_STORE2LINE set KUNNR=" + num + " where BATCH='" + batch_id + "'"; DB.GetInstance().Execute(sql1); DB.GetInstance().CompleteTransaction(); e.Result = "success"; } catch (Exception ex) { DB.GetInstance().AbortTransaction(); e.Result = "false"; } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); theProgramCode = "part1500"; initTName(); initCode(); setCondition(); if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit3.Date = DateTime.Now.AddDays(1); } if (Request["opFlag"] == "getEditSeries") { string str1 = "", str2 = ""; string pcode = Request["Pcode"].ToString().Trim(); if (pcode == "E") { str2 = "DCEC-B"; } else if (pcode == "W") { str2 = "DCEC-C"; } else { str2 = ""; } str1 = str1 + "," + str2; this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str1 = "", str2 = ""; string pcode = Request["Pcode"].ToString().Trim(); if (pcode == "E") { str2 = "DCEC-B"; } else if (pcode == "W") { str2 = "DCEC-C"; } else { str2 = ""; } str1 = str1 + "," + str2; this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getMATERIAL") { string str1 = ""; string mcode = Request["MCODE"].ToString().Trim(); string sql = "select nvl(pt_desc2,' ') from copy_pt_mstr where pt_part='" + mcode + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count <= 0) { str1 = "no"; this.Response.Write(str1); this.Response.End(); return; } str1 = dc.GetTable().Rows[0][0].ToString(); this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getGYS") { string str1 = ""; string gcode = Request["GCODE"].ToString().Trim(); string sql = "select nvl(ad_name,' ') from copy_ad_mstr where upper(ad_addr)='" + gcode + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count <= 0) { str1 = "no"; this.Response.Write(str1); this.Response.End(); return; } str1 = dc.GetTable().Rows[0][0].ToString(); this.Response.Write(str1); this.Response.End(); } }
protected void btnSave_Click(object sender, EventArgs e) { ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox; if (cbGCH == null) { return; } ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox; if (cbGZH == null) { return; } ASPxTextBox txtPGDH = ASPxPopupControl1.FindControl("LLPGDH") as ASPxTextBox; if (txtPGDH == null) { return; } ASPxTextBox txtXMDH = ASPxPopupControl1.FindControl("LLXMDH") as ASPxTextBox; if (txtXMDH == null) { return; } ASPxTextBox txtXMMC = ASPxPopupControl1.FindControl("LLXMMC") as ASPxTextBox; if (txtXMMC == null) { return; } ASPxTextBox txtLLSL = ASPxPopupControl1.FindControl("LLSL") as ASPxTextBox; if (txtLLSL == null) { return; } ASPxComboBox cbTEAM = ASPxPopupControl1.FindControl("LLZPXZ") as ASPxComboBox; if (cbTEAM == null) { return; } ASPxDateEdit cbLLRQ = ASPxPopupControl1.FindControl("LYRQ") as ASPxDateEdit; if (cbLLRQ == null) { return; } ASPxTextBox txtXMLX = ASPxPopupControl1.FindControl("LLXMLX") as ASPxTextBox; if (txtXMLX == null) { return; } string project_code = cbGCH.SelectedItem.Value.ToString(); string work_code = cbGZH.SelectedItem.Value.ToString(); string billno = txtPGDH.Text; string item_code = txtXMDH.Text; string item_name = txtXMMC.Text; int item_qty = Convert.ToInt32(txtLLSL.Text); string team_cdoe = cbTEAM.SelectedItem.Value.ToString(); string llxmlx = txtXMLX.Text; DateTime need_date = cbLLRQ.Date; UserEntity u = UserFactory.GetByID(user.getUserId()); TeamEntity t = TeamFactory.GetByTeamCode(team_cdoe); UserEntity leader = UserFactory.GetByUserCode(t.LEADER_CODE); if (string.IsNullOrWhiteSpace(project_code) || string.IsNullOrWhiteSpace(work_code) || string.IsNullOrWhiteSpace(billno) || string.IsNullOrWhiteSpace(item_code) || string.IsNullOrWhiteSpace(team_cdoe) || string.IsNullOrWhiteSpace(item_name) || string.IsNullOrWhiteSpace(llxmlx)) { return; } if (item_qty < 1 || item_qty > 999999) { return; } if ((need_date - DateTime.Now).TotalMinutes < 0) { return; } ProjectEntity project = ProjectFactory.GetByProjectCode(project_code); List <WorkShopEntity> workshops = WorkShopFactory.GetUserWorkShops(user.getUserId()); if (workshops.Count > 0) { workshop = workshops[0]; } else { return; } if (project != null) { string barCode = DB.GetInstance().ExecuteScalar <string>("select 'RMESL'||TRIM(TO_CHAR(SEQ_ISSUE_BARCODE.NEXTVAL,'0000000000')) from dual"); InterIssueEntity interEntity = new InterIssueEntity { LLGCH = project_code, //领料合同号 LLGZH = work_code, //领料工作号 LLCPXH = project.PRODUCT_SERIES, //领料产品型号 LLZJDH = "MANUAL", //领料组件代号 PLAN_CODE = "R" + billno, //领料派工单号 - 临改单 LLLYDW = workshop.WORKSHOP_CODE, //领用单位 - 车间 LLZPXZ = team_cdoe, //装配小组 LLXH = 1, //领料序号 LLXMDH = item_code, //项目代号 - 图号 LLLYPC = "1", //领用批次 LLSL = item_qty, //领料数量 LLCJYH = u.USER_CODE + "/" + u.USER_NAME, //单据创建人 LLCJRQ = DateTime.Now, //单据创建日期 LLNY = need_date.ToString("yyMM"), //领料年月 LLRQ = need_date, //领料日期 LLXMMC = item_name, //领料项目名称 TMBH = barCode, //领料条码编号 LLBS = "W", //领料标识 LLXZZZ = leader.USER_CODE + "/" + leader.USER_NAME, LLSPYH = u.USER_CODE + "/" + u.USER_NAME, LLR = leader.USER_CODE + "/" + leader.USER_NAME, LLXMLX = llxmlx.ToUpper() }; object obj = DB.GetInstance().Insert("INTER_ISSUE", "", false, interEntity); if (obj.ToString().ToUpper().Equals("TRUE")) { Response.Write("<script>alert('添加成功!');</script>"); Response.Redirect(Request.Url.ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { user = Session["theUserManager"] as userManager; if (user == null) { Response.End(); } userManager theUserManager = (userManager)Session["theUserManager"]; string theCompanyCode = theUserManager.getCompanyCode(); string theUserId = theUserManager.getUserId(); List <WorkShopEntity> workShop = WorkShopFactory.GetUserWorkShops(theUserId); //ASPxGridView1.CustomColumnDisplayText += new DevExpress.Web.ASPxGridView.ASPxGridViewColumnDisplayTextEventHandler(ASPxGridView1_CustomColumnDisplayText); GridViewDataComboBoxColumn column1 = (ASPxGridView1.Columns["LLXZZZ"] as GridViewDataComboBoxColumn); { column1.PropertiesComboBox.DataSource = UserFactory.GetAll(); column1.PropertiesComboBox.ValueField = "USER_CODE"; column1.PropertiesComboBox.TextField = "USER_NAME"; } GridViewDataComboBoxColumn column2 = (ASPxGridView1.Columns["LLZPXZ"] as GridViewDataComboBoxColumn); { column2.PropertiesComboBox.DataSource = TeamFactory.GetByWorkShopID("CK_WS01"); column2.PropertiesComboBox.ValueField = "RMES_ID"; column2.PropertiesComboBox.TextField = "TEAM_NAME"; } GridViewDataComboBoxColumn column3 = (ASPxGridView1.Columns["LLBS"] as GridViewDataComboBoxColumn); { System.Data.DataTable dt = new System.Data.DataTable(); dt.Columns.Add("value"); dt.Columns.Add("text"); dt.Rows.Add("W", "新建"); dt.Rows.Add("N", "已发库房"); dt.Rows.Add("Y", "已领料"); dt.Rows.Add("E", "无价格"); column3.PropertiesComboBox.DataSource = dt; column3.PropertiesComboBox.ValueField = "value"; column3.PropertiesComboBox.TextField = "text"; } List <InterIssueEntity> allEntity = InterIssueFactory.GetByWorkShopCode("8101-B1"); GridViewDataComboBoxColumn colGZH = (ASPxGridView1.Columns["LLGZH"] as GridViewDataComboBoxColumn); var a = ((from s in allEntity where !string.IsNullOrWhiteSpace(s.LLGZH) select s.LLGZH).Distinct()).ToList <string>(); colGZH.PropertiesComboBox.DataSource = a; GridViewDataComboBoxColumn colGCH = (ASPxGridView1.Columns["LLGCH"] as GridViewDataComboBoxColumn); var b = (from s in allEntity select s.LLGCH).Distinct().ToList <string>();; colGCH.PropertiesComboBox.DataSource = b; GridViewDataComboBoxColumn colZJDH = (ASPxGridView1.Columns["LLZJDH"] as GridViewDataComboBoxColumn); var c = (from s in allEntity select s.LLZJDH).Distinct().ToList <string>(); for (int i = 0; i < c.Count; i++) { if (c[i] == null) { c[i] = ""; } } colZJDH.PropertiesComboBox.DataSource = c; DataTable d = new DataTable(); d.Columns.Add("LLGCH"); d.Columns.Add("LLGZH"); d.Columns.Add("LLZJDH"); d.Columns.Add("LLXMDH"); d.Columns.Add("LLXMMC"); d.Columns.Add("LLSL"); d.Columns.Add("YSSL"); d.Columns.Add("LLRQ"); d.Columns.Add("LLCJRQ"); d.Columns.Add("LLZPXZ"); d.Columns.Add("LLXZZZ"); d.Columns.Add("PLAN_CODE"); d.Columns.Add("LLBS"); d.Columns.Add("TMBH"); foreach (InterIssueEntity i in allEntity) { List <IssueReceivedEntity> rs = IssueReceivedFactory.GetByDetailCode(i.TMBH); float sum = 0; foreach (IssueReceivedEntity r in rs) { sum += (int)r.ITEM_QTY; } d.Rows.Add(i.LLGCH, i.LLGZH, i.LLZJDH, i.LLXMDH, i.LLXMMC, i.LLSL, sum, i.LLRQ, i.LLCJRQ, i.LLZPXZ, i.LLXZZZ, i.PLAN_CODE, i.LLBS, i.TMBH); } ASPxGridView1.DataSource = d; ASPxGridView1.DataBind(); //用后台的配置开关,设置是否允许手动添加要料单,在code_config_system中 if (DB.ReadConfigServer("INV2300_ALLOW_MANUAL_ADD").Equals("FALSE")) { btnNewBill.Visible = false; } else { btnNewBill.Visible = true; ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox; if (cbGCH != null) { List <WorkShopEntity> workshops = WorkShopFactory.GetUserWorkShops(user.getUserId()); List <ProjectEntity> projects = new List <ProjectEntity>(); foreach (WorkShopEntity w in workshops) { projects.AddRange(ProjectFactory.GetByWorkShop(w.RMES_ID)); } foreach (ProjectEntity p in projects) { cbGCH.Items.Add(p.PROJECT_CODE + " | " + p.PROJECT_NAME, p.PROJECT_CODE); } cbGCH.ClientSideEvents.SelectedIndexChanged = "function(s,e){ initWorkCode(s.GetValue().toString());}"; ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox; if (cbGZH != null) { cbGZH.Callback += new DevExpress.Web.ASPxClasses.CallbackEventHandlerBase(cbGZH_Callback); } cbGCH.SelectedIndexChanged += new EventHandler(cbGCH_SelectedIndexChanged); } ASPxComboBox cbTeam = ASPxPopupControl1.FindControl("LLZPXZ") as ASPxComboBox; if (cbTeam != null) { List <TeamEntity> teams = TeamFactory.GetByUserID(user.getUserId()); foreach (TeamEntity t in teams) { cbTeam.Items.Add(t.TEAM_NAME, t.TEAM_CODE); } } } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theProgramCode = "part2400"; theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); //initPlineCode(); //初始查询条件生产线 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 + "' "; comPLQ.DataSource = dc.GetTable(Sql); comPLQ.DataBind(); initGYS(); setCondition(); if (Request["opFlag"] == "getEditM") { string str1 = ""; string MCode = Request["MCODE"].ToString().Trim(); string sql = "select nvl(pt_desc2,' ') from copy_pt_mstr where UPPER(pt_part)='" + MCode + "'"; dc.setTheSql(sql); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strMCode = dc.GetTable().Rows[0][0].ToString(); if (strMCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strMCode; } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditGYS") { string str1 = ""; string GCode = Request["GCODE"].ToString().Trim(); string sql = "select nvl(ad_name,' ') from copy_ad_mstr where UPPER(ad_addr)='" + GCode + "'"; dc.setTheSql(sql); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strGCode = dc.GetTable().Rows[0][0].ToString(); if (strGCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strGCode; } this.Response.Write(str1); this.Response.End(); } if (!IsPostBack) { //comPLQ.SelectedIndex = comPLQ.Items.Count >= 0 ? 0 : -1;// StartDateQ.Date = DateTime.Now.AddDays(-1); EndDateQ.Date = DateTime.Now.AddDays(1); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theProgramCode = "ssd1010"; if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit2.Date = DateTime.Now; ASPxBeginDate.Date = DateTime.Now; ASPxEndDate.Date = DateTime.Now; } 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(); } //DataTable dt = new DataTable(); //dt.Columns.Add("RMES_ID"); //dt.Columns.Add("GHTM"); //for (int i = 0; i < ASPxListBoxUnused.SelectedItems.Count; i++) //{ // dt.Rows.Add(ASPxListBoxUnused.SelectedItems[i].Value, ASPxListBoxUnused.SelectedItems[i].Text); //} //ASPxListBoxUsed.DataSource = dt; //ASPxListBoxUsed.DataBind(); string plineSql = "SELECT a.PLINE_CODE,a.PLINE_NAME FROM CODE_PRODUCT_LINE a where a.PLINE_CODE in ( select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "') " + " and a.COMPANY_CODE='" + theCompanyCode + "' order by a.pline_code"; SqlDataSource1.SelectCommand = plineSql; SqlDataSource1.DataBind(); string plineSql1 = "SELECT ALINE_CODE,ALINE_NAME FROM atpu_acrossline "; SqlDataSource2.SelectCommand = plineSql1; SqlDataSource2.DataBind(); setCondition(); }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); theUserName = theUserManager.getUserName(); theProgramCode = "inv9100"; if (!IsPostBack) { //Session["9100PART"] = ""; //Session["9100USER"] = ""; dataConn theDataConn1 = new dataConn(" select FUNC_GET_PLANSITE('E','D')from dual"); theDataConn1.OpenConn(); string gQadSite1 = theDataConn1.GetValue(); if (gQadSite1 != "") { string sql1 = "select distinct in_user1 bgy from copy_in_mstr where upper(in_site)='" + gQadSite1 + "'"; Session["9100USER"] = sql1; SqlBgy.SelectCommand = sql1; SqlBgy.DataBind(); sql1 = "select distinct pt_part part from copy_pt_mstr where pt_phantom=0"; Session["9100PART"] = sql1; SqlPart.SelectCommand = sql1; SqlPart.DataBind(); } ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit3.Date = DateTime.Now.AddDays(1); } initCode(); if (Request["opFlag"] == "getEditSeries") { string str1 = "", str2 = "", str = ""; string pcode = Request["PCode"].ToString().Trim(); string qad = Request["QAD"].ToString().Trim(); dataConn theDataConn = new dataConn(" select FUNC_GET_PLANSITE('" + pcode + "','D')from dual"); theDataConn.OpenConn(); string gQadSite = theDataConn.GetValue(); if (gQadSite != "") { string sql = "select distinct in_user1 bgy from copy_in_mstr where upper(in_site)='" + gQadSite + "'"; Session["9100USER"] = sql; SqlBgy.SelectCommand = sql; SqlBgy.DataBind(); } if (qad == "false" || qad == "null")//若未勾选,显示所有实零件//|| qad == "null" { string sql = "select distinct pt_part part from copy_pt_mstr where pt_phantom=0"; Session["9100PART"] = sql; SqlPart.SelectCommand = sql; SqlPart.DataBind(); } else if (qad == "true")//若勾选,显示非QAD零件 { string sql = "select distinct part from atpubkflpart where part_type='1' and gzdd='" + pcode + "' "; Session["9100PART"] = sql; SqlPart.SelectCommand = sql; SqlPart.DataBind(); } this.Response.Write(str); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str2 = ""; string part = Request["PART"].ToString().Trim(); string qad = Request["QAD"].ToString().Trim(); if (qad == "false" || qad == "null")//若未勾选 { string sql = "select pt_desc2 from copy_pt_mstr where upper(pt_part)='" + part.ToUpper() + "'"; DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str2 = " "; this.Response.Write(str2); this.Response.End(); return; } str2 = dt.Rows[0][0].ToString(); } else if (qad == "true")//若勾选 { string sql = "select part_desc from atpubkflpart where upper(pt_part)='" + part.ToUpper() + "' "; DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str2 = " "; this.Response.Write(str2); this.Response.End(); return; } str2 = dt.Rows[0][0].ToString(); } this.Response.Write(str2); this.Response.End(); } setCondition(); Query(); }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); // thePlineCode = theUserManager.getPlineCode(); theProgramCode = "part1100"; initCode(); setCondition(); if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit3.Date = DateTime.Now.AddDays(1); DateOnlinetime.Date = DateTime.Now; } //DateOnlinetime.TimeSectionProperties.Visible = true; //DateOnlinetime.UseMaskBehavior = true; //DateOnlinetime.DisplayFormatString = "None"; if (Request["opFlag"] == "submit") { string str1 = "", tableName = ""; string tabname = Request["TABNAME"].ToString().Trim(); string pcode = Request["PCODE"].ToString().Trim(); string onltime = Request["ONLTIME"].ToString().Trim(); DateTime DT1 = Convert.ToDateTime(onltime); DateTime DT2 = DateTime.Now; if (ComboTabN2.Text.Trim() == "三方物流要料") { tableName = "SF"; } else { tableName = "KF"; } if (DT1 < DT2) { str1 = "Fail,到货时间不能小于当前时间!"; } else { string sql2 = "select manualflag from ms_jit_manualflag where jitflag='" + tableName + "' and manualflag='0' AND GZDD ='" + pcode + "'"; DataTable dt2 = dc.GetTable(sql2); if (dt2.Rows.Count > 0) { str1 = "Fail,当前有未计算的手工提交,不能连续提交!!"; } else { string insertSql = "INSERT INTO MS_JIT_MANUALFLAG(JITFLAG,MANUALFLAG,COMMITTIME,JITUSER,GZDD,ONLINETIME) " + "values('" + tableName + "','0',SYSDATE,'" + theUserCode + "','" + pcode + "', to_date('" + DT1 + "','yyyy-mm-dd hh24:mi:ss'))"; dc.ExeSql(insertSql); str1 = "OK,提交完毕!"; //sql2 = "SELECT NVL(JITUSER,'SYSTEM') JITUSER,DECODE(MANUALFLAG,'0','还未计算','1','已经计算') MANUALFLAG,TO_CHAR(COMMITTIME,'YYYY-MM-DD HH24:MI:SS') COMMITTIME,NVL(TO_CHAR(ONLINETIME,'YYYY-MM-DD HH24:MI:SS'),'') ONLINETIME,NVL(TO_CHAR(JITTIME,'YYYY-MM-DD HH24:MI:SS'),'') JITTIME FROM MS_JIT_MANUALFLAG WHERE " // + "GZDD IN ( select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') and jitflag='SF' and committime>sysdate-3 order by committime"; //dt2 = dc.GetTable(sql2); //ASPxGridView2.DataSource = dt2; //ASPxGridView2.DataBind(); } } this.Response.Write(str1); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { //数据库读取装机提示图片路径 userManager theUserManager = (userManager)Session["theUserManager"]; string companyCode = theUserManager.getCompanyCode(); theUserCode = theUserManager.getUserCode(); theUserId = theUserManager.getUserId(); if (!IsPostBack) { //编辑,带出值 if (Request["opFlag"].ToString() == "edit") { string rmesId = Request["rmesId"].ToString(); string sql = "select * from DATA_QUALITY_QA where rmes_id='" + rmesId + "'"; DataTable dt = dc.GetTable(sql); cmbPlineType.Value = dt.Rows[0]["pline_code"].ToString(); cmbRoutingRemark.Value = dt.Rows[0]["rounting_remark"].ToString(); cmbSO.Value = dt.Rows[0]["plan_so"].ToString(); cmbComponet.Value = dt.Rows[0]["component_code"].ToString(); cmbProcessCode.Value = dt.Rows[0]["process_code"].ToString(); if (dt.Rows[0]["from_date"].ToString() != "") { DateFrom.Date = Convert.ToDateTime(dt.Rows[0]["from_date"].ToString()); } if (dt.Rows[0]["to_date"].ToString() != "") { DateTo.Date = Convert.ToDateTime(dt.Rows[0]["to_date"].ToString()); } txtQualityQ.Text = dt.Rows[0]["qa_question"].ToString(); cmbColor.Text = dt.Rows[0]["qa_question_color"].ToString(); cmbFont.Value = dt.Rows[0]["qa_question_font"].ToString(); cmbType.Value = dt.Rows[0]["qa_type"].ToString(); txtQualityA.Text = dt.Rows[0]["qa_answer"].ToString(); if (dt.Rows[0]["qa_question_color"].ToString() != "") { txtQualityQ.ForeColor = Color.FromName(dt.Rows[0]["qa_question_color"].ToString()); } if (dt.Rows[0]["qa_question_font"].ToString() != "") { txtQualityQ.Font.Size = FontUnit.Point(Convert.ToInt32(dt.Rows[0]["qa_question_font"].ToString())); } cmbType.Enabled = false; cmbPlineType.Enabled = false; cmbRoutingRemark.Enabled = false; cmbSO.Enabled = false; cmbComponet.Enabled = false; cmbProcessCode.Enabled = false; btnConfirm.Visible = false; } if (Request["opFlag"].ToString() == "add") { btnConfirmEdit.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); theProgramCode = "part2B00"; //initTName(); initCode(); setCondition(); if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit3.Date = DateTime.Now.AddDays(1); } if (Request["opFlag"] == "getEditSeries") { string str1 = "", str2 = ""; string pcode = Request["Pcode"].ToString().Trim(); if (pcode == "E") { str2 = "DCEC-B"; } else if (pcode == "W") { str2 = "DCEC-C"; } else { str2 = ""; } str1 = str1 + "," + str2; this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str1 = "", str2 = ""; string pcode = Request["Pcode"].ToString().Trim(); if (pcode == "E") { str2 = "DCEC-B"; } else if (pcode == "W") { str2 = "DCEC-C"; } else { str2 = ""; } str1 = str1 + "," + str2; dataConn theDataConn = new dataConn(" select FUNC_GET_PLANSITE('" + pcode + "','D')from dual"); theDataConn.OpenConn(); string gQadSite = theDataConn.GetValue(); if (gQadSite != "") { string sql = "select location_code from ms_location_time where gzdd='" + pcode + "' order by location_seq"; Session["9100USER"] = sql; sqlLocation.SelectCommand = sql; sqlLocation.DataBind(); } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getMATERIAL") { string str1 = ""; string mcode = Request["MCODE"].ToString().Trim(); string sql = "select nvl(pt_desc2,' ') from copy_pt_mstr where pt_part='" + mcode + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count <= 0) { str1 = "no"; this.Response.Write(str1); this.Response.End(); return; } str1 = dc.GetTable().Rows[0][0].ToString(); this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getGYS") { string str1 = ""; string gcode = Request["GCODE"].ToString().Trim(); string sql = "select nvl(ad_name,' ') from copy_ad_mstr where upper(ad_addr)='" + gcode + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count <= 0) { str1 = "no"; this.Response.Write(str1); this.Response.End(); return; } str1 = dc.GetTable().Rows[0][0].ToString(); this.Response.Write(str1); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserName = theUserManager.getUserName(); //获取MachineName MachineName = System.Net.Dns.GetHostName(); programcode = "inv9500"; //ASPxListBoxPart1.Attributes.Add("ondblclick", "ListBoxDblClick(this);"); if (!IsPostBack) { Session["inv9500sql"] = ""; //Session["inv9501sql"] = ""; } if (Request["opFlag"] == "getEditSeries") { string str1 = ""; //string plancode = Request["PLANCODE"].ToString(); //string item = Request["ITEM"].ToString(); //string location = Request["LOCATION"].ToString(); //string process = Request["PROCESS"].ToString(); string plancode = Request["PLANCODE"].ToString().Trim(); string item = Request["ITEM"].ToString().Trim(); string location = Request["LOCATION"].ToString().ToUpper().Trim(); string process = Request["PROCESS"].ToString().Trim(); string ysl = Request["YSL"].ToString().Trim(); //string ljh = item.Substring(1, item.Length - 1); string sql1 = "select * from data_plan_standard_bom where ITEM_CODE='" + item + "' and PLAN_CODE='" + plancode + "'"; DataTable dt1 = dc.GetTable(sql1); if (dt1.Rows.Count <= 0) { str1 = "Fail,该零件在计划BOM中不存在!"; } else { string sql2 = "select * from data_plan_standard_bom where LOCATION_CODE='" + location + "' and PLAN_CODE='" + plancode + "'"; DataTable dt2 = dc.GetTable(sql2); if (dt2.Rows.Count <= 0) { str1 = "Fail,工位有误!"; } else { string sql3 = "select * from data_plan_standard_bom where PROCESS_CODE='" + process + "' and PLAN_CODE='" + plancode + "'"; DataTable dt3 = dc.GetTable(sql3); if (dt3.Rows.Count <= 0) { str1 = "Fail,工序有误!"; } else { string sql4 = "select ljdm2 from sjbomsothmuti where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt4 = dc.GetTable(sql4); if (dt4.Rows.Count > 0) { str1 = "Fail,该零件为多对多替换的替换件!"; } else { string sql5 = "select ljdm1 from sjbomsothmuti where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt5 = dc.GetTable(sql5); if (dt5.Rows.Count > 0) { str1 = "Fail,该零件在多对多替换中已被替换!"; } else { string sql6 = "select ljdm1 from sjbomsoth where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt6 = dc.GetTable(sql6); if (dt6.Rows.Count > 0) { str1 = "Fail,该零件在一对一替换中已被替换!"; } else { string sql7 = "select QTY from rstbomqd_xc where comp='" + item + "' and jhmc='" + plancode + "'"; string strsl = dc.GetValue(sql7); if (strsl == "" || ysl == "") { str1 = "Fail,替换时原零件数量为空!"; } else { int sl = Convert.ToInt32(strsl); int sl2 = Convert.ToInt32(ysl); if (sl2 > sl) { str1 = "Fail,替换时原零件数量不能大于该零件的当前数量!"; } else { str1 = "OK,成功!"; } } } } } } } } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str1 = ""; string plancode = Request["PLANCODE"].ToString().Trim(); string item = Request["ITEM"].ToString().Trim(); string location = Request["LOCATION"].ToString().ToUpper().Trim(); string process = Request["PROCESS"].ToString().Trim(); string sql1 = "select * from COPY_PT_MSTR where PT_PART='" + item + "'"; DataTable dt1 = dc.GetTable(sql1); if (dt1.Rows.Count <= 0) { str1 = "Fail,零件号不存在!"; } else { string sql2 = "select * from data_plan_standard_bom where LOCATION_CODE='" + location + "' and PLAN_CODE='" + plancode + "'"; DataTable dt2 = dc.GetTable(sql2); if (dt2.Rows.Count <= 0) { str1 = "Fail,替换工位有误!"; } else { string sql3 = "select * from data_plan_standard_bom where PROCESS_CODE='" + process + "' and PLAN_CODE='" + plancode + "'"; DataTable dt3 = dc.GetTable(sql3); if (dt3.Rows.Count <= 0) { str1 = "Fail,替换工序有误!"; } else { str1 = "OK,成功!"; } } } this.Response.Write(str1); this.Response.End(); } ASPxListBoxPart1.ClientSideEvents.ItemDoubleClick = "function(s,e) {var index = listBoxPART1.GetSelectedIndex();if(index!=-1) listBoxPART1.RemoveItem(index);}"; ASPxListBoxPart2.ClientSideEvents.ItemDoubleClick = "function(s,e) {var index = listBoxPART2.GetSelectedIndex();if(index!=-1) listBoxPART2.RemoveItem(index);}"; if (Session["inv9500sql"] as string != "") { DataTable dt = dc.GetTable(Session["inv9500sql"] as string); ASPxGridView1.DataSource = dt; ASPxGridView1.DataBind(); } //if (Session["inv9501sql"] as string != "") //{ // DataTable dt2 = dc.GetTable(Session["inv9501sql"] as string); // ASPxGridView2.DataSource = dt2; // ASPxGridView2.DataBind(); //} SetCondition(); }
protected void Page_Load(object sender, EventArgs e) { PubCs thePubCs = new PubCs(); string theServerPath = Server.MapPath("~/").ToString(); theServerPath = theServerPath + "Rmes/Pub/Xml/RmesConfig.xml"; baseURI = thePubCs.ReadFromXml(theServerPath, "rootPath"); userManager theUserManager = (userManager)Session["theUserManager"]; theDisplayProgramName = theUserManager.getProgName(); theDisplayPlineName = theUserManager.getPlineName(); theDisplayUserName = theUserManager.getUserName(); theDisplayCompanyCode = theUserManager.getCompanyCode(); theDisplayProgramCode = theUserManager.getProgCode(); string theMenuCompanyCode = theUserManager.getCompanyCode(); string theMenuUserCode = theUserManager.getUserCode(); string theMenuUserId = theUserManager.getUserId(); string opt = Request["opt"] as string; string progid = Request["progCode"] as string; if (opt != null && progid != null && opt != string.Empty && progid != string.Empty) { if (opt == "setdefaultpage") { try { dataConn dc = new dataConn(); string _theSql = "SELECT * FROM REL_USER_DEFAULTPAGE WHERE COMPANY_CODE = '" + theDisplayCompanyCode + "' AND USER_ID = '" + theMenuUserId + "'"; dc.setTheSql(_theSql); if (dc.GetState()) { _theSql = "UPDATE REL_USER_DEFAULTPAGE SET DEFAULT_PAGE = '" + progid + "' WHERE COMPANY_CODE = '" + theDisplayCompanyCode + "' AND USER_ID = '" + theMenuUserId + "'"; } else { _theSql = "INSERT INTO REL_USER_DEFAULTPAGE(COMPANY_CODE,USER_ID,DEFAULT_PAGE)VALUES('" + theDisplayCompanyCode + "','" + theMenuUserId + "','" + progid + "')"; } dc.ExeSql(_theSql); Response.Write("设置成功:" + progid); } catch (Exception ex) { Response.Write("设置失败,信息如下:\n" + ex.Message); } Response.End(); } } //得到菜单绝对地址 string theHost = Request.ServerVariables["REMOTE_ADDR"]; string thePort = Request.ServerVariables["SERVER_PORT"]; string theUrl = Request.ServerVariables["URL"]; string theUrlTemp = theUrl.Substring(0, theUrl.IndexOf("/", 1)); string str = "欢迎使用RMES系统," + theDisplayPlineName + " 的 " + theDisplayUserName + ",你当前打开的页面:" + theDisplayProgramName; ASPxRoundPanel1.HeaderText = str; //帮助 20080408 theHelpFile = theUrlTemp + "/Rmes/Help/" + theDisplayProgramCode + ".htm"; //考虑以后可能对程序内容做一些处理,暂且定义变量 //string theProgTemp = ""; string theSql = "select menu_code,menu_name,menu_code_father,menu_index,program_code,program_name,program_value from vw_rel_user_menu where company_code='" + theMenuCompanyCode + "' and user_id='" + theMenuUserId + "' order by menu_level,menu_index"; dataConn theDataConn = new dataConn(theSql); //theDataConn.OpenConn(); //theDataConn.theComd.CommandType = CommandType.Text; //theDataConn.theComd.CommandText = theSql; //OracleDataReader dr = theDataConn.theComd.ExecuteReader(); DataTable dt = theDataConn.GetTable(theSql); DataView dv = new DataView(dt); dv.RowFilter = "menu_code_father is NULL and menu_code is not NUll and menu_name is not NULL"; dv.Sort = "menu_index"; string name = "", text = "", url = ""; foreach (DataRowView dvr in dv) { name = dvr["menu_code"].ToString(); text = dvr["menu_name"].ToString(); url = dvr["program_value"].ToString().Trim(); url = url.Equals("") ? "" : ("../.." + url + "?progCode=" + dvr["program_code"].ToString() + "&progName=" + dvr["program_name"]); if (!text.Trim().Equals("")) { DevExpress.Web.ASPxMenu.MenuItem m = new DevExpress.Web.ASPxMenu.MenuItem(text, name, "", url); ASPxMenu1.Items.Add(m); AddChildMenu(dt, m); } } if (ASPxMenu1.Items.Count > 0) { //modeify by thl 20161011 用户不需要 注释了 ASPxMenu1.Target = "ifmain"; ASPxMenu1.Items.Add("附加功能", "ext_menu", "", ""); DevExpress.Web.ASPxMenu.MenuItem m = ASPxMenu1.Items.FindByName("ext_menu"); m.Items.Add("设置为默认页", "ext_set_homepage", "", "javascript:$.setDefaultPage(window.ifmain.location.href)", "_self"); //m.Items.Add("选择主题", "ext_set_theme", "", ""); DevExpress.Web.ASPxMenu.MenuItem n = ASPxMenu1.Items.FindByName("ext_set_theme"); string path = Server.MapPath("~/App_Themes"); //string[] themes = System.IO.Directory.GetDirectories(path); //string sTemp = ""; //foreach (string s in themes) //{ // sTemp = s.Substring(s.LastIndexOf("\\") + 1); // if (!sTemp.StartsWith(".")) // n.Items.Add(sTemp, sTemp, "", "javascript:jQuery.setTheme('" + sTemp + "')", "_self"); //} } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); programcode = "ssd1041"; if (!IsPostBack) { List<ProductLineEntity> user_plines = ProductLineFactory.GetByUserID(theUserManager.getUserId(), programcode); ASPxComboBoxPline.DataSource = user_plines; ASPxComboBoxPline.TextField = "PLINE_NAME"; ASPxComboBoxPline.ValueField = "PLINE_CODE"; ASPxComboBoxPline.DataBind(); ASPxComboBoxPline.SelectedIndex = 0; List<ProductLineEntity> plines = ProductLineFactory.GetAll(); ASPxComboBoxProcess.DataSource = plines; ASPxComboBoxProcess.TextField = "PLINE_NAME"; ASPxComboBoxProcess.ValueField = "PLINE_CODE"; ASPxComboBoxProcess.DataBind(); ASPxComboBoxProcess.Value = ASPxComboBoxPline.Value; //string sql = "select ALINE_CODE,ALINE_NAME from atpu_acrossline"; //dc.setTheSql(sql); //ASPxComboBoxAcross.DataSource = dc.GetTable(); //ASPxComboBoxAcross.TextField = "ALINE_NAME"; //ASPxComboBoxAcross.ValueField = "ALINE_CODE"; //ASPxComboBoxAcross.DataBind(); //ASPxComboBoxAcross.SelectedIndex = 0; string sql = "select * from code_station t left join code_station_type a on t.station_type=a.station_type_code where a.station_type_name like '%拆解%' and t.pline_code in (select pline_code from rel_user_pline where user_id='" + theUserManager.getUserId() + "') "; dc.setTheSql(sql); CJZD.DataSource = dc.GetTable(); CJZD.TextField = "STATION_NAME"; CJZD.ValueField = "STATION_TYPE"; CJZD.DataBind(); CJZD.SelectedIndex = 0; ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit2.Date = DateTime.Now.AddDays(5); ASPxBeginDate.Date = DateTime.Now; ASPxEndDate.Date = DateTime.Now.AddDays(5); } 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(); } string plineSql = "SELECT a.PLINE_CODE,a.PLINE_NAME FROM CODE_PRODUCT_LINE a left join rel_user_pline b on a.rmes_id=b.PLINE_CODE " + " WHERE a.COMPANY_CODE='" + theCompanyCode + "' AND b.USER_ID='" + theUserId + "' order by a.pline_code"; SqlDataSource1.SelectCommand = plineSql; SqlDataSource1.DataBind(); string plineSql1 = "SELECT ALINE_CODE,ALINE_NAME FROM atpu_acrossline "; SqlDataSource2.SelectCommand = plineSql1; SqlDataSource2.DataBind(); string plineSql2 = "select * from code_station t left join code_station_type a on t.station_type=a.station_type_code where a.station_type_name like '%拆解%' and t.pline_code in (select pline_code from rel_user_pline where user_id='" + theUserManager.getUserId() + "') "; SqlDataSource3.SelectCommand = plineSql2; SqlDataSource3.DataBind(); setCondition(); }
protected void Page_Load(object sender, EventArgs e) { theProgramCode = "part2900"; userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); modifyFlag = "0"; string sql = "SELECT DISTINCT PLINE_CODE, PLINE_NAME FROM VW_USER_ROLE_PROGRAM WHERE USER_ID = '" + theUserId + "' AND PROGRAM_CODE = '" + theProgramCode + "' AND COMPANY_CODE = '" + theCompanyCode + "' ORDER BY PLINE_CODE"; ComboGzdd.DataSource = dc.GetTable(sql); ComboGzdd.DataBind(); setCondition(); if (Request["opFlag"] == "getEditM") { string str1 = ""; string MCode = Request["MCODE"].ToString().Trim(); string sql88 = "select nvl(pt_desc2,' ') from copy_pt_mstr where UPPER(pt_part)='" + MCode + "'"; dc.setTheSql(sql88); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strMCode = dc.GetTable().Rows[0][0].ToString(); if (strMCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strMCode; } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditGYS") { string str1 = ""; string GCode = Request["GCODE"].ToString().Trim(); string sql99 = "select nvl(ad_name,' ') from copy_ad_mstr where UPPER(ad_addr)='" + GCode + "'"; dc.setTheSql(sql99); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strGCode = dc.GetTable().Rows[0][0].ToString(); if (strGCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strGCode; } this.Response.Write(str1); this.Response.End(); } if (!IsPostBack) { ComboGzdd.SelectedIndex = ComboGzdd.Items.Count >= 0 ? 0 : -1; //初始化工位 string sql2 = " select location_code from ms_location_time where gzdd='" + ComboGzdd.Value.ToString() + "' order by location_seq "; DataTable dt2 = dc.GetTable(sql2); cmbLocation.DataSource = dt2; cmbLocation.ValueField = "LOCATION_CODE"; cmbLocation.TextField = "LOCATION_CODE"; cmbLocation.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserName = theUserManager.getUserName(); //获取MachineName MachineName = System.Net.Dns.GetHostName(); programcode = "inv9500"; //ASPxListBoxPart1.Attributes.Add("ondblclick", "ListBoxDblClick(this);"); if (!IsPostBack) { } if (Request["opFlag"] == "getEditSeries") { string str1 = ""; //string plancode = Request["PLANCODE"].ToString(); //string item = Request["ITEM"].ToString(); //string location = Request["LOCATION"].ToString(); //string process = Request["PROCESS"].ToString(); string plancode = Request["PLANCODE"].ToString().Trim(); string item = Request["ITEM"].ToString().Trim(); string location = Request["LOCATION"].ToString().Trim(); string process = Request["PROCESS"].ToString().Trim(); string sql1 = "select * from data_plan_standard_bom where ITEM_CODE='" + item + "' and PLAN_CODE='" + plancode + "'"; DataTable dt1 = dc.GetTable(sql1); if (dt1.Rows.Count <= 0) { str1 = "Fail,该零件在计划BOM中不存在!"; } else { string sql2 = "select * from data_plan_standard_bom where LOCATION_CODE='" + location + "' and PLAN_CODE='" + plancode + "'"; DataTable dt2 = dc.GetTable(sql2); if (dt2.Rows.Count <= 0) { str1 = "Fail,工位有误!"; } else { string sql3 = "select * from data_plan_standard_bom where PROCESS_CODE='" + process + "' and PLAN_CODE='" + plancode + "'"; DataTable dt3 = dc.GetTable(sql3); if (dt3.Rows.Count <= 0) { str1 = "Fail,工序有误!"; } else { string sql4 = "select ljdm2 from sjbomsothmuti where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt4 = dc.GetTable(sql4); if (dt4.Rows.Count > 0) { str1 = "Fail,该零件为多对多替换的替换件!"; } else { string sql5 = "select ljdm1 from sjbomsothmuti where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt5 = dc.GetTable(sql5); if (dt5.Rows.Count > 0) { str1 = "Fail,该零件在多对多替换中已被替换!"; } else { string sql6 = "select ljdm1 from sjbomsoth where ljdm2='" + item + "' and istrue='1' and jhdm='" + plancode + "'"; DataTable dt6 = dc.GetTable(sql6); if (dt6.Rows.Count > 0) { str1 = "Fail,该零件在一对一替换中已被替换!"; } else { str1 = "OK,成功!"; } } } } } } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str1 = ""; string plancode = Request["PLANCODE"].ToString().Trim(); string item = Request["ITEM"].ToString().Trim(); string location = Request["LOCATION"].ToString().Trim(); string process = Request["PROCESS"].ToString().Trim(); string sql1 = "select * from COPY_PT_MSTR where PT_PART='" + item + "'"; DataTable dt1 = dc.GetTable(sql1); if (dt1.Rows.Count <= 0) { str1 = "Fail,零件号不存在!"; } else { str1 = "OK,成功!"; } this.Response.Write(str1); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theProgramCode = "part2000"; if (!IsPostBack) { //plineCode = "E"; createTime = DateTime.Now.ToString(); initGzdd(); Session["part2000sql"] = ""; } else { createTime = ""; } if (Session["part2000sql"] as string != "") { string sql2 = Session["part2000sql"] as string; sqlBillCode.SelectCommand = sql2; sqlBillCode.DataBind(); } else { initGzdd(); } setCondition(); //if (ComboGzdd.Text.Trim() != "") //{ // plineCode = ComboGzdd.Value.ToString(); //} //initBillCode(); //if (ComboBillCode.Text.Trim() != "" && ComboGzdd.Text.Trim() != "") //{ // String sql = "SELECT T.*,ROWID FROM MS_SFJIT_RESULT_PO T "; // sql += " WHERE 1 = 1 "; // //测试“算术运算导致溢出”的错误是否是因为数据量太大而引起 // //sql += " AND ROWNUM <= 100 "; // //if (ComboGzdd.Text.Trim() != "") // //{ // sql += " AND GZDD = '" + plineCode + "' "; // //} // if (ComboBillCode.Text.Trim() != "") // { // sql += " AND BILL_CODE = '" + ComboBillCode.Text.Trim() + "' "; // } // if (createTime != "") // { // //防止数据量太大而报错 // sql += " AND CREATE_TIME >= TO_DATE('" + createTime + "', 'YYYY-MM-DD HH24:MI:SS') "; // } // sql += " ORDER BY LOCATION_CODE,MATERIAL_CODE "; // DataTable dt = dc.GetTable(sql); // ASPxGridView1.DataSource = dt; // ASPxGridView1.DataBind(); //} }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); theUserName = theUserManager.getUserName(); theProgramCode = "inv9100"; if (!IsPostBack) { ASPxDateEdit1.Date = DateTime.Now; ASPxDateEdit3.Date = DateTime.Now.AddDays(1); } initCode(); setCondition(); Query(); if (Request["opFlag"] == "getEditSeries") { string str1 = "", str2 = "", str = ""; string pcode = Request["PCode"].ToString().Trim(); string qad = Request["QAD"].ToString().Trim(); //string activeflag = chkActiveFlag.Checked ? "Y" : "N";//条件表达式 dataConn theDataConn = new dataConn(" select FUNC_GET_PLANSITE('" + pcode + "','D')from dual"); theDataConn.OpenConn(); string gQadSite = theDataConn.GetValue(); if (gQadSite != "") { string sql = "select distinct in_user1 from copy_in_mstr where upper(in_site)='" + gQadSite + "'"; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string bgy = dt.Rows[i][0].ToString(); //string code2 = dt.Rows[i][1].ToString(); str1 = str1 + "@" + bgy; } } if (qad == "false")//若未勾选,显示所有实零件//|| qad == "null" { string sql = "select distinct pt_part from copy_pt_mstr where pt_phantom=0"; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string partcode = dt.Rows[i][0].ToString(); str2 = str2 + "@" + partcode; } } else if (qad == "true")//若勾选,显示非QAD零件 { string sql = "select part from atpubkflpart where part_type='1' and gzdd='" + pcode + "' "; DataTable dt = dc.GetTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { string partcode = dt.Rows[i][0].ToString(); str2 = str2 + "@" + partcode; } } str = str1 + "," + str2; this.Response.Write(str); this.Response.End(); } if (Request["opFlag"] == "getEditSeries2") { string str2 = ""; string part = Request["PART"].ToString().Trim(); string qad = Request["QAD"].ToString().Trim(); if (qad == "false")//若未勾选 { string sql = "select pt_desc2 from copy_pt_mstr where pt_part='" + part + "'"; DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str2 = " "; this.Response.Write(str2); this.Response.End(); return; } str2 = dc.GetTable().Rows[0][0].ToString(); } else if (qad == "true")//若勾选 { string sql = "select part_desc from atpubkflpart where part='" + part + "' "; DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str2 = " "; this.Response.Write(str2); this.Response.End(); return; } str2 = dt.Rows[0][0].ToString(); } this.Response.Write(str2); this.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserName = theUserManager.getUserName(); theUserCode = theUserManager.getUserCode(); theProgramCode = "atpu1C00"; //初始化站点名称begin if (Request["opFlag"] == "getEditZD") { string str1 = ""; string zdmc = Request["zddmC"].ToString(); string sql = "select STATION_CODE from CODE_STATION where STATION_NAME='" + zdmc + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string zddm = dc.GetTable().Rows[0][0].ToString(); if (zdmc == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } str1 = zddm; this.Response.Write(str1); this.Response.End(); } //初始化站点名称end //初始化零件名称begin if (Request["opFlag"] == "getEditLJDM") { string str1 = ""; string ljdm = Request["ljdmC"].ToString(); string sql = "select PT_DESC2 from COPY_PT_MSTR where PT_PART='" + ljdm + "'"; dc.setTheSql(sql); if (dc.GetTable().Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string ljmc = dc.GetTable().Rows[0][0].ToString(); if (ljdm == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } str1 = ljmc; this.Response.Write(str1); this.Response.End(); } //初始化零件名称end if (Request["opFlag"] == "getEditSeries") { string str = ""; string pcode = Request["PCode"].ToString().Trim(); //dataConn theDataConn = new dataConn(" select FUNC_GET_PLANSITE('" + pcode + "','D')from dual"); //theDataConn.OpenConn(); //string gQadSite = theDataConn.GetValue(); //if (gQadSite != "") //{ string sql = "SELECT distinct STATION_NAME FROM CODE_STATION where PLINE_CODE=RH_GET_DATA('L','" + pcode + "','','','')"; Session["1C00STATION"] = sql; SqlDataSource2.SelectCommand = sql; SqlDataSource2.DataBind(); //} this.Response.Write(str); this.Response.End(); } setCondition(); //string Sql2 = "SELECT distinct STATION_NAME FROM CODE_STATION order by STATION_NAME "; //SqlDataSource2.SelectCommand = Sql2; //SqlDataSource2.DataBind(); //SqlDataSource22.SelectCommand = Sql2; //SqlDataSource22.DataBind(); string Sql3 = "SELECT distinct PT_PART,PT_DESC2 FROM COPY_PT_MSTR where pt_phantom=0 order by PT_PART "; SqlDataSource3.SelectCommand = Sql3; SqlDataSource3.DataBind(); string Sql4 = "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"; SqlDataSource4.SelectCommand = Sql4; SqlDataSource4.DataBind(); string Sql8 = "select internal_code,internal_name from code_internal " + "where COMPANY_CODE = '" + theCompanyCode + "' and internal_type_code='011' order by internal_code"; SqlLJLB.SelectCommand = Sql8; SqlLJLB.DataBind(); //if (!IsPostBack) //{ // string sql = "SELECT distinct STATION_NAME FROM CODE_STATION "; // Session["1C00STATION"] = sql; // SqlDataSource2.SelectCommand = sql; // SqlDataSource2.DataBind(); //} }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserName = theUserManager.getUserName(); theUserCode = theUserManager.getUserCode(); theProgramCode = "inv1100"; v_CurrentBatchId = "%"; string hostIPAddress = Page.Request.UserHostAddress; //IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(hostIPAddress); GV_MachineName = hostIPAddress; //GV_MachineName = System.Net.Dns.GetHostName(); if (comboPline.Value != null) { GV_Depot = comboPline.Value.ToString(); } if (GV_Depot == "L")//161108add begin { Label13.Visible = true; comboJCJ.Visible = true; } else { Label13.Visible = false;; comboJCJ.Visible = false; }//161108add end //根据登录人员去初始化生产线 //string sqlNew = "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"; //string sqlNew = "select depotid pline_code,depotname pline_name from dp_dmdepot "; string sqlNew = "select a.depotid pline_code,a.depotname pline_name from dp_dmdepot a left join REL_USER_DMDEPOT b on a.depotid=b.depotid where b.user_code='" + theUserCode + "' and b.PROGRAM_CODE='INV1100' "; //+ "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"; comboPline.DataSource = dc.GetTable(sqlNew); comboPline.DataBind(); //初始化入库类型 string SQlstr = "SELECT lxmc FROM DP_rklx where lxdm like 'I%' ORDER BY lxdm"; comboRKLX.DataSource = dc.GetTable(SQlstr); comboRKLX.TextField = "LXMC"; comboRKLX.ValueField = "LXMC"; comboRKLX.DataBind(); SqlRklx.SelectCommand = "SELECT lxmc FROM DP_rklx where lxdm like 'I%' ORDER BY lxdm"; //初始化员工 string sql = "SELECT ygmc FROM DP_ygb ORDER BY ygmc"; comboUser.DataSource = dc.GetTable(sql); comboUser.TextField = "YGMC"; comboUser.ValueField = "YGMC"; comboUser.DataBind(); //初始化柳汽标识 string sqlL = "SELECT internal_code,internal_name FROM code_internal where internal_type_code='010' ORDER BY internal_code"; comboJCJ.DataSource = dc.GetTable(sqlL); comboJCJ.ValueField = "internal_name"; comboJCJ.TextField = "internal_name"; comboJCJ.DataBind(); initBatch(); setCondition(); if (!IsPostBack) { comboPline.SelectedIndex = 0; if (comboPline.Value != null) { GV_Depot = comboPline.Value.ToString(); } if (comboPline.Value.ToString() == "L")//161108add begin { Label13.Visible = true; comboJCJ.Visible = true; } else { Label13.Visible = false;; comboJCJ.Visible = false; }//161108add end //删除临时表数据161108add string m_Sql = "delete from dp_rckwcbtemp where MachineName='" + GV_MachineName + "' ";//and gzdd='" + GV_Depot + "' dc.ExeSql(m_Sql); } }