Example #1
0
        public Item_UpdateForm()
        {
            InitializeComponent();
            sql = new MySQLDatabaseDriver();

            supplierList = new ArrayList();
            sql.SelectAllSuppliers(supplierList);

            supplierDropdownList = new ArrayList();
            sql.SelectAllSupplierNames(supplierDropdownList);
            supplierDropdownList.Sort(); //Sort list alphabetically
            supplierDropdownList.Insert(0, "Select Supplier");
            cbbSupplierName.DataSource = supplierDropdownList;
        }
Example #2
0
        public Supplier_MainScreen()
        {
            InitializeComponent();
            sql = new MySQLDatabaseDriver();
            supplierIDCounter = 0;
            supplierList      = new ArrayList();

            /*
             * //---STREAM READER
             * try
             * {
             *  FileStream fs = new FileStream(@"supplier.txt", FileMode.Open);
             *  StreamReader readin = new StreamReader(fs);
             *  while (!readin.EndOfStream)
             *  {
             *      string[] text = readin.ReadLine().Split('|');
             *      supplierList.Add(new Supplier(text[0], text[1], text[2], text[3], text[4], text[5])); //Recreate the Supplier
             *      dgvSuppliers.Rows.Add(text[1], text[2], text[3]);
             *      supplierIDCounter++;
             *  }
             *  readin.Close();
             *  fs.Close();
             * }
             * catch (Exception e) { }*/

            /*
             * //ADJUST DATAGRIDVIEW COLUMN ALIGNMENT
             * dgvSuppliers.Columns["PartNo"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; //Center column header
             * dgvSuppliers.Columns["PartNo"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; //Center column contents
             */

            //TEST CODE (For the purpose of customizing the DGV and checking out its appearance)

            /*dgvSuppliers.Rows.Add("Lucid Co.", "Victoria Carpio", "09133933371");
             * dgvSuppliers.Rows.Add("Fluora’s Shop", "Marvin Sta. Ana", "09253902271");
             * dgvSuppliers.Rows.Add("Cinco Company", "Royce Goden", "09153903125");
             * dgvSuppliers.Rows.Add("Mayers Balay", "Angelo Mercado", "09169833371");*/
            sql.SelectAllSuppliers(supplierList);
            for (int i = 0; i < supplierList.Count; i++)
            {
                Supplier s = (Supplier)supplierList[i];
                dgvSuppliers.Rows.Add(s.SupplierName,
                                      s.SupplierPerson,
                                      s.SupplierNumber,
                                      s.SupplierEmail);
            }
            supplierIDCounter = supplierList.Count + 1;
        }
Example #3
0
        private int supplierIDFK;               //RFQ Foreign Key 2

        //CONSTRUCTOR
        public RFQ_CreateForm()
        {
            InitializeComponent();
            sql = new MySQLDatabaseDriver();

            //Instantiate ArrayLists and populate them
            customerDropdownList = new ArrayList();
            sql.SelectAllCustomerNames(customerDropdownList);
            customerDropdownList.Sort();                       //Sort list alphabetically
            customerDropdownList.Insert(0, "Select Customer");
            cbbCustomerName.DataSource = customerDropdownList; //Populate the dropdown

            supplierItemList = new ArrayList();
            supplierList     = new ArrayList(); //Need all the Supplier Details, since there's Supplier auto-complete
            sql.SelectAllSuppliers(supplierList);

            supplierDropdownList = new ArrayList();
            sql.SelectAllSupplierNames(supplierDropdownList);
            supplierDropdownList.Sort();                       //Sort list alphabetically
            supplierDropdownList.Insert(0, "Select Supplier");
            cbbSupplierName.DataSource = supplierDropdownList; //Populate the dropdown

            //Set default Combo Box values
            cbbFilterBy.SelectedIndex      = 0; //"Filter by..."
            cbbPaymentTerms.SelectedIndex  = 0; //"Select"
            cbbDeliveryTerms.SelectedIndex = 0; // "Select"
            //txtItemName.Text = dgvItemSelection.SelectedRows[0].Cells["ItemName"].Value.ToString(); --> Moved to cbbSupplierName_SelectedIndexChanged

            rfqOrderLineList = new ArrayList();

            //---ADJUST DATAGRIDVIEW COLUMN ALIGNMENT
            //Center column headings
            dgvItemSelection.Columns["UOM"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvItemSelection.Columns["UOM"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQItems.Columns["RFQUOM"].HeaderCell.Style.Alignment   = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQItems.Columns["Qty"].HeaderCell.Style.Alignment      = DataGridViewContentAlignment.MiddleCenter;
            //Center column cell contents
            dgvItemSelection.Columns["PartNo"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvItemSelection.Columns["UOM"].DefaultCellStyle.Alignment    = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQItems.Columns["RFQUOM"].DefaultCellStyle.Alignment      = DataGridViewContentAlignment.MiddleCenter;
            dgvRFQItems.Columns["Qty"].DefaultCellStyle.Alignment         = DataGridViewContentAlignment.MiddleCenter;
            //Right-align column headings
            dgvItemSelection.Columns["UnitPrice"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            //Right-align column cell contents
            dgvItemSelection.Columns["UnitPrice"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
        }