ErrorCollection _errorCollection; // create an instance of the error collection class; #endregion #region Constructor /// <summary> /// Create a new Order /// </summary> public FrmOrder() { InitializeComponent(); _order = new Order(); // make an new instance of Order populateCustomerCombo(); // populate customer combo box populateProductCombo(); // populate product combo box dgvOrderLines.DataSource = _order.getOrderLinesTable(); // get the order lines table dgvOrderLines.Columns[0].Visible = false; // set the columns to invisible dgvOrderLines.Columns[6].Visible = false; dgvOrderLines.Columns["ProductID"].Visible = false; }
/// <summary> /// load the current Order by getting the Primary key /// Pass a boolean to determine is the User Permission is read only for later use /// </summary> /// <param name="pLongID"></param> /// <param name="pBlnReadOnly"></param> public FrmOrder(long pLongID, Boolean pBlnReadOnly) { InitializeComponent(); _order = new Order(pLongID); // make an new instance of Order populateCustomerCombo(); // populate customer combo box populateProductCombo(); // populate product combo box dgvOrderLines.DataSource = _order.getOrderLinesTable(); // get the order lines table dgvOrderLines.Columns[0].Visible = false; // set the columns to invisible dgvOrderLines.Columns[6].Visible = false; dgvOrderLines.Columns["ProductID"].Visible = false; displayRecord(); // display the current record _lngPKID = pLongID; // pass the parameter value of the Primary Key to the global Variable _blnReadOnly = pBlnReadOnly; // give the global boolean value the value of the parameter value organizeFormForReadOnly(); // organize the form fields after we get the read only value mnuDeleteOrder.Enabled = true; }