110 lines
5.2 KiB
C#
110 lines
5.2 KiB
C#
|
|
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 TcOrderPrint : 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);
|
|||
|
|
updatewlxx(Convert.ToInt32(id.Value));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#region 获取真正数据值
|
|||
|
|
private void initdata(string did)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
int idz = Convert.ToInt32(did);
|
|||
|
|
dd = ddbll.GetModel(idz);
|
|||
|
|
djmc.Text = dd.djmc;
|
|||
|
|
khbh.Text = dd.kh_bh;
|
|||
|
|
bh.Text = dd.bh;
|
|||
|
|
ddlx.Text = DBHlper.getfirstcolmn("select mingcheng from nr_sys_bianma where id=" + dd.ddlx);
|
|||
|
|
ddzt.Text = dd.ddzt;
|
|||
|
|
khmc.Text = kehubll.GetList("bianhao='" + dd.kh_bh + "'").Tables[0].Rows[0]["mingcheng"].ToString();
|
|||
|
|
lxr.Text = dd.lianxiren;
|
|||
|
|
lxfs.Text = dd.lianxifangshi;
|
|||
|
|
ywy.Text = dd.ywy;
|
|||
|
|
xdrq.Text = DateTime.Parse(dd.xdrq.ToString()).ToString("yyyy-MM-dd HH:mm");
|
|||
|
|
jzrq.Text = DateTime.Parse(dd.jzrq.ToString()).ToString("yyyy-MM-dd");
|
|||
|
|
shsj.Text = dd.shsj.ToString();
|
|||
|
|
zdr.Text = dd.zdr;
|
|||
|
|
shr.Text = dd.shr;
|
|||
|
|
shjg.Text = dd.shjg;
|
|||
|
|
shyj.Text = dd.shyj;
|
|||
|
|
ddbz.Text = dd.ddbz;
|
|||
|
|
ddzje.Text = dd.ddzje.ToString();
|
|||
|
|
daxiejine.Text=DBHlper.ConvertToChineseNum(dd.ddzje.ToString());
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 修改时用来加载定单产品项目
|
|||
|
|
private void updatewlxx(int dd_id)
|
|||
|
|
{
|
|||
|
|
//修改页面时,首先吧项目明细的表头加载出来
|
|||
|
|
string biao = "<table id='ddxm' class='bule'> <tr id='0' class='tbtilt'>"
|
|||
|
|
+ "<td><span>项目类型</span></td><td><span>产品货号</span></td><td><span>产品名称</span></td><td><span>重量(G)</span></td><td><span>体积(ML)</span></td>"
|
|||
|
|
+ " <td><span>规格(CM)</span></td><td><span>种类</span></td><td><span>特殊工艺</span></td><td><span>订货数量</span></td><td><span>单位</span></td>"
|
|||
|
|
+ " <td class='notjine'><span>单价</span></td><td class='notjine'><span>金额</span></td><td ><span>交货日期</span></td> <td><span>备注</span></td></tr>";
|
|||
|
|
//查询数据视图,获取当前订单下的所有明细
|
|||
|
|
DataSet ds = DBHlper.Execute("select * from view_nr_z_dd_tccp where dd_id='" + dd_id + "' order by id ");
|
|||
|
|
DataTable dtgx = new DataTable();
|
|||
|
|
if (ds != null && ds.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
//如果当前订单下存在明细就加载成tr行
|
|||
|
|
foreach (DataRow r in ds.Tables[0].Rows)
|
|||
|
|
{ //为保证唯一性,获取id拼接,保证稳定性
|
|||
|
|
string hcount = r["id"].ToString();
|
|||
|
|
biao += "<tr id='" + hcount + "' name='" + hcount + "'>"
|
|||
|
|
+ "<td><span>" + r["mxlx"].ToString() + "</span></td><td><span>" + r["cphh"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["cpmc"].ToString() + "</span></td><td><span>" + r["zhongliang"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["tiji"].ToString() + "</span></td><td ><span>" + r["gg"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["zl"].ToString() + "</span></td><td><span>" + r["scfs"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["dhsl"].ToString() + "</span></td><td><span>" + r["dw"].ToString() + "</span></td>"
|
|||
|
|
+ "<td class='notjine'><span>" + r["danjia"].ToString() + "</span></td><td class='notjine'><span>" + r["jine"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + Convert.ToDateTime(r["jhrq"]).ToString("yyyy-MM-dd") + "</span></td><td><span>" + r["bz"].ToString() + "</span></td>"
|
|||
|
|
+ "</tr>";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
cpxx.InnerHtml = biao + "</table>";
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|