private void button1_Click(object sender, EventArgs e)
        {
            List<string> invValues = Utilities.DataBaseUtility.GetList("select InvID,12,SupplierID,Max,Min,OnHand,Category,year,Price,UnitCost,ProductName,ProductID from " + PODConstants.INVENTORY_LIST + " where productID = " + textBox0.Text);

            if (invValues != null && invValues.Count < 2)
            {
                MessageBox.Show("Inventory item not found");
                return;
            }
            item = new InventoryItem(invValues[1]);

            List<string> _productValues = Utilities.DataBaseUtility.GetList("select Maker, Model from Products where productID = " + textBox0.Text);
            if (_productValues != null && _productValues.Count >= 2)
            {
                string strProduct = _productValues[1];
                string[] strMakerModel = strProduct.Split(',')
                                        .Select(s => s.Trim())
                                        .Where(s => s != String.Empty)
                                        .ToArray();

                textBox_Maker.Text = strMakerModel[0];
                textBox_Model.Text = strMakerModel[1];
            }
            textBox_SupplierID.Text = item.Supplier.ToString();
            textBox_MinQuantity.Text = item.MinQuantity.ToString();
            textBox_OnHand.Text = item.OnHand.ToString();
            textBox_InventoryValue.Text = item.Cost.ToString();
            textBox_category.Text = item.Category;
            textBox_year.Text = item.Year.ToString();
        }
        public DisplaySelectedObject(IdentityObject _ident, string _tableName, 
                                                  string _docType,  string _docNum)
        {
            InitializeComponent();
            base.SaveIdent(_ident);
            base.DisplayIdent(_ident);
            ident = _ident;
            label_SubName.Text = "Display Low Inventory - Product";
            button_DisplayDoc.Text = "Display Product";
            button_ChangeDoc.Visible = false;
            textBox_DocNum.Text = _docNum;
            textBox_TableName.Text = _tableName;
            label_TextValue1.Text = "Category";
            label10.Text = "Year";
            label_IntAgent.Text = "Max";
            label_ProcNum.Text = "Min";
            label7.Text = "On Hand";
            textBox_Cmd.Text = "Select DocNum,DocType,ExtRef,Max,Min,OnHand,Category,year,Price,UnitCost,Comments from " + PODConstants.INVENTORY_LIST + " Where DocNum = " + _docNum;
            var _records = Utilities.DataBaseUtility.GetList(textBox_Cmd.Text);
            if (_records == null || _records != null && _records.Count < 2)
               return;
            item = new InventoryItem(_records[1]);

            //comment the below code after new db changed invid as integer;
            //button_DisplayDoc.Visible = false;
            //textBox_DocNum.Text = item.InvID;
            //textBox_DocType.Text = "12";
            //textBox_ExtAgent.Text = item.Supplier.ToString();
            //textBox_IntAgent.Text = item.MaxQuantity.ToString();
            //textBox_Status.Text = item.MinQuantity.ToString();
            //textBox_ProcessID.Text = item.OnHand.ToString();
            //textBox_TextValue1.Text = item.Category;
            //textBox_TextValue2.Text = item.Year.ToString(); //  StatusDate
            //textBox_NumValue1.Text = item.Price.ToString();    //  quotedAmount
            //textBox_NumValue2.Text = item.Cost.ToString();    //  actualAmount
        }
 private void FillProducts()
 {
     _productRecords = DataBaseUtility.GetList("Select DocNum,DocType,ExtRef,Max,Min,OnHand,Category,year,Price,UnitCost,Comments from " + PODConstants.INVENTORY_LIST + " where OnHand < Min and onHand > 0 and supplierID = " + textBox_Supplier.Text);
     _products = new List<InventoryItem> { };
     for (int i = 1; i < _productRecords.Count; i++)
     {
         InventoryItem item = new InventoryItem(_productRecords[i]);
         _products.Add(item);
         //string[] fields = _productRecords[i].Split(',')
         //                    .Select(s => s.Trim())
         //                    .Where(s => s != String.Empty)
         //                    .ToArray();
         comboBox_Products.Items.Add(item.InvID + "  :  " + item.ProductName);
     }
 }