Ejemplo n.º 1
0
        /// <summary>
        /// load the current product record 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 FrmProduct(long pLongID, Boolean pBlnReadOnly)
        {
            InitializeComponent();
            _product = new Product(pLongID); // create a new instance of the Product and pass it the Primary Key
            displayRecord(); // display the current record

            _blnReadOnly = pBlnReadOnly; // pass the parameter value of the Primary Key to the global Variable
            _lngPKID = pLongID; // give the global boolean value the value of the parameter value

            organizeFormForReadOnly(); // organize the form fields after we get the read only value
        }
Ejemplo n.º 2
0
        Boolean _blnReadOnly; // A boolean to determine if the current user permission is read only

        #endregion 

        #region Constructor 
        /// <summary>
        /// Create a new Product
        /// </summary>
        public FrmProduct()
        {
            InitializeComponent();
            _product = new Product(); // new product instance 

        }
Ejemplo n.º 3
0
 private void mnuDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to delete the selected record?",
                      "Delete selected Record?", MessageBoxButtons.YesNo,
                      MessageBoxIcon.Question) == DialogResult.Yes)
     {
         _product = new Product(_lngPKID);  // create a new istance of branch and pass it the primary key
         _blnActive = false; // set the current active state to false
         AssignData(); // assign the values of the fields in this forms to the class properties
         _product.saveData(); // now save this current record
         this.Close(); // close after a succesfull save
     }
 }