SGGL_SHJ/SGGL/FineUIPro.Web/CQMS/Material/MaterialView.aspx.cs

63 lines
2.5 KiB
C#

using System;
namespace FineUIPro.Web.CQMS.Material
{
public partial class MaterialView : PageBase
{
/// <summary>
/// 项目id
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ProjectId = this.CurrUser.LoginProjectId;
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
BLL.MainItemService.InitMainItemDownList(drpMainItem, this.ProjectId, true);
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string MaterialId = Request.Params["MaterialId"];
if (!string.IsNullOrEmpty(MaterialId))
{
Model.Material_Material Material = BLL.CQMS_MaterialService.GetMaterialByMaterialId(MaterialId);
if (Material != null)
{
this.txtContractNo.Text = Material.ContractNo;
if (!string.IsNullOrEmpty(Material.UnitId))
{
this.drpUnit.SelectedValue = Material.UnitId;
}
if (!string.IsNullOrEmpty(Material.MainItemId))
{
this.drpMainItem.SelectedValue = Material.MainItemId;
}
this.txtMaterialName.Text = Material.MaterialName;
this.txtSpecificationAndModel.Text = Material.SpecificationAndModel;
this.txtMaterialCode.Text = Material.MaterialCode;
this.txtMaterial.Text = Material.Material;
this.txtPressClass.Text = Material.PressClass;
this.txtUnit.Text = Material.Unit;
if (Material.Num != null)
{
this.txtNum.Text = Material.Num.ToString();
}
if (Material.ArrivalDate != null)
{
this.txtArrivalDate.Text = string.Format("{0:yyyy-MM-dd}", Material.ArrivalDate);
}
}
}
}
}
}
}