protected void itemDropDownList_OnSelectedIndexChanged(object sender, EventArgs e) { int id = Convert.ToInt32(itemDropDownList.SelectedValue); reorderLevelTextBox.Text = itemManager.GetReorderLevel(id).ToString(); if (ViewState["stockOutItem"] == null) { availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(id).ToString(); } else { List <StockOut> stockOuts = (List <StockOut>)ViewState["stockOutItem"]; bool hasItem = false; foreach (var stock in stockOuts) { if (stock.ItemId == id) { hasItem = true; availableQuantityTextBox.Text = stock.AvailableQuantity.ToString(); //stock.AvailableQuantity = stock.AvailableQuantity - stockOut.StockOutQuantity; } } if (hasItem == false) { availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(id).ToString(); } } }
public void View() { reorderLevelTextBox.Enabled = false; availableQuantityTextBox.Enabled = false; reorderLevelTextBox.Text = stockInManager.GetReorderLevel(Convert.ToInt32(itemDropDownList.SelectedValue)).ToString(); availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(Convert.ToInt32(itemDropDownList.SelectedValue)).ToString(); }
protected void itemDropDownList_SelectedIndexChanged(object sender, EventArgs e) { int itemId = Convert.ToInt32(itemDropDownList.SelectedValue); Item item = stockInManager.GetReorderLevel(itemId); reorderLevelTextBox.Text = item.ReorderLavel.ToString(); StockIn stockIn = new StockIn(); stockIn.ItemID = itemId; StockIn stock = stockInManager.IsExist(stockIn); if (stock == null) { stockInTextBox.Text = " "; messageLabel.Text = "Insert Stock In"; } else { StockIn aStockIn = stockInManager.GetAvailableQuantity(stockIn); stockInTextBox.Text = aStockIn.AvailableQuantity; messageLabel.Text = "Output"; } }
protected void itemNameDropDownList_SelectedIndexChanged(object sender, EventArgs e) { int itemNo = Convert.ToInt32(itemNameDropDownList.SelectedValue); reorderLevelTextBox.Text = aStockInManager.GetReOrderLevel(itemNo).ToString(); availableQuantityTextBox.Text = (aStockInManager.GetAvailableQuantity(itemNo)).ToString(); }
protected void itemDropDownList_SelectedIndexChanged(object sender, EventArgs e) { if (itemDropDownList.SelectedItem.Text != "---Select Items---") { stockOutQuantityTextBox.Enabled = true; reorderLevelTextBox.Text = itemManager.GetItemReorderLevel(Convert.ToInt32(itemDropDownList.SelectedItem.Value)); availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(Convert.ToInt32(itemDropDownList.SelectedValue)); if (availableQuantityTextBox.Text == "0") { stockOutQuantityTextBox.Enabled = false; } IdHiddenField.Value = Convert.ToInt32(itemDropDownList.SelectedValue).ToString(); } }
protected void itemDropDownList_SelectedIndexChanged(object sender, EventArgs e) { if (itemDropDownList.SelectedItem.Text != "---Select Items---") { reorderLevelTextBox.Text = itemManager.GetItemReorderLevel(Convert.ToInt32(itemDropDownList.SelectedValue)); availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(Convert.ToInt32(itemDropDownList.SelectedValue)); } }
public void View() { reorderLevelTextBox.Enabled = false; availableQuantityTextBox.Enabled = false; reorderLevelTextBox.Text = stockInManager.GetReorderLevel(Convert.ToInt32(itemDropDownList.SelectedValue)).ToString(); int remainingQuantity = stockInManager.GetAvailableQuantity(Convert.ToInt32(itemDropDownList.SelectedValue)); // availableQuantityTextBox.Text = remainingQuantity.ToString(); ///--- int temp = 0; if (stockOutGridView.Rows.Count > 0) { for (int i = 0; i < stockOutGridView.Rows.Count; i++) { HiddenField hiddenField = stockOutGridView.Rows[i].FindControl("HiddenField1") as HiddenField; Label quantityLabel = stockOutGridView.Rows[i].FindControl("ItemQuantity") as Label; int itemId = Convert.ToInt32(hiddenField.Value); if (itemId == Convert.ToInt32(itemDropDownList.SelectedValue)) { temp = Convert.ToInt32(quantityLabel.Text); break; } } } ///--- if (temp > 0) { availableQuantityTextBox.Text = (remainingQuantity - temp).ToString(); } else { availableQuantityTextBox.Text = remainingQuantity.ToString(); } }
protected void itemDropDownList_OnSelectedIndexChanged(object sender, EventArgs e) { int id = Convert.ToInt32(itemDropDownList.SelectedValue); reorderLevelTextBox.Text = itemManager.GetReorderLevel(id).ToString(); availableQuantityTextBox.Text = stockInManager.GetAvailableQuantity(id).ToString(); //if (stockIn == null) //{ // int availableQuantity = 0; // availableQuantityTextBox.Text = availableQuantity.ToString(); //} //else //{ // availableQuantityTextBox.Text = stockIn.AvailableQuantity.ToString(); //} }
private void itemCombo_SelectedValueChanged(object sender, EventArgs e) { _itemId = Convert.ToInt32(itemCombo.SelectedValue); showReorderLevel.Text = _stockInManager.GetReorderLevel(_itemId); showAvailableQuantity.Text = _stockInManager.GetAvailableQuantity(_itemId); quantityBox.Text = "0"; if (_stockOutManager.NotAvailable(_itemId)) { notAvailableMsgLabel.Text = "Available quantity is under Reorder level"; addButton.Hide(); } else { addButton.Show(); notAvailableMsgLabel.Text = ""; } }
public void GetAvailableQuantity() { addItem = stockInManager.GetAvailableQuantity(Convert.ToInt32(itemNameDropDownList.SelectedValue)); availableQuantityTextBox.Text = addItem.AvailableQuantity.ToString(); }
private void itemCombo_SelectedValueChanged(object sender, EventArgs e) { itemId = Convert.ToInt32(itemCombo.SelectedValue); showReorderLevel.Text = _stockInManager.GetReorderLevel(itemId); showAvailableQuantity.Text = _stockInManager.GetAvailableQuantity(itemId); }
public int GetAvailableQuantity(int id) { return(aStockInManager.GetAvailableQuantity(id)); }