/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TMD_GPFY_LOG model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TMD_GPFY_LOG("); strSql.Append("C_FYDH,C_TYPE,C_EMP_ID,N_NUM,N_WGT,C_SEND_STOCK,C_BATCH_NO,C_STOVE,C_STL_GRD,C_STD_CODE,C_SPEC,C_ZLDJ,C_BZYQ,C_LIC_PLA_NO)"); strSql.Append(" values ("); strSql.Append(":C_FYDH,:C_TYPE,:C_EMP_ID,:N_NUM,:N_WGT,:C_SEND_STOCK,:C_BATCH_NO,:C_STOVE,:C_STL_GRD,:C_STD_CODE,:C_SPEC,:C_ZLDJ,:C_BZYQ,:C_LIC_PLA_NO)"); OracleParameter[] parameters = { new OracleParameter(":C_FYDH", OracleDbType.Varchar2, 100), new OracleParameter(":C_TYPE", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP_ID", OracleDbType.Varchar2, 100), new OracleParameter(":N_NUM", OracleDbType.Decimal, 5), new OracleParameter(":N_WGT", OracleDbType.Decimal, 15), new OracleParameter(":C_SEND_STOCK", OracleDbType.Varchar2, 100), new OracleParameter(":C_BATCH_NO", OracleDbType.Varchar2, 100), new OracleParameter(":C_STOVE", OracleDbType.Varchar2, 100), new OracleParameter(":C_STL_GRD", OracleDbType.Varchar2, 100), new OracleParameter(":C_STD_CODE", OracleDbType.Varchar2, 100), new OracleParameter(":C_SPEC", OracleDbType.Varchar2, 100), new OracleParameter(":C_ZLDJ", OracleDbType.Varchar2, 100), new OracleParameter(":C_BZYQ", OracleDbType.Varchar2, 100), new OracleParameter(":C_LIC_PLA_NO", OracleDbType.Varchar2, 100) }; parameters[0].Value = model.C_FYDH; parameters[1].Value = model.C_TYPE; parameters[2].Value = model.C_EMP_ID; parameters[3].Value = model.N_NUM; parameters[4].Value = model.N_WGT; parameters[5].Value = model.C_SEND_STOCK; parameters[6].Value = model.C_BATCH_NO; parameters[7].Value = model.C_STOVE; parameters[8].Value = model.C_STL_GRD; parameters[9].Value = model.C_STD_CODE; parameters[10].Value = model.C_SPEC; parameters[11].Value = model.C_ZLDJ; parameters[12].Value = model.C_BZYQ; parameters[13].Value = model.C_LIC_PLA_NO; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
protected void Button1_Click(object sender, EventArgs e) { for (int i = 0; i < rptList2.Items.Count; i++) { HtmlInputCheckBox chkMat_Code = (HtmlInputCheckBox)rptList2.Items[i].FindControl("cbsj"); if (chkMat_Code.Checked) { Literal lstcph = (Literal)rptList2.Items[i].FindControl("lstcph"); Literal lstfyid = (Literal)rptList2.Items[i].FindControl("lstfyid"); Literal lstfydh = (Literal)rptList2.Items[i].FindControl("lstfydh"); Literal lstQua = (Literal)rptList2.Items[i].FindControl("lstqua"); Literal lstSlabCode = (Literal)rptList2.Items[i].FindControl("lstck"); Literal lstStove = (Literal)rptList2.Items[i].FindControl("lststove"); Literal lstBatchNo = (Literal)rptList2.Items[i].FindControl("lstbatchNo"); Literal lstLevZh = (Literal)rptList2.Items[i].FindControl("lstzldj"); Literal lstGrd = (Literal)rptList2.Items[i].FindControl("lstgrd"); Literal lstStdCode = (Literal)rptList2.Items[i].FindControl("lststd"); Literal LstSpec = (Literal)rptList2.Items[i].FindControl("lstspec"); Mod_TMD_DISPATCH mod_TMD_DISPATCH = bll_TMD_DISPATCH.GetModel(lstfydh.Text); if (mod_TMD_DISPATCH.C_STATUS == "7") { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('实绩已确认不能再次确认');</script>", false); return; } bll_TMD_DISPATCH.UPFYD("7", vUser.Id, vUser.Name, lstfydh.Text); string msg = bll_Interface_WL.ADDFYDToZJB(lstfydh.Text, Convert.ToDateTime(txtFYSJ.Text)); if (msg != "1") { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } Mod_TMD_GPFY_LOG mod = new Mod_TMD_GPFY_LOG(); mod.C_EMP_ID = vUser.Account; mod.C_FYDH = lstfydh.Text; mod.C_LIC_PLA_NO = lstcph.Text; mod.C_TYPE = "确认实绩"; bll_TMD_GPFY_LOG.Add(mod); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('实绩已确认');</script>", false); Query(); Detail(); SJQuery(); return; } //else //{ // this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('未选中实绩行');</script>", false); // return; //} } }
protected void Button2_Click(object sender, EventArgs e) { for (int i = 0; i < rptList2.Items.Count; i++) { HtmlInputCheckBox chkMat_Code = (HtmlInputCheckBox)rptList2.Items[i].FindControl("cbsj"); if (chkMat_Code.Checked) { Literal lstcph = (Literal)rptList2.Items[i].FindControl("lstcph"); Literal lstfyid = (Literal)rptList2.Items[i].FindControl("lstfyid"); Literal lstfydh = (Literal)rptList2.Items[i].FindControl("lstfydh"); Literal lstQua = (Literal)rptList2.Items[i].FindControl("lstqua"); Literal lstSlabCode = (Literal)rptList2.Items[i].FindControl("lstck"); Literal lstStove = (Literal)rptList2.Items[i].FindControl("lststove"); Literal lstBatchNo = (Literal)rptList2.Items[i].FindControl("lstbatchNo"); Literal lstLevZh = (Literal)rptList2.Items[i].FindControl("lstzldj"); Literal lstGrd = (Literal)rptList2.Items[i].FindControl("lstgrd"); Literal lstStdCode = (Literal)rptList2.Items[i].FindControl("lststd"); Literal LstSpec = (Literal)rptList2.Items[i].FindControl("lstspec"); bll_TMD_DISPATCH.UPFYD("4", vUser.Id, vUser.Name, lstfydh.Text); bll_Interface_WL.DELFYD(lstfydh.Text); bll_Interface_WL.UPSLABSTATUS(lstfyid.Text, "E"); Mod_TMD_GPFY_LOG mod = new Mod_TMD_GPFY_LOG(); mod.C_BATCH_NO = lstBatchNo == null ? "" : lstBatchNo.Text; mod.C_EMP_ID = vUser.Account; mod.C_FYDH = lstfydh.Text; mod.C_LIC_PLA_NO = lstcph.Text; mod.C_SEND_STOCK = lstSlabCode.Text; mod.C_SPEC = LstSpec.Text; mod.C_STD_CODE = lstStdCode.Text; mod.C_STL_GRD = lstGrd.Text; mod.C_STOVE = lstStove.Text; mod.C_TYPE = "取消实绩"; mod.C_ZLDJ = lstLevZh.Text; mod.N_NUM = int.Parse(lstQua.Text); bll_TMD_GPFY_LOG.Add(mod); } //else //{ // this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('未选中实绩行');</script>", false); // return; //} } this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('取消标记完成');</script>", false); Query(); Detail(); SJQuery(); }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TMD_GPFY_LOG GetModel(string C_ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select C_ID,C_FYDH,C_TYPE,C_EMP_ID,D_MOD_DT,N_NUM,N_WGT,C_SEND_STOCK,C_BATCH_NO,C_STOVE,C_STL_GRD,C_STD_CODE,C_SPEC,C_ZLDJ,C_BZYQ,C_LIC_PLA_NO from TMD_GPFY_LOG "); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = C_ID; Mod_TMD_GPFY_LOG model = new Mod_TMD_GPFY_LOG(); DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
protected void Button4_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtFYSJ.Text)) { string msg = "发运时间不能为空!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } var vUser = (NF.Framework.CurrentUser)HttpContext.Current.Session["CurrentUser"]; if (string.IsNullOrEmpty(lblmat.Text)) { string msg = "未选中发运单!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } string fydstr = hidCID.Text; //发运单号 string jz = hidJwgt.Text; //净重 string num = hidNum.Text; //数量 if (jz == null || jz == "") { string msg = "该发运单净重未导入!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } if (bll_Interface_WL.GetFYDZT(fydstr) != "7") { Query(); string msg = "该发运单未做实绩或发运单状态已改变!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } //decimal wgt = Convert.ToDecimal(jz) / Convert.ToDecimal(num); //DataTable dt = bll_TSC_SLAB_MAIN.GetListByFYDH(fydstr, "1", "", "", "", "", "", "").Tables[0]; //if (dt.Rows.Count != bll_TSC_SLAB_MAIN.GetJHCount(fydstr)) //{ // SJQuery(); // string msg = "异常!钢坯实绩数量与计划数量不符!"; // this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); // return; //} string filePath = "~/FileInterface/download/GPSJ" + fydstr + ".xml"; string xmlFileName = Server.MapPath(filePath); string message = bll_Interface_WL.SENDFYD(fydstr, xmlFileName);//待测试 if (message != "1") { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + message + "');</script>", false); return; } bll_TMD_DISPATCH.UPFYD("9", vUser.Id, vUser.Name, fydstr); for (int i = 0; i < rptList2.Items.Count; i++) { HtmlInputCheckBox chkMat_Code = (HtmlInputCheckBox)rptList2.Items[i].FindControl("cbsj"); if (chkMat_Code.Checked) { Literal lstcph = (Literal)rptList2.Items[i].FindControl("lstcph"); Literal lstfyid = (Literal)rptList2.Items[i].FindControl("lstfyid"); Literal lstfydh = (Literal)rptList2.Items[i].FindControl("lstfydh"); Literal lstQua = (Literal)rptList2.Items[i].FindControl("lstqua"); Literal lstSlabCode = (Literal)rptList2.Items[i].FindControl("lstck"); Literal lstStove = (Literal)rptList2.Items[i].FindControl("lststove"); Literal lstBatchNo = (Literal)rptList2.Items[i].FindControl("lstbatchNo"); Literal lstLevZh = (Literal)rptList2.Items[i].FindControl("lstzldj"); Literal lstGrd = (Literal)rptList2.Items[i].FindControl("lstgrd"); Literal lstStdCode = (Literal)rptList2.Items[i].FindControl("lststd"); Literal LstSpec = (Literal)rptList2.Items[i].FindControl("lstspec"); Mod_TMD_GPFY_LOG mod = new Mod_TMD_GPFY_LOG(); mod.C_EMP_ID = vUser.Account; mod.C_FYDH = lstfydh.Text; mod.C_LIC_PLA_NO = lstcph.Text; mod.C_TYPE = "发送NC"; bll_TMD_GPFY_LOG.Add(mod); } //else //{ // this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('未选中实绩行');</script>", false); // return; //} } this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('上传成功!');</script>", false); Query(); Detail(); SJQuery(); }
protected void btnFSSJ_Click1(object sender, EventArgs e) { if (string.IsNullOrEmpty(hidCID.Text)) { string msg = "未选中发运单!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } string itemid = ltlempid.Text; string fydstr = hidCID.Text; string num = hidNum.Text; string sjnum = hidSJSL.Text; if (bll_Interface_WL.GetFYDZT(fydstr) != "4") { string msg = "该发运单状态已变更!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); Query(); return; } if (sjnum == "") { sjnum = "0"; } int sjzs = 0; var list = new List <CommonKC>(); for (int i = 0; i < rptListRight.Items.Count; i++) { HtmlInputCheckBox chkMat_Code = (HtmlInputCheckBox)rptListRight.Items[i].FindControl("cbxselect"); TextBox lstSNum = (TextBox)rptListRight.Items[i].FindControl("lstSNum"); Literal lstQua = (Literal)rptListRight.Items[i].FindControl("lstQua"); Literal lstMatCode = (Literal)rptListRight.Items[i].FindControl("lstMatCode"); Literal lstSlabCode = (Literal)rptListRight.Items[i].FindControl("lstSlabCode"); Literal lstStove = (Literal)rptListRight.Items[i].FindControl("lstStove"); Literal lstBatchNo = (Literal)rptListRight.Items[i].FindControl("lstBatchNo"); Literal lstLevZh = (Literal)rptListRight.Items[i].FindControl("lstLevZh"); Literal lstGrd = (Literal)rptListRight.Items[i].FindControl("lstGrd"); Literal lstStdCode = (Literal)rptListRight.Items[i].FindControl("lstStdCode"); Literal LstSpec = (Literal)rptListRight.Items[i].FindControl("LstSpec"); Literal lstfydh = (Literal)rptListRight.Items[i].FindControl("lstfydh"); if (chkMat_Code.Checked) { int szs = bll_TSC_SLAB_MAIN.CKKC(lstMatCode.Text, lstSlabCode.Text, "", "", lstStove.Text, lstBatchNo.Text, lstLevZh.Text); if (int.Parse(lstQua.Text) != szs)//验证数量 { string msg = "批号:" + lstBatchNo.Text + "库存数量已变更!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } if (int.Parse(lstQua.Text) < int.Parse(lstSNum.Text)) { string msg = "数量超出请修改!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } sjzs += int.Parse(lstSNum.Text); list.Add(new CommonKC() { id = itemid, batch = lstBatchNo.Text, ck = lstSlabCode.Text, mat = lstMatCode.Text, num = int.Parse(lstSNum.Text), stove = lstStove.Text, zldj = lstLevZh.Text }); Mod_TMD_GPFY_LOG mod = new Mod_TMD_GPFY_LOG(); mod.C_BATCH_NO = lstBatchNo.Text; mod.C_EMP_ID = vUser.Account; mod.N_NUM = int.Parse(lstSNum.Text); mod.C_FYDH = fydstr; mod.C_LIC_PLA_NO = rptcph.Text; mod.C_SEND_STOCK = lstSlabCode.Text; mod.C_BZYQ = lstBatchNo.Text; mod.C_SPEC = LstSpec.Text; mod.C_STD_CODE = lstStdCode.Text; mod.C_STL_GRD = lstGrd.Text; mod.C_STOVE = lstStove.Text; mod.C_TYPE = "发送实绩"; mod.C_ZLDJ = lstLevZh.Text; bll_TMD_GPFY_LOG.Add(mod); } //else //{ // string msg = "未选中实绩行!"; // this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); // return; //} } if (bll_TMD_DISPATCH.UPFYD("", vUser.Id, vUser.Name, fydstr) != 1) { string msg = "变更发运单状态错误!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } if (bll_TSC_SLAB_MAIN.UPSLABSTATUS(list, fydstr, "1") != 1) { string msg = "实绩标记失败!"; this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('" + msg + "');</script>", false); return; } this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script language='javascript'> _closemsg('实绩标记成功!');</script>", false); //hidCID.Text = ""; //rptcph.Text = ""; //rptdqcph.Text = ""; Detail(); Query(); SJQuery(); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TMD_GPFY_LOG model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Mod_TMD_GPFY_LOG model) { return(dal.Add(model)); }
/// <summary> /// 得到一个对象实体 /// </summary> public Mod_TMD_GPFY_LOG DataRowToModel(DataRow row) { Mod_TMD_GPFY_LOG model = new Mod_TMD_GPFY_LOG(); if (row != null) { if (row["C_ID"] != null) { model.C_ID = row["C_ID"].ToString(); } if (row["C_FYDH"] != null) { model.C_FYDH = row["C_FYDH"].ToString(); } if (row["C_TYPE"] != null) { model.C_TYPE = row["C_TYPE"].ToString(); } if (row["C_EMP_ID"] != null) { model.C_EMP_ID = row["C_EMP_ID"].ToString(); } if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "") { model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString()); } if (row["N_NUM"] != null && row["N_NUM"].ToString() != "") { model.N_NUM = decimal.Parse(row["N_NUM"].ToString()); } if (row["N_WGT"] != null && row["N_WGT"].ToString() != "") { model.N_WGT = decimal.Parse(row["N_WGT"].ToString()); } if (row["C_SEND_STOCK"] != null) { model.C_SEND_STOCK = row["C_SEND_STOCK"].ToString(); } if (row["C_BATCH_NO"] != null) { model.C_BATCH_NO = row["C_BATCH_NO"].ToString(); } if (row["C_STOVE"] != null) { model.C_STOVE = row["C_STOVE"].ToString(); } if (row["C_STL_GRD"] != null) { model.C_STL_GRD = row["C_STL_GRD"].ToString(); } if (row["C_STD_CODE"] != null) { model.C_STD_CODE = row["C_STD_CODE"].ToString(); } if (row["C_SPEC"] != null) { model.C_SPEC = row["C_SPEC"].ToString(); } if (row["C_ZLDJ"] != null) { model.C_ZLDJ = row["C_ZLDJ"].ToString(); } if (row["C_BZYQ"] != null) { model.C_BZYQ = row["C_BZYQ"].ToString(); } if (row["C_LIC_PLA_NO"] != null) { model.C_LIC_PLA_NO = row["C_LIC_PLA_NO"].ToString(); } } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Mod_TMD_GPFY_LOG model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TMD_GPFY_LOG set "); strSql.Append("C_FYDH=:C_FYDH,"); strSql.Append("C_TYPE=:C_TYPE,"); strSql.Append("C_EMP_ID=:C_EMP_ID,"); strSql.Append("D_MOD_DT=:D_MOD_DT,"); strSql.Append("N_NUM=:N_NUM,"); strSql.Append("N_WGT=:N_WGT,"); strSql.Append("C_SEND_STOCK=:C_SEND_STOCK,"); strSql.Append("C_BATCH_NO=:C_BATCH_NO,"); strSql.Append("C_STOVE=:C_STOVE,"); strSql.Append("C_STL_GRD=:C_STL_GRD,"); strSql.Append("C_STD_CODE=:C_STD_CODE,"); strSql.Append("C_SPEC=:C_SPEC,"); strSql.Append("C_ZLDJ=:C_ZLDJ,"); strSql.Append("C_BZYQ=:C_BZYQ,"); strSql.Append("C_LIC_PLA_NO=:C_LIC_PLA_NO"); strSql.Append(" where C_ID=:C_ID "); OracleParameter[] parameters = { new OracleParameter(":C_FYDH", OracleDbType.Varchar2, 100), new OracleParameter(":C_TYPE", OracleDbType.Varchar2, 100), new OracleParameter(":C_EMP_ID", OracleDbType.Varchar2, 100), new OracleParameter(":D_MOD_DT", OracleDbType.Date), new OracleParameter(":N_NUM", OracleDbType.Decimal, 5), new OracleParameter(":N_WGT", OracleDbType.Decimal, 15), new OracleParameter(":C_SEND_STOCK", OracleDbType.Varchar2, 100), new OracleParameter(":C_BATCH_NO", OracleDbType.Varchar2, 100), new OracleParameter(":C_STOVE", OracleDbType.Varchar2, 100), new OracleParameter(":C_STL_GRD", OracleDbType.Varchar2, 100), new OracleParameter(":C_STD_CODE", OracleDbType.Varchar2, 100), new OracleParameter(":C_SPEC", OracleDbType.Varchar2, 100), new OracleParameter(":C_ZLDJ", OracleDbType.Varchar2, 100), new OracleParameter(":C_BZYQ", OracleDbType.Varchar2, 100), new OracleParameter(":C_LIC_PLA_NO", OracleDbType.Varchar2, 100), new OracleParameter(":C_ID", OracleDbType.Varchar2, 100) }; parameters[0].Value = model.C_FYDH; parameters[1].Value = model.C_TYPE; parameters[2].Value = model.C_EMP_ID; parameters[3].Value = model.D_MOD_DT; parameters[4].Value = model.N_NUM; parameters[5].Value = model.N_WGT; parameters[6].Value = model.C_SEND_STOCK; parameters[7].Value = model.C_BATCH_NO; parameters[8].Value = model.C_STOVE; parameters[9].Value = model.C_STL_GRD; parameters[10].Value = model.C_STD_CODE; parameters[11].Value = model.C_SPEC; parameters[12].Value = model.C_ZLDJ; parameters[13].Value = model.C_BZYQ; parameters[14].Value = model.C_LIC_PLA_NO; parameters[15].Value = model.C_ID; int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }