95 lines
4.1 KiB
C#
95 lines
4.1 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;
|
||
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 = "<table width='100%' style='border:0px solid #000000;margin-top:-1px;'> <tr id='0' >"
|
||
+ "<td class='head7' width='100'>生产编号</td><td class='head7' width='100'>客户编号</td><td class='head7' width='100'>产品货号</td>"
|
||
+ "<td class='head7' width='100'>产品名称</td><td class='head7' width='80'>种类</td> <td class='head7' width='80'>烧成方式</td> "
|
||
+ " <td class='head7' width='80'>外发数量</td><td class='head7' width='100'>交货日期</td>"
|
||
+ "<td class='head7' width='170'>备注</td></tr>";
|
||
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 += "<tr id='" + hcount + "' name='" + hcount + "'> "
|
||
+ "<td class='head6'><font>" + r["scdh"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["khbh"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["cphh"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["cpmc"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["cpzl"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["scfs"] + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["wfsl"] + "</font></td>"
|
||
+ " <td class='head6'><font>" + Convert.ToDateTime(r["jhrq"]).ToString("yyyy-MM-dd") + "</font></td>"
|
||
+ "<td class='head6'><font>" + r["bz"] + "</font></td></tr>";
|
||
|
||
}
|
||
wxxx.InnerHtml = biao + "</table>";
|
||
}
|
||
#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
|
||
|
||
} |