using AUCMA.STORE.Business.Implements; using AUCMA.STORE.Business.Interface; using AUCMA.STORE.Entity.DAO; using AUCMA.STORE.Entity.Enums; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace AUCMA.STORE { public partial class StoreLocationInfo : Form { public BaseLocationInfo baseLocationInfo = new BaseLocationInfo(); private static IInStoreBusiness inStoreBusiness = new InStoreBusinessImpl(); public StoreLocationInfo() { InitializeComponent(); base.MaximizeBox = false; base.StartPosition = FormStartPosition.CenterScreen; } private void StoreLocationInfo_Load(object sender, EventArgs e) { tb_LOCATION_CODE.ReadOnly = true; tb_LOCATION_NAME.ReadOnly = true; tb_LOCATION_CODE.Text = baseLocationInfo.locationCode; tb_LOCATION_NAME.Text = baseLocationInfo.locationName; tb_MATERIAL_TYPE.Text = baseLocationInfo.materialType; if ((int)baseLocationInfo.locationStatus == 0) { cb_LOCATION_STATUS.Text = "锁库"; } else if ((int)baseLocationInfo.locationStatus == 1) { cb_LOCATION_STATUS.Text = "占用"; } else if ((int)baseLocationInfo.locationStatus == 2) { cb_LOCATION_STATUS.Text = "空闲"; } else if ((int)baseLocationInfo.locationStatus == 3) { cb_LOCATION_STATUS.Text = "停用"; } else if ((int)baseLocationInfo.locationStatus == 4) { cb_LOCATION_STATUS.Text = "停用"; } } private async void btn_OK_Click(object sender, EventArgs e) { try { baseLocationInfo.materialType = tb_MATERIAL_TYPE.Text; baseLocationInfo.locationStatus = (LocationStatus)cb_LOCATION_STATUS.SelectedIndex; await inStoreBusiness.updateLocationStateInfo(baseLocationInfo); base.DialogResult = DialogResult.OK; } catch (Exception) { throw; } } private void btn_Cancle_Click(object sender, EventArgs e) { Close(); } } }