private void mnuSupplierPurchase_Click(object sender, EventArgs e)
 {
     FrmSupplierPurchase supplierPurchaseFrm = new FrmSupplierPurchase();
     supplierPurchaseFrm.MdiParent = this;
     supplierPurchaseFrm.Show();
 }
Example #2
0
 private void dgvData_DoubleClick(object sender, EventArgs e)
 {
     // set the primary key to 0
     long lngPKID = 0;
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(1))
     {
         // if the ID of current row is not empty 
         if (dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmEmployee frm = new FrmEmployee(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             frm.MdiParent = this.MdiParent;
             frm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new employee and show the form 
                 FrmEmployee employeeFrm = new FrmEmployee();
                 employeeFrm.MdiParent = this.MdiParent;
                 employeeFrm.Show();
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(2))
     {
         // if the ID of current row is not empty
         if (dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmCustomer customerFrm = new FrmCustomer(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             customerFrm.MdiParent = this.MdiParent;
             customerFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new customer and show the form 
                 FrmCustomer customerFrm = new FrmCustomer();
                 customerFrm.MdiParent = this.MdiParent;
                 customerFrm.Show();
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(3))
     {
         // if the ID of current row is not empty
         if (dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmOrder orderFrm = new FrmOrder(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             orderFrm.MdiParent = this.MdiParent;
             orderFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new order and show the form 
                 FrmOrder orderFrm = new FrmOrder();
                 orderFrm.MdiParent = this.MdiParent;
                 orderFrm.Show();
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(4))
     {
         // if the ID of current row is not empty
         if (dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmProduct productFrm = new FrmProduct(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             productFrm.MdiParent = this.MdiParent;
             productFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new product and show the form 
                 FrmProduct productFrm = new FrmProduct();
                 productFrm.MdiParent = this.MdiParent;
                 productFrm.Show();   
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(5))
     {
         // if the ID of current row is not empty
         if (dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmSupplier supplierFrm = new FrmSupplier(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             supplierFrm.MdiParent = this.MdiParent;
             supplierFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new supplier and show the form 
                 FrmSupplier supplierFrm = new FrmSupplier();
                 supplierFrm.MdiParent = this.MdiParent;
                 supplierFrm.Show();
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(6))
     {
         // if the ID of current row is not empty
         if (dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmSupplierPurchase supplierPurchaseFrm = new FrmSupplierPurchase(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             supplierPurchaseFrm.MdiParent = this.MdiParent;
             supplierPurchaseFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new supplier purchase and show the form 
                 FrmSupplierPurchase supplierPurchaseFrm = new FrmSupplierPurchase();
                 supplierPurchaseFrm.MdiParent = this.MdiParent;
                 supplierPurchaseFrm.Show();   
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(7))
     {
         // if the ID of current row is not empty
         if (dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmRawIngredients rawIngredientsFrm = new FrmRawIngredients(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             rawIngredientsFrm.MdiParent = this.MdiParent;
             rawIngredientsFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new raw ingredient and show the form 
                 FrmRawIngredients rawIngredientsFrm = new FrmRawIngredients();
                 rawIngredientsFrm.MdiParent = this.MdiParent;
                 rawIngredientsFrm.Show();   
             }
         }
     }
     // if the frm index is eqauled to the correct index
     if (_initFrmIndex.Equals(8))
     {
         // if the ID of current row is not empty
         if (dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
         {
             // give the primary key variable the currently selected rows ID value
             lngPKID = long.Parse(dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString());
             FrmBranch branchFrm = new FrmBranch(lngPKID, _blnIsUserPermissionsReadOnly); // pass the id to the form contructor paremter values and the boolean to see if the user permission is read only 
             branchFrm.MdiParent = this.MdiParent;
             branchFrm.Show();
         }
         else
         {
             // if the user permission is not read only 
             if (_blnIsUserPermissionsReadOnly.Equals(false))
             {
                 // create a new branch and show the form 
                 FrmBranch branchFrm = new FrmBranch();
                 branchFrm.MdiParent = this.MdiParent;
                 branchFrm.Show();
             }
         }
     }
 }