From 19b2931db4daa790c1fbffaa3edeec46eebafeae Mon Sep 17 00:00:00 2001 From: Ling0925 <2449858657a@gmail.com> Date: Thu, 23 May 2024 14:54:07 +0800 Subject: [PATCH] . --- newyt/Module_data/Picking_list.aspx.cs | 14 +- newyt/Module_data/Sample_browse.aspx.cs | 315 ++++++++++++----------- newyt/Module_data/WorkRecord_browse.aspx | 2 +- 3 files changed, 167 insertions(+), 164 deletions(-) diff --git a/newyt/Module_data/Picking_list.aspx.cs b/newyt/Module_data/Picking_list.aspx.cs index c5d16a2..960db11 100644 --- a/newyt/Module_data/Picking_list.aspx.cs +++ b/newyt/Module_data/Picking_list.aspx.cs @@ -52,12 +52,12 @@ public partial class Picking_list : System.Web.UI.Page wherecode += "id"; if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看全部")) { - wherecode += string.Format(" from view_nr_z_scdck where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck "+" where "+tiaojian+" 1=1 " + paixu + ")" + paixu, pg, pageitem); + wherecode += string.Format(" from view_nr_z_scdck where " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck " + " where " + tiaojian + " 1=1 " + paixu + ")" + paixu, pg, pageitem); } else if (DBHlper.GetPermission(zhanghao.juese, "生产领料记录", "nr_z_scdck", "查看个人")) { - wherecode += string.Format(" from view_nr_z_scdck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck "+" where "+tiaojian+" 1=1 " + paixu + ")" + paixu, pg, pageitem); + wherecode += string.Format(" from view_nr_z_scdck where jsr='" + zhanghao.zhanghao + "' and " + tiaojian + " id not in(select top ({0}*{1}) id from view_nr_z_scdck " + " where " + tiaojian + " 1=1 " + paixu + ")" + paixu, pg, pageitem); } DataTable dt_paixu = DBHlper.Execute(wherecode).Tables[0]; @@ -213,17 +213,18 @@ public partial class Picking_list : System.Web.UI.Page DateTime nowdt = DateTime.Now; int days = DateTime.DaysInMonth(nowdt.Year, selmonth); string yuechu = nowdt.Year + "-" + selmonth + "-" + "1"; - string yuemo = Convert.ToDateTime(nowdt.Year + "-" + selmonth + "-" +days).AddDays(1).ToString("yyyy-MM-dd"); + string yuemo = Convert.ToDateTime(nowdt.Year + "-" + selmonth + "-" + days).AddDays(1).ToString("yyyy-MM-dd"); DateTime yc = Convert.ToDateTime(yuechu); string cmd = ""; if (zt == "") { cmd = string.Format("select CONVERT(varchar(12),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' ", yuechu, yuemo); } - else { + else + { cmd = string.Format("select CONVERT(varchar(12),ckrq,111) as 'riqi' from view_nr_z_scdck where ckrq>='{0}' and ckrq<='{1}' and ckzt='{2}'", yuechu, yuemo, zt); } - + Maticsoft.Model.nr_z_yhzh yhzh = (Maticsoft.Model.nr_z_yhzh)Session["user"]; if (!DBHlper.GetPermission(yhzh.juese, "生产领料记录", "nr_z_scdck", "查看全部")) { @@ -332,7 +333,8 @@ public partial class Picking_list : System.Web.UI.Page { selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 and ckzt='" + drp_zt.Value + "'"; } - else { + else + { selectcode = "select " + colmn + " from view_nr_z_scdck where 1=1 "; } if (tj != "") diff --git a/newyt/Module_data/Sample_browse.aspx.cs b/newyt/Module_data/Sample_browse.aspx.cs index 272b620..076c8b3 100644 --- a/newyt/Module_data/Sample_browse.aspx.cs +++ b/newyt/Module_data/Sample_browse.aspx.cs @@ -11,9 +11,9 @@ using Ajax; public partial class Sample_browse : System.Web.UI.Page { //创建一个操作记录bll - Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi(); + Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi(); //创建一个共同的申购单bll - Maticsoft.BLL.nr_z_ypdj ypdjbll = new Maticsoft.BLL.nr_z_ypdj(); + Maticsoft.BLL.nr_z_ypdj ypdjbll = new Maticsoft.BLL.nr_z_ypdj(); //创建一个操作记录模板 Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi(); //创建一个共用的编码bll层 @@ -30,19 +30,19 @@ public partial class Sample_browse : System.Web.UI.Page Response.Redirect("../index.aspx"); } //获取角色权限 - Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); + Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0) { string uid = Request.QueryString["uid"].ToString(); id.Value = uid; initdata(Convert.ToInt32(uid)); - pdquanxian(user.juese); - } - getqdgj(); - getxmxx(); - getxgfyxx(); - getscyl(); - getcpxmxx(); + pdquanxian(user.juese); + } + getqdgj(); + getxmxx(); + getxgfyxx(); + getscyl(); + getcpxmxx(); } } @@ -85,15 +85,15 @@ public partial class Sample_browse : System.Web.UI.Page { Response.Redirect("../Common/nopower.htm"); } - + if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "编辑全部")) { bt_bj.Visible = true; - } + } if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "删除全部")) { - shanchu.Visible = true; + shanchu.Visible = true; } if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "前段签字")) @@ -114,9 +114,10 @@ public partial class Sample_browse : System.Web.UI.Page { bt_hdsh.Visible = true; - } if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "生成产品")) + } + if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "生成产品")) { - bt_sccpda.Visible = true; + bt_sccpda.Visible = true; } if (DBHlper.GetPermission(juese, "样品登记", "nr_z_ypdj", "打印")) { @@ -127,142 +128,142 @@ public partial class Sample_browse : System.Web.UI.Page bt_shtg.Visible = true; bt_shbg.Visible = true; } - if(zhuangtai.Text=="通过") + if (zhuangtai.Text == "通过") { bt_shtg.Enabled = false; - bt_shtg.BackColor = System.Drawing.Color.Gray; + bt_shtg.BackColor = System.Drawing.Color.Gray; bt_bj.Enabled = false; - bt_bj.BackColor = System.Drawing.Color.Gray; + bt_bj.BackColor = System.Drawing.Color.Gray; shanchu.Enabled = false; shanchu.BackColor = System.Drawing.Color.Gray; - } + } if (zhuangtai.Text == "不过") { bt_shbg.Enabled = false; bt_shbg.BackColor = System.Drawing.Color.Gray; - + } - if(zhuangtai.Text!="通过") + if (zhuangtai.Text != "通过") { - bt_sccpda.Enabled = false; + bt_sccpda.Enabled = false; bt_sccpda.BackColor = System.Drawing.Color.Gray; } - + } #endregion - - + + #region 加载工价信息 private void getqdgj() { //加载前段工价 - string qdgjstring = ""; - string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'"; - DataSet ds=DBHlper.Execute(getgjsql); - //判断拼接列值,根据值更改前台样式 + string qdgjstring = "
"; + string getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='前段工价'"; + DataSet ds = DBHlper.Execute(getgjsql); + //判断拼接列值,根据值更改前台样式 int lies = 0; - if (ds != null && ds.Tables[0].Rows.Count > 0) - { + if (ds != null && ds.Tables[0].Rows.Count > 0) + { - foreach(DataRow r in ds.Tables[0].Rows) - { - if (lies == 0) - { - qdgjstring += ""; - } - qdgjstring += ""; - lies = lies + 1; - if (lies == 7) - { - lies = 0; - qdgjstring += ""; - } - } - if (7 - lies > 0 && lies > 0) - { - for (int x = 0; x < 7 - lies;x++ ) - { - qdgjstring += " "; - } - qdgjstring +=""; - } + foreach (DataRow r in ds.Tables[0].Rows) + { + if (lies == 0) + { + qdgjstring += ""; + } + qdgjstring += ""; + lies = lies + 1; + if (lies == 7) + { + lies = 0; + qdgjstring += ""; + } + } + if (7 - lies > 0 && lies > 0) + { + for (int x = 0; x < 7 - lies; x++) + { + qdgjstring += " "; + } + qdgjstring += ""; + } - } - qdgjxx.InnerHtml = qdgjstring+"
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
"; + } + qdgjxx.InnerHtml = qdgjstring + ""; - //中段工价 + //中段工价 qdgjstring = ""; getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='中段工价'"; ds = DBHlper.Execute(getgjsql); - //判断拼接列值,根据值更改前台样式 - lies = 0; - if (ds != null && ds.Tables[0].Rows.Count > 0) - { + //判断拼接列值,根据值更改前台样式 + lies = 0; + if (ds != null && ds.Tables[0].Rows.Count > 0) + { - foreach (DataRow r in ds.Tables[0].Rows) - { - if (lies == 0) - { - qdgjstring += ""; - } - qdgjstring += ""; - lies = lies + 1; - if (lies == 7) - { - lies = 0; - qdgjstring += ""; - } - } - if (7 - lies > 0 && lies > 0) - { - for (int x = 0; x < 7 - lies; x++) - { - qdgjstring += " "; - } - qdgjstring += ""; - } + foreach (DataRow r in ds.Tables[0].Rows) + { + if (lies == 0) + { + qdgjstring += ""; + } + qdgjstring += ""; + lies = lies + 1; + if (lies == 7) + { + lies = 0; + qdgjstring += ""; + } + } + if (7 - lies > 0 && lies > 0) + { + for (int x = 0; x < 7 - lies; x++) + { + qdgjstring += " "; + } + qdgjstring += ""; + } - } - zdgjxx.InnerHtml = qdgjstring + "
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
"; + } + zdgjxx.InnerHtml = qdgjstring + ""; - //后段工价 - qdgjstring = ""; - getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='后段工价'"; - ds = DBHlper.Execute(getgjsql); - //判断拼接列值,根据值更改前台样式 - lies = 0; - if (ds != null && ds.Tables[0].Rows.Count > 0) - { + //后段工价 + qdgjstring = "
"; + getgjsql = "select * from nr_z_ypdj_gj where ypdid='" + id.Value + "' and jieduan='后段工价'"; + ds = DBHlper.Execute(getgjsql); + //判断拼接列值,根据值更改前台样式 + lies = 0; + if (ds != null && ds.Tables[0].Rows.Count > 0) + { - foreach (DataRow r in ds.Tables[0].Rows) - { - if (lies == 0) - { - qdgjstring += ""; - } - qdgjstring += ""; - lies = lies + 1; - if (lies == 7) - { - lies = 0; - qdgjstring += ""; - } - } - if (7 - lies > 0 && lies > 0) - { - for (int x = 0; x < 7 - lies; x++) - { - qdgjstring += " "; - } - qdgjstring += ""; - } + foreach (DataRow r in ds.Tables[0].Rows) + { + if (lies == 0) + { + qdgjstring += ""; + } + qdgjstring += ""; + lies = lies + 1; + if (lies == 7) + { + lies = 0; + qdgjstring += ""; + } + } + if (7 - lies > 0 && lies > 0) + { + for (int x = 0; x < 7 - lies; x++) + { + qdgjstring += " "; + } + qdgjstring += ""; + } - } - hdgjxx.InnerHtml = qdgjstring + "
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
" + r["gjmc"].ToString() + ": " + Convert.ToDouble(r["gjjg"]).ToString() + "
"; + } + hdgjxx.InnerHtml = qdgjstring + ""; } #endregion @@ -286,7 +287,7 @@ public partial class Sample_browse : System.Web.UI.Page } qdgjstring += "" + r["xmmc"].ToString() + " " + r["wlmc"].ToString() + "" + Convert.ToDouble(r["wlyl"]).ToString() + ""; lies = lies + 1; - if (lies ==3) + if (lies == 3) { lies = 0; qdgjstring += ""; @@ -329,7 +330,7 @@ public partial class Sample_browse : System.Web.UI.Page } if (3 - lies > 0 && lies > 0) { - for (int x = 0; x <3- lies; x++) + for (int x = 0; x < 3 - lies; x++) { qdgjstring += ""; } @@ -380,7 +381,7 @@ public partial class Sample_browse : System.Web.UI.Page { //加载前段工价 string qdgjstring = ""; - string getgjsql = "select * from nr_z_ypdj_xgfy where ypdid='"+id.Value+"'"; + string getgjsql = "select * from nr_z_ypdj_xgfy where ypdid='" + id.Value + "'"; DataSet ds = DBHlper.Execute(getgjsql); //判断拼接列值,根据值更改前台样式 int lies = 0; @@ -408,11 +409,11 @@ public partial class Sample_browse : System.Web.UI.Page qdgjstring += " "; } qdgjstring += ""; - } + } } xgfydiv.InnerHtml = qdgjstring + "
"; } - #endregion + #endregion #region 加载水彩信息 private void getscyl() { @@ -425,7 +426,7 @@ public partial class Sample_browse : System.Web.UI.Page { int sjint = 0; int hcount = 1; - foreach(DataRow r in ds.Tables[0].Rows) + foreach (DataRow r in ds.Tables[0].Rows) { if (sjint == 0) { @@ -438,20 +439,20 @@ public partial class Sample_browse : System.Web.UI.Page cltable += ""; } hcount = hcount + 1; - } - if(3-sjint>0) + } + if (3 - sjint > 0) { - for (int hz = 0; hz < 3 - sjint;hz++) + for (int hz = 0; hz < 3 - sjint; hz++) { cltable += " "; } cltable += ""; } - + } cltable += ""; scylxxdiv.InnerHtml = cltable; - + } #endregion #region 获取页面参数赋值model对象 @@ -520,10 +521,10 @@ public partial class Sample_browse : System.Web.UI.Page public int savegx(string[] gx, string djid, string xmjd) { int fhz = 0; - DBHlper.excutecmd("delete from nr_z_ypdj_cpxgxm where xmjd='" + xmjd+"'"); + DBHlper.excutecmd("delete from nr_z_ypdj_cpxgxm where xmjd='" + xmjd + "'"); foreach (string i in gx) { - fhz=DBHlper.excutecmd("insert into nr_z_ypdj_cpxgxm(kfid,xmmc,xmjd) values(" + djid + ",'" + i + "','" + xmjd + "')"); + fhz = DBHlper.excutecmd("insert into nr_z_ypdj_cpxgxm(kfid,xmmc,xmjd) values(" + djid + ",'" + i + "','" + xmjd + "')"); } return fhz; } @@ -565,7 +566,7 @@ public partial class Sample_browse : System.Web.UI.Page if (ypdjbll.Delete(Convert.ToInt32(id.Value))) { - DBHlper.excutecmd(" delete nr_z_ypdj_gj where ypdid='"+id.Value+"'"); + DBHlper.excutecmd(" delete nr_z_ypdj_gj where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_scyl where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_xgfy where ypdid='" + id.Value + "'"); DBHlper.excutecmd(" delete nr_z_ypdj_xmxx where ypdid='" + id.Value + "'"); @@ -582,14 +583,14 @@ public partial class Sample_browse : System.Web.UI.Page { getmd(); Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"]; - string sqldj = "update nr_z_ypdj set qdqz='"+zh.zhanghao+"' where id='"+id.Value+"'"; + string sqldj = "update nr_z_ypdj set qdqz='" + zh.zhanghao + "' where id='" + id.Value + "'"; int fzhi = DBHlper.excutecmd(sqldj); - if(fzhi>0) + if (fzhi > 0) { - rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim(); - rizhi.yonghuming = zh.zhanghao; - rizhibll.Add(rizhi); - Response.Redirect("Sample_browse.aspx?uid=" + id.Value); + rizhi.jilu = zh.zhanghao + "进行了前段签字,开发号为:" + kfh.Text.Trim(); + rizhi.yonghuming = zh.zhanghao; + rizhibll.Add(rizhi); + Response.Redirect("Sample_browse.aspx?uid=" + id.Value); } } protected void bt_zdsh_Click(object sender, EventArgs e) @@ -647,33 +648,33 @@ public partial class Sample_browse : System.Web.UI.Page rizhibll.Add(rizhi); Response.Redirect("Sample_browse.aspx?uid=" + id.Value); } - } + } protected void bt_sccpda_Click(object sender, EventArgs e) { Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); - string cpbh = DBHlper.getbh("CP-", "nr_z_cpkc", "cpbh", 4); - string ypdcpjsql = "insert into nr_z_cpkc(cpbh,cpmc,riqi,gg,zhongliang,tiji,dj,jsr,tp)select '"+cpbh+"',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "',ypcc,zhongl,rongl,'0','" + user.zhanghao + "',tupian from nr_z_ypdj where id='" + id.Value + "';SELECT id from nr_z_cpkc WHERE (id = @@IDENTITY)"; - int getcpz=DBHlper.ExecuteReid(ypdcpjsql); - if (getcpz > 0) - { - string getxmsql = "select * from nr_z_ypdj_cpxgxm "; - DataSet ds= DBHlper.Execute(getxmsql); - if (ds != null && ds.Tables[0].Rows.Count > 0) - { - foreach( DataRow r in ds.Tables[0].Rows) - { - int xmz = DBHlper.excutecmd("insert into nr_z_cpkc_wlxq(cpid,xmmc,wlbh,xqyl) select '" + getcpz + "',xmmc,wlbh,wlyl from nr_z_ypdj_xmxx where xmmc='" + r["xmmc"] + "' and ypdid='" + id.Value + "'"); - - } - } - int scfhz= DBHlper.excutecmd("insert into nr_z_cpkc_scyl(cpid,scwlbh,scyl,beizhu) select '"+getcpz+"',scwlbh,scyl,beizhu from nr_z_ypdj_scyl where ypdid='" + id.Value + "'"); + string cpbh = DBHlper.getbh("CP-", "nr_z_cpkc", "cpbh", 4); + string ypdcpjsql = "insert into nr_z_cpkc(cpbh,cpmc,riqi,gg,zhongliang,tiji,dj,jsr,tp)select '" + cpbh + "',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "',ypcc,zhongl,rongl,'0','" + user.zhanghao + "',tupian from nr_z_ypdj where id='" + id.Value + "';SELECT id from nr_z_cpkc WHERE (id = @@IDENTITY)"; + int getcpz = DBHlper.ExecuteReid(ypdcpjsql); + if (getcpz > 0) + { + string getxmsql = "select * from nr_z_ypdj_cpxgxm "; + DataSet ds = DBHlper.Execute(getxmsql); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + foreach (DataRow r in ds.Tables[0].Rows) + { + int xmz = DBHlper.excutecmd("insert into nr_z_cpkc_wlxq(cpid,xmmc,wlbh,xqyl) select '" + getcpz + "',xmmc,wlbh,wlyl from nr_z_ypdj_xmxx where xmmc='" + r["xmmc"] + "' and ypdid='" + id.Value + "'"); + + } + } + int scfhz = DBHlper.excutecmd("insert into nr_z_cpkc_scyl(cpid,scwlbh,scyl,beizhu) select '" + getcpz + "',scwlbh,scyl,beizhu from nr_z_ypdj_scyl where ypdid='" + id.Value + "'"); - int scmjz = DBHlper.excutecmd("insert into nr_z_mjda (mjdm,mjmc,riqi,beizhu) select '" + DBHlper.getbh("MJ-", "nr_z_mjda", "mjdm", 4) + "',cpmc,'"+DateTime.Now.ToString("yyyy-MM-dd")+"','' from nr_z_ypdj where id='" + id.Value + "'"); + int scmjz = DBHlper.excutecmd("insert into nr_z_mjda (mjdm,mjmc,riqi,beizhu) select '" + DBHlper.getbh("MJ-", "nr_z_mjda", "mjdm", 4) + "',cpmc,'" + DateTime.Now.ToString("yyyy-MM-dd") + "','' from nr_z_ypdj where id='" + id.Value + "'"); - int ypgjz = DBHlper.excutecmd("insert into dbo.nr_z_cpkc_gj(cpid,gjmc,gjjg) select '" + getcpz+ "',gjmc,gjjg from nr_z_ypdj_gj where ypdid='" + id.Value + "'"); + int ypgjz = DBHlper.excutecmd("insert into dbo.nr_z_cpkc_gj(cpid,gjmc,gjjg) select '" + getcpz + "',gjmc,gjjg from nr_z_ypdj_gj where ypdid='" + id.Value + "'"); - Response.Redirect("Product_browse.aspx?uid=" + getcpz); - } + Response.Redirect("Product_browse.aspx?uid=" + getcpz); + } } } \ No newline at end of file diff --git a/newyt/Module_data/WorkRecord_browse.aspx b/newyt/Module_data/WorkRecord_browse.aspx index 728472e..ab2ae18 100644 --- a/newyt/Module_data/WorkRecord_browse.aspx +++ b/newyt/Module_data/WorkRecord_browse.aspx @@ -254,7 +254,7 @@ - +