using System; using System.Collections.Generic; using iWareDataCore.DEV.Service; using iWareDataCore.DEV.Entity; using iWareCommon.Common.Entity; using iWareWms; using FineUIPro; namespace iWareWms.View.DEV.EquipmentType { public partial class EquipmentTypeDetail : PageBase { protected override void Save(out string msg) { EquipmentTypeService.GetInstance().Save(GetequmentType(), out msg); } protected override void Update(out string msg) { var equmentType = GetequmentType(); equmentType.Id = Convert.ToInt32(Request.QueryString["Id"]); EquipmentTypeService.GetInstance().Update(equmentType, out msg); } private EquipmentTypeEntity GetequmentType() { return new EquipmentTypeEntity { Name = EqumentTypeName.Text.Trim(), Remark = remark.Text.Trim(), }; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["IsEdit"])) { string msg; var types = EquipmentTypeService.GetInstance().QueryByParam(new QueryParam { Filter = new Dictionary { { "Id", Request.QueryString["Id"] } } }, out msg); if (!string.IsNullOrEmpty(msg)) { Alert.ShowInTop(msg); return; } EqumentTypeName.Text = types.Count > 0 ? types[0].Name : ""; remark.Text = types.Count > 0 ? types[0].Remark : ""; } else { return; } } } } }