protected void imgSave_Click(object sender, ImageClickEventArgs e) { try { if (!CheckInfo()) { return; } int i = QTCKQuery.GetRecordCount(this.txtCKDH.Text); if (i > 0) { this.PrintfError("该单据已经执行,不能修改"); return; } string DJZT = this.hidZT.Value.Trim(); if (DJZT == "Add")//保存新建的单据 { DataSet ds = (DataSet)Session["QTCKITEM"]; if (ds == null || ds.Tables[0].Rows.Count < 1) { this.PrintfError("未添加任何明细,请进行添加!"); return; } string CKDH = this.txtCKDH.Text.Trim(); string CK = this.drpFHCK.SelectedValue; string CPH = this.txtCPH.Text.Trim(); string MDD = this.txtMDD.Text.Trim(); string ZDR = this.txtZDR.Text.Trim(); string ZDRQ = this.txtZDRQ.Text.Trim(); string CKLX = this.drpCKLX.Text.Trim(); string NCDJ = this.txtNCDJ.Text.Trim(); string CYS = this.drpCYS.SelectedValue; string FYSJ = this.txtFYRQ.Text.Trim(); string SHDW = this.drpSHDW.Text.Trim(); DataRow row = ds.Tables[1].NewRow();//CKDH,CK,CKLX,NCDJ row["CKDH"] = CKDH; row["CK"] = CK; row["CPH"] = CPH; row["AimAdress"] = MDD; row["ZDR"] = ZDR; row["ZDRQ"] = DateTime.Now; row["STATUS"] = "0"; row["CKLX"] = CKLX; row["NCDJ"] = NCDJ; if (CYS != "请选择") { row["CYS"] = CYS; } row["FYSJ"] = Convert.ToDateTime(FYSJ); if (SHDW != "请选择" || !string.IsNullOrEmpty(SHDW)) { row["SHDW"] = SHDW; } ds.Tables[1].Rows.Add(row); QTCKQuery.AddQTCKD(ds); this.hidZT.Value = ""; ReturnStatus(); } if (DJZT == "Modify")//保存修改的单据 { DataSet ds = (DataSet)Session["QTCKITEM"]; if (ds == null || ds.Tables[0].Rows.Count < 1) { this.PrintfError("未添加任何明细,请进行添加!"); return; } string CKDH = this.txtCKDH.Text.Trim(); string CK = this.drpFHCK.SelectedValue; string CPH = this.txtCPH.Text.Trim(); string MDD = this.txtMDD.Text.Trim(); string ZDR = this.txtZDR.Text.Trim(); string ZDRQ = this.txtZDRQ.Text.Trim(); string CKLX = this.drpCKLX.Text.Trim(); string NCDJ = this.txtNCDJ.Text.Trim(); string CYS = this.drpCYS.SelectedValue; string FYSJ = this.txtFYRQ.Text.Trim(); string SHDW = this.drpSHDW.Text.Trim(); ds.Tables[1].Rows[0]["CK"] = CK; ds.Tables[1].Rows[0]["CPH"] = CPH; ds.Tables[1].Rows[0]["AimAdress"] = MDD; ds.Tables[1].Rows[0]["ZDR"] = ZDR; ds.Tables[1].Rows[0]["ZDRQ"] = ZDRQ; ds.Tables[1].Rows[0]["CKLX"] = CKLX; ds.Tables[1].Rows[0]["NCDJ"] = NCDJ; ds.Tables[1].Rows[0]["CYS"] = CYS; ds.Tables[1].Rows[0]["FYSJ"] = FYSJ; ds.Tables[1].Rows[0]["SHDW"] = SHDW; QTCKQuery.AddQTCKD(ds); this.hidZT.Value = ""; ReturnStatus(); } this.frameItem.Attributes["src"] = "QTCKD_item.aspx?ZT=Browse"; } catch { this.PrintfError("保存过程出现错误,请重试"); return; } }
protected void Page_Load(object sender, EventArgs e) { string action = Request.QueryString["action"]; switch (action) { case "deldj": string delckdh = Request.QueryString["ckdh"]; DataSet ds3 = QTCKQuery.GetQTCKstatus("ckdh", delckdh); if (ds3 != null) { if (ds3.Tables[0].Rows.Count > 0) { Response.Write("NotDel"); //this.PrintfError("该单据已经执行,不能删除"); return; } } Response.Write("false"); //Response.Write("<script>if (!confirm('确实要删除此出库单吗?')) return false;</script>"); break; case "zaideldj": string zaicdelkdh = Request.QueryString["ckdh"]; QTCKQuery delqtck = new QTCKQuery(); delqtck.CKDHDel(zaicdelkdh); break; case "ChongZhi": string chongzhickdh = Request.QueryString["ckdh"]; DataSet ds4 = QTCKQuery.GetQTCKstatus("ckdh", chongzhickdh); if (ds4 != null) { if (ds4.Tables[0].Rows.Count >= 1) { //this.PrintfError("该单据已经执行完成,不能重置"); Response.Write("NotChongZhi"); return; } if (ds4.Tables[0].Rows.Count == 0) { //this.PrintfError("不用重置"); Response.Write("NoYong"); return; } Response.Write("false"); } break; case "ZaiChongZhi": string zaickdh = Request.QueryString["ckdh"]; QTCKQuery czqtck = new QTCKQuery(); czqtck.CKDHChongZhi(zaickdh); czqtck.ChongZhiStatus(zaickdh); Response.Write("new"); break; case "CancelDJ": string cancelckdh = Request.QueryString["ckdh"]; int i = QTCKQuery.GetRecordCount(cancelckdh); if (i < 2) { //this.PrintfError("不用取消"); Response.Write("NoCancel"); return; } if (i == 2) { Response.Write("false"); } break; case "zaiCancelDJ": string zaiCancelckdh = Request.QueryString["ckdh"]; string fhck = Request.QueryString["fhck"]; int j = QTCKQuery.Exec_cancelqtck(zaiCancelckdh, fhck, CUSER.UserID); if (j == 1) { Response.Write("zhixing"); //正在执行 } else { Response.Write("wrong"); //取消完成失败! } break; case "SaveDJ": string saveckdh = Request.QueryString["ckdh"]; string Current = Request.QueryString["Current"]; string status = Request.QueryString["status"]; string ck = Request.QueryString["ck"]; string ncdj = Request.QueryString["ncdj"]; string cph = Request.QueryString["cph"]; string txtTARGET = Request.QueryString["txtTARGET"]; string CYS = Request.QueryString["CYS"]; string SHDW = Request.QueryString["SHDW"]; string ZDR = Request.QueryString["ZDR"]; string ZDRQ = Request.QueryString["ZDRQ"]; int k = QTCKQuery.GetRecordCount(saveckdh); if (k > 0) { Response.Write("NoMODI"); //this.PrintfError("该单据已经执行,不能修改"); return; } if (Current == "new") { } break; case "ModiMX": string MXckdh = Request.QueryString["ckdh"]; DataSet dsmx = QTCKQuery.GetQTCKitem("ckdh", MXckdh); if (dsmx == null) { Response.Write("wrongmx"); } break; case "DelMX": string delmxckdh = Request.QueryString["ckdh"]; DataSet deldsmx = QTCKQuery.GetQTCKitem("ckdh", delmxckdh); if (deldsmx == null) { Response.Write("Delmx"); } break; case "zaiDelMX": string zaidelmx = Request.QueryString["ckdh"]; QTCKQuery dsdel = new QTCKQuery(); dsdel.CKDHDel(zaidelmx); Response.Write("success"); break; case "add": string strFCKDH = Request.QueryString["fckdh"]; string strFCK = Request.QueryString["fhck"]; string strPCH = Request.QueryString["pch"]; string strSX = Request.QueryString["sx"]; string strWLH = Request.QueryString["wlh"]; string strWLMC = Request.QueryString["wlmc"]; string strPH = Request.QueryString["ph"]; string strGG = Request.QueryString["gg"]; string strSLDW = Request.QueryString["sldw"]; string strZLDW = Request.QueryString["zldw"]; string strJHSL = Request.QueryString["jhsl"]; string strJHZL = Request.QueryString["jhzl"]; QTCKQuery qtckquery = new QTCKQuery(); qtckquery.Add(strFCKDH, strPCH, strSX, strWLH, strWLMC, strPH, strGG, strJHSL, strJHZL, 0, 0, strSLDW, strZLDW); Response.Write("ins_suss"); break; } }