public Winform_SaleItemDetails(SaleItem _saleItem, int index)
        {
            InitializeComponent();

            this.index = index;
            saleItem = _saleItem;

            txtBrand.Text = _saleItem.Item.Brand;
            txtCommodity.Text = _saleItem.Item.Name;

            txtPrice.Text = _saleItem.Price.ToString();
            txtTotalPrice.Text = _saleItem.TotalPrice.ToString();

            nudQuantity.Maximum = _saleItem.StockCount;
            nudQuantity.Value = _saleItem.Quantity;
        }
        private void PopulateDgvSaleItem(SaleItem itemsku, int index)
        {
            /* sale item grid
             * name - Brand - quantity - price - total amount
            */
            dgvSaleItem.Rows[index].Cells["colItemName"].Value = itemsku.Item.Name;
            dgvSaleItem.Rows[index].Cells["colBrand"].Value = itemsku.Item.Brand;
            dgvSaleItem.Rows[index].Cells["colID"].Value = itemsku.ID;
            dgvSaleItem.Rows[index].Cells["colQuantity"].Value = itemsku.Quantity; //todo: Ask Minimum wholesale quantity
            dgvSaleItem.Rows[index].Cells["colPrice"].Value = itemsku.Price;
            dgvSaleItem.Rows[index].Cells["colTotalPrice"].Value = itemsku.TotalPrice;

            CalculatePaymentDetails();
        }
        private void dgvSearch_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            #region Validation
            if (e.RowIndex == -1) return;
            int _ID = int.Parse(dgvSearch.Rows[e.RowIndex].Cells["ID"].Value.ToString());

            /*Check if item is in stock*/
            bool inStock = int.Parse(dgvSearch.Rows[e.RowIndex].Cells["StockQuantity"].Value.ToString()) > 0;
            if (!inStock)
            {
                MessageBox.Show("Item cannot be added as its not in stock.", "Add Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            /*Get Selected Item Info*/
            ItemSKU itemsku = ItemSKUBuilder.GetItemSKUInfo(_ID);
            if (itemsku == null) return;

            /*If Item already exists*/
            bool itemExists = saleItemList.Any(i => i.ID == itemsku.ID);
            if (itemExists)
            {
                MessageBox.Show("Item selected already exists in the sale", "Item already Exists", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            #endregion Validation

            skuItemList.Add(itemsku);

            SaleItem saleItem = new SaleItem(itemsku.Item, itemsku.WholesalePrice, itemsku.StockQuantity, 1, itemsku.WholesalePrice);
            saleItemList.Add(saleItem);

            dgvSaleItem.Rows.Add();
            var _index = dgvSaleItem.Rows.Count - 1;
            PopulateDgvSaleItem(saleItem, _index);
        }
        internal void UpdateSaleItemList(SaleItem saleItem, int index)
        {
            saleItemList[index] = saleItem;

            PopulateDgvSaleItem(saleItem, index);
        }