📄 orderdetail_c.ascx.cs
字号:
namespace Botheighten.Yanghui.Web.Controls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Botheighten.Yanghui.BusinessFacade;
using Botheighten.Yanghui.Framework;
using Botheighten.Yanghui.BusinessRules;
/// <summary>
/// OrderDetail_C 的摘要说明。
/// </summary>
public abstract class OrderDetail_C : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.Label Label8;
protected System.Web.UI.WebControls.Label Label9;
protected System.Web.UI.WebControls.DataGrid grid;
protected System.Web.UI.WebControls.Label lblCode;
protected System.Web.UI.WebControls.Label lblName;
protected System.Web.UI.WebControls.Label lblQuantity;
protected System.Web.UI.WebControls.Label lblUnit;
protected System.Web.UI.WebControls.Label lblPrice;
protected System.Web.UI.WebControls.Label lblPriceAll;
protected System.Web.UI.WebControls.Label lblDeliveDate;
protected System.Web.UI.WebControls.Label lblShipDate;
protected System.Web.UI.WebControls.Label Label10;
protected System.Web.UI.WebControls.Label lblCQ;
protected System.Web.UI.WebControls.Label Label6;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
}
public void Bind()
{
string id=this.ViewState["ID"].ToString();
if(id!="")
{
Order o=new Order();
o.Id=id;
o.Retrieve();
if(o.IsPersistent)
{
this.lblCode.Text = o.BOMCode;
this.lblName.Text = o.BOMName;
this.lblPrice.Text = o.UnitJGPrice.ToString();
this.lblUnit.Text = UnitSystem.GetUnitCode(o.UnitId);
this.lblQuantity.Text = o.Quantity.ToString();
this.lblPriceAll.Text =( o.Quantity * o.UnitJGPrice ).ToString();
this.lblCQ.Text = o.CompleteQuantity.ToString();
this.lblDeliveDate.Text = o.DeliDate.ToShortDateString();
this.lblShipDate.Text = o.ShipDate.ToShortDateString();
DataTable dtLine=OrderTicketSystem.GetAllOrderLine(o.Id);
Common.ReSet(this.grid,dtLine.DefaultView);
this.grid.DataSource=dtLine;
this.grid.DataBind();
// this.lblMaterielCat.Text= MaterielSystem.GetMaterielCatName(m.CatalogId);
// this.lblFlag.Text = m.Flag;
// this.lblUnit.Text = UnitSystem.GetUnitCode(m.Unit);
// this.lblSpec.Text = m.Spec;
// this.lblDes.Text = Common.GetHtmlCode(m.Description);
}
}
}
/// <summary>
/// 产品Id
/// </summary>
public string MId
{
set
{
this.ViewState["ID"] = value;
}
get
{
return this.ViewState["ID"].ToString ();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// 设计器支持所需的方法 - 不要使用
/// 代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.grid.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.grid_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void grid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
{
e.Item.Cells[0].Text = MaterielSystem.GetMaterielCode(e.Item.Cells[0].Text.Trim());
e.Item.Cells[1].Text = MaterielSystem.GetMaterielCatName(e.Item.Cells[1].Text.Trim());
e.Item.Cells[2].Text = Common.GetLeftString(e.Item.Cells[2].Text.Trim(),20);
e.Item.Cells[5].Text = UnitSystem.GetUnitCode(e.Item.Cells[5].Text.Trim());
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -