Пример #1
0
        private void dgvData_DoubleClick(object sender, EventArgs e)
        {
            long lngPKID = 0;
            if (_initFrmIndex.Equals(1))
            {
                if (dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmEmployee frm = new frmEmployee(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(2))
            {
                if (dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmCustomer frm = new frmCustomer(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (_initFrmIndex.Equals(3))
            {
                if (dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmOrders frm = new frmOrders(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (_initFrmIndex.Equals(4))
            {
                if (dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmProduct frm = new frmProduct(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(5))
            {
                if (dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmSupplier frm = new frmSupplier(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(6))
            {
                if (dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmSupplierPurchase frm = new frmSupplierPurchase(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(7))
            {
                if (dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmRawIngredients frm = new frmRawIngredients(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(8))
            {
                if (dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmBranch frm = new frmBranch(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (_initFrmIndex.Equals(9))
            {
                if (dgvData["EmployeeFormID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["EmployeeFormID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmPermissions frm = new frmPermissions(lngPKID, _blnIsUserPermissionsReadOnly);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            
        }
Пример #2
0
        private void dgvData_DoubleClick(object sender, EventArgs e)
        {

            long lngPKID = 0;
            if (txtSearch.Text.Equals("Employee"))
            {
                if (dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["EmployeeID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmEmployee frm = new frmEmployee(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Customer"))
            {
                if (dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["CustomerID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmCustomer frm = new frmCustomer(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Branch"))
            {
                if (dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["BranchID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmBranch frm = new frmBranch(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Product"))
            {
                if (dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["ProductID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmProduct frm = new frmProduct(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Raw Ingredients"))
            {
                if (dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["RawIngredientsID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmRawIngredients frm = new frmRawIngredients(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Orders"))
            {
                if (dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["OrderNumber", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmOrders frm = new frmOrders(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }

            if (txtSearch.Text.Equals("Supplier"))
            {
                if (dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["SupplierID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmSupplier frm = new frmSupplier(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
            if (txtSearch.Text.Equals("Supplier Purchase"))
            {
                if (dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString() != string.Empty)
                {
                    lngPKID = long.Parse(dgvData["PurchaseID", dgvData.CurrentCell.RowIndex].Value.ToString());
                    frmSupplierPurchase frm = new frmSupplierPurchase(lngPKID);
                    frm.MdiParent = this.MdiParent;
                    frm.Show();
                }
            }
        }
Пример #3
0
 private void mnuAddSupplierPurchase_Click(object sender, EventArgs e)
 {
     frmSupplierPurchase supplierpurchaseFrm = new frmSupplierPurchase();
     supplierpurchaseFrm.MdiParent = this;
     supplierpurchaseFrm.Text = "Supplier Purchase" + ++_intCounter;
     supplierpurchaseFrm.Show();
 }