protected void Page_Load(object sender, EventArgs e) { string action = Request.QueryString["action"]; switch (action) { case "modixtzh": string zkdh = ""; string operatFlag; string ck; zkdh = Request.QueryString["zkdh"]; ck = Request.QueryString["ck"]; operatFlag = Request.QueryString["flag"]; if (CUSER.UserID == "") { Response.Write("wronguser"); } int i = XTZHQuery.Exec_Xtzk(zkdh, CUSER.UserID, operatFlag); switch (i) { case -1: Response.Write("yichong"); break; case 0: XTZHQuery xtzh = new XTZHQuery(); xtzh.Insert_Xtzk(zkdh, CUSER.UserID, ck); Response.Write("success"); break; case 1: Response.Write("1"); break; case 2: Response.Write("2"); break; case 3: Response.Write("3"); break; case 4: Response.Write("4"); break; case 5: Response.Write("5"); break; case 6: Response.Write("6"); break; case 7: Response.Write("7"); break; case 8: Response.Write("8"); break; } break; } }
protected void imgBtnChange_Click(object sender, ImageClickEventArgs e) { bool isChoose = false; bool ischoosed = false; int i = -2; string strStatus = ""; string isAll = ""; string strSX = ""; string strZYDH = ""; string strCK = ""; string strckzkdh = ""; foreach (GridViewRow row in this.grvXTZHWL.Rows) { HtmlInputCheckBox chk = (HtmlInputCheckBox)row.FindControl("chkRow"); if (chk.Checked) { ischoosed = true; strckzkdh = row.Cells[1].Text.Trim(); isAll = row.Cells[13].Text.Trim(); break; } } if (!ischoosed) { this.PrintfError("请选择!"); return; } if (isAll != "Y") { PrintfError("该单据不是整批转换"); return; } int vv = XTZHQuery.Check_Zpzh(strckzkdh); switch (vv) { case 1: this.PrintfError("属于当前批次的所有转换单数量与库存数量不符!"); return; //case 2: // this.PrintfError("转换"); // break; } foreach (GridViewRow row in this.grvXTZHWL.Rows) { HtmlInputCheckBox chk = (HtmlInputCheckBox)row.FindControl("chkRow"); if (chk.Checked) { isChoose = true; strStatus = row.Cells[15].Text.Trim(); isAll = row.Cells[13].Text.Trim(); strSX = row.Cells[8].Text.Trim(); strZYDH = row.Cells[1].Text.Trim(); strCK = row.Cells[2].Text.Trim(); if (strStatus == "2") { this.PrintfError("该单据已经被转换,不能再次被转换"); return; } if (isAll != "Y") { PrintfError("该单据不是整批转换"); return; } int operatFlag = 0; if (strSX == "DP") { operatFlag = 1; } else { operatFlag = 0; } try { i = XTZHQuery.Exec_Xtzk(strZYDH, this.CUSER.UserID, operatFlag.ToString()); } catch (Exception ex) { this.PrintfError(ex.Message); return; } switch (i) { case -1: this.PrintfError("执行过程发生异常错误"); return; case 0: XTZHQuery xtzh = new XTZHQuery(); xtzh.Insert_Xtzk(strZYDH, this.CUSER.UserID, strCK); BindXTZHWL(); this.PrintfError("形态转换成功"); break; case 1: PrintfError("当前单据不是整批转换单"); return; case 2: PrintfError("当前单据已经被转换,不能重复转换"); return; case 3: PrintfError("应转数量不等于该批次库存数量,整批转换单需要对该批所有单卷进行转换"); return; case 4: PrintfError("转换单中每种属性的计划数量不满足转换条件"); return; case 5: PrintfError("转换单中每种属性的计划数量不满足转换条件"); return; case 6: PrintfError("该批次原物料号不唯一,不能进行整批转换"); return; case 7: PrintfError("转换后物料号不唯一,不能进行整批转换"); return; case 8: PrintfError("整批形态转换要求转换后该批次的拥有相同属性值"); return; } } //if (i == 0) //{ // XTZHQuery xtzh = new XTZHQuery(); // xtzh.Insert_Xtzk(strZYDH, this.CUSER.UserID, strCK); // BindXTZHWL(); // this.PrintfError("形态转换成功"); // //break; //} } foreach (GridViewRow row in this.grvXTZHWL.Rows) { strStatus = row.Cells[15].Text.Trim(); isAll = row.Cells[13].Text.Trim(); strSX = row.Cells[8].Text.Trim(); strZYDH = row.Cells[1].Text.Trim(); strCK = row.Cells[2].Text.Trim(); if (i == 0) { XTZHQuery xtzh1 = new XTZHQuery(); xtzh1.Insert_Xtzk(strZYDH, this.CUSER.UserID, strCK); BindXTZHWL(); //this.PrintfError("形态转换成功"); //break; } } if (i == 0) { this.PrintfError("形态转换成功"); } if (isChoose == false) { this.PrintfError("没有可选择的记录!"); return; } }