using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class DispatchPrint : System.Web.UI.Page { //创建一个共用的订单bll层 Maticsoft.BLL.nr_z_dd ddbll = new Maticsoft.BLL.nr_z_dd(); //创建一个共用的订单模板 Maticsoft.Model.nr_z_dd dd = new Maticsoft.Model.nr_z_dd(); //创建一个共用的客户bll层 Maticsoft.BLL.nr_z_kehu kehubll = new Maticsoft.BLL.nr_z_kehu(); //创建一个操作记录模板 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(); public string userinfo = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dtuserinfo = DBHlper.Execute("select mingcheng,logourl from nr_sysuserinfo").Tables[0]; if (dtuserinfo.Rows.Count > 0) { userinfo = dtuserinfo.Rows[0]["mingcheng"].ToString(); img_logo.Src = "../UseFile/" + dtuserinfo.Rows[0]["logourl"].ToString(); } else { img_logo.Visible = false; } if (Session["user"] == null) { Response.Redirect("../index.aspx"); } Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); if (Request.QueryString["uid"] != null && Request.QueryString["uid"] != "") { id.Value = Request.QueryString["uid"].ToString(); } initdata(id.Value); getsccpxm(Convert.ToInt32(id.Value)); } } #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.Text = scdds.Tables[0].Rows[0]["bh"].ToString(); sclx.Text = scdds.Tables[0].Rows[0]["sclx"].ToString(); xdrq.Text = Convert.ToDateTime(scdds.Tables[0].Rows[0]["xdrq"]).ToString("yyyy-MM-dd"); wgrq.Text = Convert.ToDateTime(scdds.Tables[0].Rows[0]["wgrq"]).ToString("yyyy-MM-dd"); ywy.Text = scdds.Tables[0].Rows[0]["kdr"].ToString(); ddbz.Text = scdds.Tables[0].Rows[0]["bz"].ToString(); zt.Text = scdds.Tables[0].Rows[0]["zt"].ToString(); } } #endregion #region 用来加载项目 private void getsccpxm(int scdid) { //修改页面时,首先吧项目明细的表头加载出来 string biao = "" + "" + "" + "" + ""; //查询数据视图,获取当前订单下的所有明细 DataSet ds = DBHlper.Execute("select * from nr_z_scd_cp where scdid='" + scdid + "' order by id "); if (ds != null && ds.Tables[0].Rows.Count > 0) { //如果当前订单下存在明细就加载成tr行 foreach (DataRow r in ds.Tables[0].Rows) { //为保证唯一性,获取id拼接,保证稳定性 string hcount = r["id"].ToString(); DataSet tqds = DBHlper.Execute("select * from nr_z_scd_cp_tqkc where xmid='" + r["id"] + "'"); string tqxxst = ""; if (tqds != null && tqds.Tables[0].Rows.Count > 0) { tqxxst = tqds.Tables[0].Rows[0]["tptqsl"].ToString() + "," + tqds.Tables[0].Rows[0]["sptqsl"].ToString() + "," + tqds.Tables[0].Rows[0]["bdtqsl"].ToString(); } biao += "" + "" + "" + "" + "" + " " + " " + " " + ""; } } cpxx.InnerHtml = biao + "
单据编号客户编号产品货号产品名称种类 工艺要求订单数量提取库存数量生产数量交货日期备注
" + r["djbh"].ToString() + "" + r["khbh"].ToString() + "" + r["cphh"].ToString() + "" + r["cpmc"] + "" + r["zl"].ToString() + "" + r["scfs"].ToString() + " " + r["ddsl"].ToString() + "" + tqxxst + "" + r["scsl"].ToString() + "" + Convert.ToDateTime(r["jhrq"]).ToString("yyyy-MM-dd") + "" + r["bz"].ToString() + "
"; } #endregion }