/// <summary> /// 页面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmSLCreateLayout_Load(object sender, EventArgs e) { try { WHStorageTypeOutputDto whStorageType = autofacConfig.wareHouseService.GetSTByWareIDandSTID(WareID, STID); txtWareID.Text = whStorageType.WAREID; txtWareID.ReadOnly = true; txtWareName.Text = whStorageType.WARENAME; txtWareName.ReadOnly = true; txtSTID.Text = whStorageType.STID; txtSTID.ReadOnly = true; txtSTName.Text = whStorageType.NAME; txtSTName.ReadOnly = true; if (isEdit) { WHStorageLocationOutputDto whStorageLocation = autofacConfig.wareHouseService.GetSLByID(WareID, STID, SLID); txtSLID.Text = whStorageLocation.SLID; txtSLID.ReadOnly = true; txtSLName.Text = whStorageLocation.SLNAME; btnManager.Tag = whStorageLocation.MANAGER; btnManager.Text = whStorageLocation.MANAGERNAME + " > "; txtMAXCAPACITY.Text = whStorageLocation.MAXCAPACITY; txtMAXVOLUME.Text = whStorageLocation.MAXVOLUME; } } catch (Exception ex) { Form.Toast(ex.Message); } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmSTCreateLayout_Load(object sender, EventArgs e) { try { WareHouse wareHouse = autofacConfig.wareHouseService.GetByWareID(WareID); if (wareHouse != null) { txtWareID.Text = wareHouse.WAREID; txtWareID.ReadOnly = true; txtWareName.Text = wareHouse.NAME; } txtWareName.ReadOnly = true; if (isEdit) { WHStorageTypeOutputDto whStorageType = autofacConfig.wareHouseService.GetSTByWareIDandSTID(WareID, STID); txtSTID.Text = whStorageType.STID; txtSTID.ReadOnly = true; txtSTName.Text = whStorageType.NAME; switchIsEnable.Checked = whStorageType.ISENABLE == 1 ? true : false; } else if (isCreate) { switchIsEnable.Checked = true; } } catch (Exception ex) { Form.Toast(ex.Message); } }
/// <summary> /// 数据绑定 /// </summary> internal void Bind() { WHStorageTypeOutputDto wHStorageTypeOutputDto = autofacConfig.wareHouseService.GetSTByWareIDandSTID(WAREID, STID); title1.TitleText = wHStorageTypeOutputDto.NAME; List <WHStorageLocation> WHSLlist = autofacConfig.wareHouseService.GetSLByWareIDAndSTID(WAREID, STID); if (WHSLlist.Count > 0) { lvWHStorageLocation.DataSource = WHSLlist; lvWHStorageLocation.DataBind(); } foreach (ListViewRow Row in lvWHStorageLocation.Rows) { frmWHSLLayout Layout = Row.Control as frmWHSLLayout; svEnable svLayout = ((frmWHSLLayout)Row.Control).svRow.RightControl as svEnable; if (Layout.ibEdit.BindDataValue.ToString() == "0") { svLayout.btnEnable.Text = "启用"; svLayout.btnEnable.BackColor = System.Drawing.Color.FromArgb(43, 140, 255); Layout.lblName.ForeColor = System.Drawing.Color.FromArgb(230, 230, 230); } } }