using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Ajax; public partial class Common_wxd_dy : System.Web.UI.Page { //创建一个共用的外协单bll层 Maticsoft.BLL.nr_z_ddwxd wxdbll = new Maticsoft.BLL.nr_z_ddwxd(); //创建一个共用的外协单模板 Maticsoft.Model.nr_z_ddwxd wxdmodel = new Maticsoft.Model.nr_z_ddwxd(); //创建一个共用的订单bll层 Maticsoft.BLL.nr_z_dd ddbll = new Maticsoft.BLL.nr_z_dd(); public string userinfo = ""; protected void Page_Load(object sender, EventArgs e) { Utility.RegisterTypeForAjax(typeof(Common_wxd_dy)); if (!IsPostBack) { if (Session["user"] == null) { Response.Redirect("../index.aspx"); } Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); string uid = Request["uid"].ToString(); initdata(uid); setwxxm(uid); DataSet gsdt = DBHlper.Execute("select * from nr_sysuserinfo"); } DataTable dtuserinfo = DBHlper.Execute("select mingcheng,logourl from nr_sysuserinfo").Tables[0]; userinfo = dtuserinfo.Rows[0]["mingcheng"].ToString(); if (dtuserinfo.Rows.Count > 0) { img_logo.Src = "../UseFile/" + dtuserinfo.Rows[0]["logourl"].ToString(); } else { img_logo.Visible = false; } } #region 修改时添加项目 private void setwxxm(string wxid) { //修改页面时,首先吧项目明细的表头加载出来 string biao = "" + "" + " " + " " + ""; DataSet xmds = DBHlper.Execute("select * from dbo.nr_z_ddwxd_xm where wxid='" + wxid + "'"); foreach (DataRow r in xmds.Tables[0].Rows) { //为保证唯一性,获取id拼接,保证稳定性 string hcount = r["id"].ToString(); biao += " " + "" + "" + "" + "" + "" + "" + "" + " " + ""; } wxxx.InnerHtml = biao + "
生产编号客户编号产品货号产品名称种类 烧成方式外发数量交货日期备注
" + r["scdh"] + "" + r["khbh"] + "" + r["cphh"] + "" + r["cpmc"] + "" + r["cpzl"] + "" + r["scfs"] + "" + r["wfsl"] + "" + Convert.ToDateTime(r["jhrq"]).ToString("yyyy-MM-dd") + "" + r["bz"] + "
"; } #endregion #region 获取真正数据值 private void initdata(string sid) { DataTable wxtable = DBHlper.Execute("select * from view_nr_z_ddwxd where id="+sid).Tables[0]; wxdh.Text = wxtable.Rows[0]["wxdh"].ToString(); wxdw.Text = wxtable.Rows[0]["mingcheng"].ToString(); wdrq.Text = Convert.ToDateTime(wxtable.Rows[0]["fdrq"]).ToString("yyyy-MM-dd"); var sumje=DBHlper.getfirstcolmn("select sum(fyje) from nr_z_ddwxd_fy where wxdid=" + sid); je.Text = sumje; zlyq.Text = wxtable.Rows[0]["zlyq"].ToString(); bz.Text = wxtable.Rows[0]["bz"].ToString(); kdr.Text = wxtable.Rows[0]["kdr"].ToString(); shr.Text = wxtable.Rows[0]["shr"].ToString(); } #endregion }