private void StoreList_SelectedIndexChanged(object sender, EventArgs e) { string[] storeArray = StoreList.SelectedItem.ToString().Split(')'); int StoreId = Convert.ToInt32(storeArray[0]); string[] productArray = ProductList.SelectedItem.ToString().Split(')'); int ProductId = Convert.ToInt32(productArray[0]); UnitPriceTxt.Text = ""; PieeceNumber.Value = 0; PieeceNumber.Minimum = 0; PieeceNumber.Maximum = (productInStoreService.GetStoreCount(StoreId, ProductId) == null) ? 0 : productInStoreService.GetStoreCount(StoreId, ProductId).Stock; TotalPriceTxt.Text = ""; }
private void StoreList_SelectedIndexChanged(object sender, EventArgs e) { string[] productArray = ProductList.SelectedItem.ToString().Split(')'); int ProductId = Convert.ToInt32(productArray[0]); string[] storeArray = StoreList.SelectedItem.ToString().Split(')'); int StoreId = Convert.ToInt32(storeArray[0]); StoreTransferList.Items.Clear(); foreach (var store in storeService.GetAllOrderStore(StoreId)) { StoreTransferList.Items.Add(store.Id + ") " + store.Name); } PieeceNumber.Minimum = 0; PieeceNumber.Maximum = (productInStoreService.GetStoreCount(StoreId, ProductId) != null) ? productInStoreService.GetStoreCount(StoreId, ProductId).Stock : 0; PieeceNumber.Value = 0; }