using BLL; using System; namespace FineUIPro.Web.HJGL.PreDesign { public partial class MaterialView : PageBase { /// /// 项目id /// 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.GetUnit(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.HJGL_MaterialManage Material = BLL.HJGL_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); } } } } } } }