diff --git a/newyt/Common/wxfk_dy.aspx.cs b/newyt/Common/wxfk_dy.aspx.cs
index 34e4b5b..8be91cb 100644
--- a/newyt/Common/wxfk_dy.aspx.cs
+++ b/newyt/Common/wxfk_dy.aspx.cs
@@ -27,40 +27,48 @@ public partial class Common_wxfk_dy : System.Web.UI.Page
[Ajax.AjaxMethod]
public string[] getxinxi(int[] zu)
{
- string[]code =new string[2];
+ string[] code = new string[2];
string code1 = "";
string khname = "";
- foreach (int i in zu)
+ try
{
- DataSet ds = DBHlper.Execute("select *,(SELECT ISNULL(SUM(wxfyze), 0) FROM dbo.view_nr_z_ddwxd WHERE (wxdh=view_nr_z_wxfk.wxdh)) as zje from view_nr_z_wxfk where id='" + i + "' order by id ");
- if (ds != null && ds.Tables[0].Rows.Count > 0)
+ foreach (int i in zu)
{
- //如果当前订单下存在明细就加载成tr行
- foreach (DataRow r in ds.Tables[0].Rows)
+ DataSet ds = DBHlper.Execute("select *,(SELECT ISNULL(SUM(wxfyze), 0) FROM dbo.view_nr_z_ddwxd WHERE (wxdh=view_nr_z_wxfk.wxdh)) as zje from view_nr_z_wxfk where id='" + i + "' order by id ");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
{
- khname = r["mingcheng"].ToString();
- code1 += "
diff --git a/newyt/Module_data/Dispatch_Form.aspx.cs b/newyt/Module_data/Dispatch_Form.aspx.cs
index 3f8b459..2662825 100644
--- a/newyt/Module_data/Dispatch_Form.aspx.cs
+++ b/newyt/Module_data/Dispatch_Form.aspx.cs
@@ -9,17 +9,17 @@ using System.Data;
using System.Data.SqlClient;
using Ajax;
public partial class Dispatch_Form : CommonPage
-{
+{
//创建一个共用的生产单bll层
Maticsoft.BLL.nr_z_scd scdbll = new Maticsoft.BLL.nr_z_scd();
//创建一个共用的生产单模板
- Maticsoft.Model.nr_z_scd scd = new Maticsoft.Model.nr_z_scd();
+ Maticsoft.Model.nr_z_scd scd = new Maticsoft.Model.nr_z_scd();
//创建一个操作项目bll
Maticsoft.BLL.nr_z_scd_cp scdcpbll = new Maticsoft.BLL.nr_z_scd_cp();
//创建一个操作记录模板
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
//创建一个操作记录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_sys_bianma bm = new Maticsoft.BLL.nr_sys_bianma();
//创建一个共用的类型BLL层
@@ -37,24 +37,24 @@ public partial class Dispatch_Form : CommonPage
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
binddata();
if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0)
- {
+ {
string uid = Request.QueryString["uid"].ToString();
- id.Value = uid;
+ id.Value = uid;
initdata(uid);
updatewlxx(Convert.ToInt32(uid));
}
else if (Request.QueryString["jsxmid"] != null && Request.QueryString["jsxmid"].ToString().Length > 0)
- {
+ {
jssccpxx();
}
-
+
}
}
#region 获取页面参数赋值model对象
private void getmd()
- {
+ {
scd.sclx = sclx.Text;
scd.xdrq = Convert.ToDateTime(xdrq.Value);
scd.wgrq = Convert.ToDateTime(wgrq.Value);
@@ -71,20 +71,20 @@ public partial class Dispatch_Form : CommonPage
#region 获取真正数据值
private void initdata(string did)
{
- DataSet scdds=DBHlper.Execute("select * from view_nr_z_scd where id='" + did + "'");
- if (scdds != null && scdds.Tables[0].Rows.Count > 0)
- {
- bh.Value = scdds.Tables[0].Rows[0]["bh"].ToString();
- sclx.Text = scdds.Tables[0].Rows[0]["sclx"].ToString();
- xdrq.Value = Convert.ToDateTime(scdds.Tables[0].Rows[0]["xdrq"]).ToString("yyyy-MM-dd");
- wgrq.Value = Convert.ToDateTime(scdds.Tables[0].Rows[0]["wgrq"]).ToString("yyyy-MM-dd");
- ywy.Value = scdds.Tables[0].Rows[0]["kdr"].ToString();
- ddbz.Value = scdds.Tables[0].Rows[0]["bz"].ToString();
- }
+ DataSet scdds = DBHlper.Execute("select * from view_nr_z_scd where id='" + did + "'");
+ if (scdds != null && scdds.Tables[0].Rows.Count > 0)
+ {
+ bh.Value = scdds.Tables[0].Rows[0]["bh"].ToString();
+ sclx.Text = scdds.Tables[0].Rows[0]["sclx"].ToString();
+ xdrq.Value = Convert.ToDateTime(scdds.Tables[0].Rows[0]["xdrq"]).ToString("yyyy-MM-dd");
+ wgrq.Value = Convert.ToDateTime(scdds.Tables[0].Rows[0]["wgrq"]).ToString("yyyy-MM-dd");
+ ywy.Value = scdds.Tables[0].Rows[0]["kdr"].ToString();
+ ddbz.Value = scdds.Tables[0].Rows[0]["bz"].ToString();
+ }
}
#endregion
- string cpmxstring = "";
+ string cpmxstring = "";
#region 接收生产单项目
private void jssccpxx()
{
@@ -92,15 +92,16 @@ public partial class Dispatch_Form : CommonPage
string biao = "
"
+ "
单据编号
客户编号
产品货号
"
+ "
产品名称
种类
特殊工艺
订单数量
"
- + "
提取库存数量
生产数量
交货日期
"
+ //+ "
提取库存数量
"
+ + "
生产数量
交货日期
"
+ "
备注
";
- DataSet jsds=DBHlper.Execute("select * from view_nr_z_scdjs_tccp where id in (" + Request.QueryString["jsxmid"].ToString()+")");
- foreach(DataRow r in jsds.Tables[0].Rows )
+ DataSet jsds = DBHlper.Execute("select * from view_nr_z_scdjs_tccp where id in (" + Request.QueryString["jsxmid"].ToString() + ")");
+ foreach (DataRow r in jsds.Tables[0].Rows)
{
if (r["mxlx"].ToString() == "产品")
{
//为保证唯一性,获取id拼接,保证稳定性
- string hcount = "cp"+r["id"].ToString();
+ string hcount = "cp" + r["id"].ToString();
biao += "
"
+ "
"
+ "
"
@@ -109,15 +110,15 @@ public partial class Dispatch_Form : CommonPage
+ "
";
DataSet ds = DBHlper.Execute("select * from view_nr_z_allscdxm where scdid='" + scdid + "' order by id ");
@@ -184,10 +192,11 @@ public partial class Dispatch_Form : CommonPage
//如果当前订单下存在明细就加载成tr行
foreach (DataRow r in ds.Tables[0].Rows)
{
- DataSet tqds=DBHlper.Execute("select * from nr_z_scd_cp_tqkc where xmid='" + r["id"] + "'");
- string dqxmid="";
- string tqxxst="";
- if(tqds!=null&&tqds.Tables[0].Rows.Count>0){
+ DataSet tqds = DBHlper.Execute("select * from nr_z_scd_cp_tqkc where xmid='" + r["id"] + "'");
+ string dqxmid = "";
+ string tqxxst = "";
+ if (tqds != null && tqds.Tables[0].Rows.Count > 0)
+ {
dqxmid = tqds.Tables[0].Rows[0]["id"].ToString();
tqxxst = tqds.Tables[0].Rows[0]["tptqsl"].ToString() + "," + tqds.Tables[0].Rows[0]["sptqsl"].ToString() + "," + tqds.Tables[0].Rows[0]["bdtqsl"].ToString();
}
@@ -201,19 +210,19 @@ public partial class Dispatch_Form : CommonPage
+ "
"
+ "
"
+ "
"
- + "
"
+ //+ "
"
+ "
"
+ "
"
+ "
";
}
}
- cpxx.InnerHtml = biao + "
";
+ cpxx.InnerHtml = biao + "";
}
#endregion
#region 用来初始化绑定下拉框等值
private void binddata()
- {
+ {
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
ywy.Value = zh.zhanghao;
xdrq.Value = DateTime.Now.ToString("yyyy-MM-dd");
@@ -259,26 +268,26 @@ public partial class Dispatch_Form : CommonPage
public string hqyscpscfs()
{
string cpxmscfs = "";
- DataSet hylx = bmlx.GetAllList();
- DataRow[] dr = hylx.Tables[0].Select("leixing='特殊工艺'");
- if (dr != null && dr.Length > 0)
- {
- DataSet hy = bm.GetList("zhongleiid='" + dr[0]["id"] + "'");
+ //DataSet hylx = bmlx.GetAllList();
+ //DataRow[] dr = hylx.Tables[0].Select("leixing='特殊工艺'");
+ //if (dr != null && dr.Length > 0)
+ //{
+ // DataSet hy = bm.GetList("zhongleiid='" + dr[0]["id"] + "'");
- if (hy != null)
- {
- foreach (DataRow r in hy.Tables[0].Rows)
- {
- cpxmscfs += "";
+ // if (hy != null)
+ // {
+ // foreach (DataRow r in hy.Tables[0].Rows)
+ // {
+ // cpxmscfs += "";
- }
- }
- }
- else
- {
- cpxmscfs += "";
+ // }
+ // }
+ //}
+ //else
+ //{
+ // cpxmscfs += "";
- }
+ //}
return cpxmscfs;
}
@@ -324,16 +333,16 @@ public partial class Dispatch_Form : CommonPage
{
try
{
- string caozuo = "添加";
-
+ string caozuo = "添加";
+
//接收成功参数值
- int rtx = 0;
+ int rtx = 0;
//判断uid是否存在值,有值为修改,无值为添加
if (id.Value != null && id.Value != "")
{
scd = scdbll.GetModel(Convert.ToInt32(id.Value));
getmd();
- caozuo = "修改";
+ caozuo = "修改";
scd.id = Convert.ToInt32(id.Value);
if (scdbll.Update(scd))
{
@@ -360,26 +369,26 @@ public partial class Dispatch_Form : CommonPage
foreach (Maticsoft.Model.nr_z_scd_cp x in sccpxmds)
{
ci = ci + 1;
- int cpxmid=0;
+ int cpxmid = 0;
x.scdid = Convert.ToInt32(rtx);
//判断如果存在id的时候且是修改操作时
if (x.id > 0 && Request.QueryString["uid"] != null)
{
scdcpbll.Update(x);
deletecmd += " and id !=" + x.id;
- cpxmid=x.id;
+ cpxmid = x.id;
}
else
{
int mxid = scdcpbll.Add(x);
deletecmd += " and id !=" + mxid;
- cpxmid=mxid;
+ cpxmid = mxid;
}
- if (x.tqkc !=0)
+ if (x.tqkc != 0)
{
- int tqrt=DBHlper.excutecmd("update nr_z_scd_cp_tqkc set xmid='" + cpxmid + "' where id='"+x.tqkc+"'");
- }
+ int tqrt = DBHlper.excutecmd("update nr_z_scd_cp_tqkc set xmid='" + cpxmid + "' where id='" + x.tqkc + "'");
+ }
}
DBHlper.excutecmd(deletecmd);
@@ -387,7 +396,7 @@ public partial class Dispatch_Form : CommonPage
catch
{
Response.Write("");
- }
+ }
//将session转换对象取值
Maticsoft.Model.nr_z_yhzh zh = (Maticsoft.Model.nr_z_yhzh)Session["user"];
@@ -409,7 +418,7 @@ public partial class Dispatch_Form : CommonPage
Response.Redirect("../Common/error.aspx");
}
- }
+ }
[Ajax.AjaxMethod]
public string getcpkc(string cphh)
{
@@ -429,7 +438,7 @@ public partial class Dispatch_Form : CommonPage
public string getxmyt(string ytxmid)
{
string code = "";
- DataSet ds = DBHlper.Execute("select tptqsl,sptqsl,bdtqsl from nr_z_scd_cp_tqkc where id='"+ytxmid+"'");
+ DataSet ds = DBHlper.Execute("select tptqsl,sptqsl,bdtqsl from nr_z_scd_cp_tqkc where id='" + ytxmid + "'");
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
code = ds.Tables[0].Rows[0]["tptqsl"].ToString() + "&" + ds.Tables[0].Rows[0]["sptqsl"].ToString() + "&" + ds.Tables[0].Rows[0]["bdtqsl"].ToString();
@@ -441,17 +450,17 @@ public partial class Dispatch_Form : CommonPage
return code;
}
[Ajax.AjaxMethod]
- public int settqsl(string tpsl,string spsl,string bdsl,string cphh)
+ public int settqsl(string tpsl, string spsl, string bdsl, string cphh)
{
int code = DBHlper.ExecuteReid("insert into nr_z_scd_cp_tqkc(xmid,tptqsl,sptqsl,bdtqsl,cphh) values ('0','" + tpsl + "','" + spsl + "','" + bdsl + "','" + cphh + "');SELECT id from nr_z_scd_cp_tqkc WHERE (id = @@IDENTITY)");
return code;
}
- [Ajax.AjaxMethod]
+ [Ajax.AjaxMethod]
public int deletetqlc(string tqid)
{
int gshrt = DBHlper.excutecmd("delete nr_z_scd_cp_tqkc where id='" + tqid + "'");
- return gshrt;
+ return gshrt;
}
}
\ No newline at end of file
diff --git a/newyt/Module_data/Dispatch_browse.aspx.cs b/newyt/Module_data/Dispatch_browse.aspx.cs
index cfeec74..d041e4e 100644
--- a/newyt/Module_data/Dispatch_browse.aspx.cs
+++ b/newyt/Module_data/Dispatch_browse.aspx.cs
@@ -130,7 +130,8 @@ public partial class Dispatch_browse : CommonPage
string biao = "
"
+ "
单据编号
客户编号
产品货号
"
+ "
产品名称
种类
特殊工艺
订单数量
"
- + "
提取库存数量
生产数量
交货日期
"
+ //+ "
提取库存数量
"
+ + "
生产数量
交货日期
"
+ "
备注
";
//查询数据视图,获取当前订单下的所有明细
DataSet ds = DBHlper.Execute("select * from nr_z_scd_cp where scdid='" + scdid + "' order by id ");
@@ -152,7 +153,7 @@ public partial class Dispatch_browse : CommonPage
+ "