public TransactionForm() { InitializeComponent(); // this.AcceptButton = saveTransactionbutton; transactionActionlabel.Visible = false; List<InventoryCategory> aaList = new List<InventoryCategory>(); InventoryCategoryBLL aBll = new InventoryCategoryBLL(); aaList = aBll.GetAllCategory(); categoryNamecomboBox.DataSource = aaList; categoryNamecomboBox.DisplayMember = "CategoryName"; categoryNamecomboBox.ValueMember = "CategoryId"; //findout item try { InventoryItemBLL aaBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue); aList = aaBll.GetItemByCategory(category); itemNamecomboBox.DataSource = aList; itemNamecomboBox.DisplayMember = "ItemName"; itemNamecomboBox.ValueMember = "ItemId"; InventoryItem aItem = new InventoryItem(); aItem = (InventoryItem)itemNamecomboBox.SelectedItem; unittypelabel.Text = aItem.UnitName; } catch (Exception) { } // This used for package activation // BookedTransactionTypecomboboxForBusiness();// when Businees Package is active BookedTransactionTypecomboboxForProfessional();// when When Professional Package is active }
private void categoryNameComboBox_SelectedIndexChanged(object sender, EventArgs e) { InventoryItemBLL aaBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); if (Convert.ToInt32(categoryNameComboBox.SelectedIndex) >= 0) { InventoryCategory category = (InventoryCategory)categoryNameComboBox.SelectedItem; aList = aaBll.GetItemByCategory(category.CategoryId); rawMaterialsNameComboBox.DataSource = aList; rawMaterialsNameComboBox.DisplayMember = "ItemName"; rawMaterialsNameComboBox.ValueMember = "ItemId"; } }
public bool CheckExit(string itemName) { InventoryItemBLL aBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); aList = aBll.GetAllItem(); bool flag = false; foreach (InventoryItem inventoryItem in aList) { if (inventoryItem.ItemName.ToUpper() == itemName.ToUpper()) flag = true; } if (flag) return true; return false; }
private void LoadExistingData() { InventoryItemBLL aInventoryItemBll=new InventoryItemBLL(); InventoryItem aInventoryItem=new InventoryItem(); aInventoryItem = aInventoryItemBll.GetInventoryItem(itemId); itemNametextBox.Text = aInventoryItem.ItemName; int index = SelectedIndesForFoodType(aInventoryItem.CategoryId, categoryNamecomboBox); categoryNamecomboBox.SelectedIndex = index; index = SelectedIndesForItemUnit(aInventoryItem.UnitName, unitNamecomboBox); unitNamecomboBox.SelectedIndex = index; }
public InventoryPurchaseForm() { InitializeComponent(); // this.AcceptButton=savePurchasebutton; purchaseActionlabel.Visible = false; //Find out category List<InventoryCategory> aaList=new List<InventoryCategory>(); InventoryCategoryBLL aBll=new InventoryCategoryBLL(); aaList = aBll.GetAllCategory(); categoryNamecomboBox.DataSource = aaList; categoryNamecomboBox.DisplayMember = "CategoryName"; categoryNamecomboBox.ValueMember = "CategoryId"; //findout item InventoryItemBLL aaBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue); aList = aaBll.GetItemByCategory(category); itemNamecomboBox.DataSource = aList; itemNamecomboBox.DisplayMember = "ItemName"; itemNamecomboBox.ValueMember = "ItemId"; //find out unit //int unitId = aaList[categoryNamecomboBox.SelectedIndex].UnitId; //UnitCreateBLL aCreateBll = new UnitCreateBLL(); //Unit aUnit = new Unit(); //aUnit = aCreateBll.GetUnitByUnitId(unitId); try { unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName; } catch (Exception) { } //find out supplier SupplierBLL aSupplierBll=new SupplierBLL(); List<Supplier>aSuppliers=new List<Supplier>(); aSuppliers = aSupplierBll.GetAllSupplier(); supplierNamecomboBox.DataSource = aSuppliers; supplierNamecomboBox.DisplayMember = "Name"; supplierNamecomboBox.ValueMember = "SupplierId"; dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers,Convert.ToInt32(supplierNamecomboBox.SelectedValue)); BookedPaymentTypeCombobox(); }
public bool CheckExit(string itemName) { InventoryItemBLL aBll = new InventoryItemBLL(); List <InventoryItem> aList = new List <InventoryItem>(); aList = aBll.GetAllItem(); bool flag = false; foreach (InventoryItem inventoryItem in aList) { if (inventoryItem.ItemName.ToUpper() == itemName.ToUpper()) { flag = true; } } if (flag) { return(true); } return(false); }
private void LoadItemDetails(int categoryId) { try { if (Convert.ToInt32(categoryNamecomboBox.SelectedValue) > 0) { InventoryItemBLL aBll = new InventoryItemBLL(); //List<InventoryItem> aList = new List<InventoryItem>(); DataTable aDataTable=new DataTable(); aDataTable = aBll.GetItemByCategoryintoTable(categoryId); //aList = aBll.GetItemByCategory(categoryId); rawmaterislaItemdataGridView.DataSource = aDataTable; } } catch { } }
private void savebutton_Click(object sender, EventArgs e) { InventoryItem aItem=new InventoryItem(); aItem.ItemName = itemNametextBox.Text; aItem.CategoryId = Convert.ToInt32(categoryNamecomboBox.SelectedValue); Unit aUnit=new Unit(); aUnit = (Unit)(unitNamecomboBox.SelectedItem); aItem.UnitName =aUnit.UnitName; if (itemNametextBox.Text.Length != 0) { InventoryItemBLL aBll = new InventoryItemBLL(); bool check = aBll.CheckExit(aItem.ItemName); if (!check) { itemCreatelabel.Visible = true; itemCreatelabel.Text = aBll.InsertInventoryItem(aItem); itemNametextBox.Clear(); } else MessageBox.Show("Item Already Exit"); } else MessageBox.Show("Please Check Your Input"); }
private void categoryNamecomboBox_SelectedIndexChanged(object sender, EventArgs e) { try { if (Convert.ToInt32(categoryNamecomboBox.SelectedValue) > 0) { InventoryItemBLL aBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue); InventoryCategory aInventoryCategory =(InventoryCategory) categoryNamecomboBox.Items[categoryNamecomboBox.SelectedIndex]; UnitCreateBLL aCreateBll = new UnitCreateBLL(); //Unit aUnit = new Unit(); //aUnit = aCreateBll.GetUnitByUnitId(aInventoryCategory.UnitId); //unittypelabel.Text = aUnit.UnitName; aList = aBll.GetItemByCategory(category); itemNamecomboBox.DataSource = aList; itemNamecomboBox.DisplayMember = "ItemName"; itemNamecomboBox.ValueMember = "ItemId"; if (Convert.ToInt32(itemNamecomboBox.SelectedValue) > 0) { InventoryItem aItem = new InventoryItem(); aItem = (InventoryItem)itemNamecomboBox.SelectedItem; unittypelabel.Text = aItem.UnitName; } } } catch { } }
private void categoryNamecomboBox_SelectedIndexChanged(object sender, EventArgs e) { try { if (Convert.ToInt32(categoryNamecomboBox.SelectedValue) > 0) { InventoryItemBLL aBll = new InventoryItemBLL(); List<InventoryItem> aList = new List<InventoryItem>(); Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue); aList = aBll.GetItemByCategory(category); itemNamecomboBox.DataSource = aList; itemNamecomboBox.DisplayMember = "ItemName"; itemNamecomboBox.ValueMember = "ItemId"; unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName; } } catch { } }
private void updatebutton_Click(object sender, EventArgs e) { if(ValidForm()) { InventoryItem aInventoryItem=new InventoryItem(); InventoryItemBLL aInventoryItemBll=new InventoryItemBLL(); aInventoryItem.ItemId = itemId; aInventoryItem.CategoryId = Convert.ToInt32(categoryNamecomboBox.SelectedValue); aInventoryItem.CategoryName = categoryNamecomboBox.Text; aInventoryItem.ItemName = itemNametextBox.Text; aInventoryItem.UnitName = unitNamecomboBox.Text; string result = aInventoryItemBll.UpdateItem(aInventoryItem); updatestatuslabel.Visible = true; updatestatuslabel.Text = result; } }
private void rawmaterislaItemdataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } try { if (e.ColumnIndex == Convert.ToInt32("0" + rawmaterislaItemdataGridView.Rows[e.RowIndex].Cells["up"].ColumnIndex)) { int itemId = Convert.ToInt32("0" + rawmaterislaItemdataGridView.Rows[e.RowIndex].Cells["II_id"].Value); ItemUpdateForm objUpdate = new ItemUpdateForm(itemId); objUpdate.Parent = this.ParentForm; UserControlManager.UserControls.Push(this); Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"]; string s = pnl.Name; objUpdate.ParentForm.Controls[s].Controls.Clear(); objUpdate.ParentForm.Controls[s].Controls.Add(objUpdate); } else if (e.ColumnIndex == Convert.ToInt32("0" + rawmaterislaItemdataGridView.Rows[e.RowIndex].Cells["del"].ColumnIndex)) { DialogResult result = MessageBox.Show("Do you want to Deleted it?", "Confirmation", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { InventoryItemBLL aItemBll = new InventoryItemBLL(); int itemId = Convert.ToInt32("0" + rawmaterislaItemdataGridView.Rows[e.RowIndex].Cells["II_id"].Value); bool res = aItemBll.DeleteItem(itemId); if (res) { rawmaterislaItemdataGridView.Rows.RemoveAt(e.RowIndex); } } else if (result == DialogResult.No) { } } } catch (Exception) { } }