Example #1
0
        private void LogOutLabel_Click(object sender, EventArgs e)
        {
            DialogResult ret;

            ret = MessageBox.Show("هل انت متأكد , سيتم اغلاق جميع المعاملات بدون حفط تلقائي؟", "تسجيل الخروج".ToUpper(), MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            if (ret == DialogResult.Yes)
            {
                SharedVariables.is_user_logged = false;
                UserLoggedTxt.Text             = "Not Logged In";
                foreach (Form childForm in MdiChildren)
                {
                    childForm.Dispose();
                    childForm.Close();
                }
                LoginAgainAfterLogout();
                //login aLogin = new login();
                //aLogin.IsFirstLogin = true;
                //aLogin.Show();
                PrivilegesManager.ClearCurrentTemplate();
            }
            else
            {
                return;
            }
        }
Example #2
0
 private void ListUsersDgView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditUsers) == EventStatus.Permit)
         {
             Users aUserDataRow = new Users();
             aUserDataRow.User_Name        = ListUsersDgView.Rows[e.RowIndex].Cells["Namecol"].Value.ToString();
             aUserDataRow.User_Address     = ListUsersDgView.Rows[e.RowIndex].Cells["Address"].Value.ToString();
             aUserDataRow.User_Phone1      = ListUsersDgView.Rows[e.RowIndex].Cells["Phone1"].Value.ToString();
             aUserDataRow.User_Phone2      = ListUsersDgView.Rows[e.RowIndex].Cells["Phone2"].Value.ToString();
             aUserDataRow.User_UserName    = ListUsersDgView.Rows[e.RowIndex].Cells["UserName"].Value.ToString();
             aUserDataRow.User_Password    = ListUsersDgView.Rows[e.RowIndex].Cells["Password"].Value.ToString();
             aUserDataRow.User_Description = ListUsersDgView.Rows[e.RowIndex].Cells["Description"].Value.ToString();
             EditUser aEditUser = new EditUser();
             aEditUser.ControlBox      = true;
             aEditUser.MaximizeBox     = true;
             aEditUser.FormBorderStyle = FormBorderStyle.Fixed3D;
             aEditUser.Show();
             aEditUser.UpdateVariables(ListUsersDgView.Rows[e.RowIndex].Cells["UserName"].Value.ToString());
         }
         else
         {
             MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [ListUsers:ListUsersDgView_CellDoubleClick()] \n Exception: \n" + ex.ToString(), MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         throw;
     }
 }
Example #3
0
 private void ListVendorsDGView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditVendors) == EventStatus.Permit)
         {
             if (e.RowIndex >= 0)
             {
                 DataRow aVendorDataRow = VendorsMgmt.SelectVendorRowByName(ListVendorsDGView.Rows[e.RowIndex].Cells["Namecol"].Value.ToString());
                 if (aVendorDataRow == null)
                 {
                     ListVendorsBtn.PerformClick();
                 }
                 else
                 {
                     EditVendor aEditVendor = new EditVendor();
                     aEditVendor.TopMost = true;
                     aEditVendor.UpdateVariables(aVendorDataRow);
                     aEditVendor.Show();
                 }
             }
         }
         else
         {
             MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [ListVendors:ListVendorsDGView_CellDoubleClick()] \n Exception: \n" + ex.ToString(), MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         throw;
     }
 }
Example #4
0
 private void LogotTemp_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.IsTempActive)
     {
         PrivilegesManager.IsTempActive = false;
         //LogotTemp.Visible = false;
         PrivilegesManager.ClearTempTemplate();
     }
 }
Example #5
0
 private void TempLogoutRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.IsTempActive)
     {
         PrivilegesManager.IsTempActive = false;
         TempLogoutRibnBtn.Visible      = false;
         PrivilegesManager.ClearTempTemplate();
         LoggedUsrTxtLbl.Text = SharedVariables.user_logged_name + ": " + SharedVariables.user_logged_name_name;
     }
 }
Example #6
0
 private void logoutTempToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.IsTempActive)
     {
         PrivilegesManager.IsTempActive      = false;
         logoutTempToolStripMenuItem.Visible = false;
         PrivilegesManager.ClearTempTemplate();
         UserLoggedTxt.Text = SharedVariables.user_logged_name + ": " + SharedVariables.user_logged_name_name;
     }
 }
Example #7
0
 private void TouchScreenRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.TouchScreen) == EventStatus.Permit)
     {
         TouchScreenFrm aTouchScreen = new TouchScreenFrm();
         __AddTabPage(aTouchScreen, __POSColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #8
0
 private void ReportsRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.Reports) == EventStatus.Permit)
     {
         ReportsFrm aReportsFrm = new ReportsFrm();
         __AddTabPage(aReportsFrm, __ReportsColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #9
0
 private void ConnStringRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.DataBaseSettings) == EventStatus.Permit)
     {
         ConnStringFrm aConnStringFrm = new ConnStringFrm();
         __AddTabPage(aConnStringFrm, __ToolsColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #10
0
 private void DatabaseRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.DataBaseSettings) == EventStatus.Permit)
     {
         BackupManager.BackupFrm aBackupFrm = new BackupManager.BackupFrm();
         aBackupFrm.Show();
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #11
0
 private void DisposeItemsRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.DisposeItems) == EventStatus.Permit)
     {
         DisposeItems aDisposeItems = new DisposeItems();
         __AddTabPage(aDisposeItems, __InventoryColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #12
0
 private void EditCustomersRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditCustomers) == EventStatus.Permit)
     {
         EditCustomer aEditCustomer = new EditCustomer();
         __AddTabPage(aEditCustomer, __CustomersColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #13
0
 private void AddVendorPaymentRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.AddVendorPayment) == EventStatus.Permit)
     {
         AddVendorPayment aAddVendorPayment = new AddVendorPayment();
         __AddTabPage(aAddVendorPayment, __VendorsColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #14
0
 private void NewPurchaseVoucherRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.PurchaseVoucher) == EventStatus.Permit)
     {
         PurchaseVoucher aPurchaseVoucher = new PurchaseVoucher();
         __AddTabPage(aPurchaseVoucher, __PurchaseColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #15
0
 private void AdjustInvRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.AdjustItems) == EventStatus.Permit)
     {
         AdjustItemsFrm aAdjustItemsFrm = new AdjustItemsFrm();
         __AddTabPage(aAdjustItemsFrm, __InventoryColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #16
0
 private void WeightSettingsRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.WeightEditing) == EventStatus.Permit)
     {
         WeightConfig aWeightConfig = new WeightConfig();
         __AddTabPage(aWeightConfig, __InventoryColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #17
0
 private void ListUsersRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.ListUsers) == EventStatus.Permit)
     {
         ListUsers aListUsers = new ListUsers();
         __AddTabPage(aListUsers, __ToolsColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #18
0
 private void CustDebitCreditRbnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.CustomerDebitCredit) == EventStatus.Permit)
     {
         CustomerDebitCredit aCustDebitCredit = new CustomerDebitCredit();
         __AddTabPage(aCustDebitCredit, __CustomersColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #19
0
 private void EditBillRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditBills) == EventStatus.Permit)
     {
         ChooseBillToEdit aChooseBillToEdit = new ChooseBillToEdit();
         __AddTabPage(aChooseBillToEdit, __POSColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #20
0
 private void MakeSaleRibnBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.POS) == EventStatus.Permit)
     {
         POS aPos = new POS();
         __AddTabPage(aPos, __POSColor);
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #21
0
 private void EditItemBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditItems) == EventStatus.Permit)
     {
         EditItems aEditItem = new EditItems();
         aEditItem.Show();
         //aEditItem.MdiParent = Helper.Instance.ActiveMainWindow;
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #22
0
 private void ListCustomersBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.ListCustomers) == EventStatus.Permit)
     {
         ListCustomers aListCustomers = new ListCustomers();
         aListCustomers.Show();
         //  aListCustomers.MdiParent = Helper.Instance.ActiveMainWindow;
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #23
0
 private void PointOfSaleBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.POS) == EventStatus.Permit)
     {
         POS aPOS = new POS();
         aPOS.Show();
         //aPOS.MdiParent = Helper.Instance.ActiveMainWindow;
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #24
0
 private void AddVendorBtn_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.AddVendor) == EventStatus.Permit)
     {
         AddVendor aAddVendor = new AddVendor();
         //  aAddVendor.MdiParent = Helper.Instance.ActiveMainWindow;
         aAddVendor.Show();
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #25
0
 private void newPurchaseVoucherToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.PurchaseVoucher) == EventStatus.Permit)
     {
         PurchaseVoucher aPurchaseVoucher = new PurchaseVoucher();
         aPurchaseVoucher.Show();
         //  aPurchaseVoucher.MdiParent = Helper.Instance.ActiveMainWindow;
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #26
0
 private void addNewCustomerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.AddCustomer) == EventStatus.Permit)
     {
         AddCustomer aAddCustomer = new AddCustomer();
         ///   aAddCustomer.MdiParent = Helper.Instance.ActiveMainWindow;
         aAddCustomer.Show();
         //  aAddCustomer.WindowState = FormWindowState.Normal;
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #27
0
 private void listBillsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.ListBills) == EventStatus.Permit)
     {
         ListBills aListBills = new ListBills();
         aListBills.Show();
         //   aListBills.MdiParent = Helper.Instance.ActiveMainWindow;
         aListBills.Dock = DockStyle.Fill;
         aListBills.BringToFront();
     }
     else
     {
         MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #28
0
        private void editUsersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditUsers) == EventStatus.Permit)
            {
                EditUser aEditUser = new EditUser();
                aEditUser.Visible = false;
                //aEditUser.MdiParent = Helper.Instance.ActiveMainWindow;
                aEditUser.Activate();
                aEditUser.Visible = true;
//                aEditUser.Show();
            }
            else
            {
                MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #29
0
 private void EditAdminsBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditAdmins) == EventStatus.Permit)
         {
             EditAdmins aEditAdmin = new EditAdmins();
             //   aEditAdmin.MdiParent = Helper.Instance.ActiveMainWindow;
             aEditAdmin.ShowDialog();
         }
         else
         {
             MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(MsgTxt.UnexpectedError + "\n IN [EditAdminsBtn_Click] \n Exception: \n" + ex.ToString() + "\n" + MsgTxt.FormWillCloseNowTxt, MsgTxt.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #30
0
 private void editBillToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (PrivilegesManager.GetEventStatues(Calcium_RMS.Events.EditBills) == EventStatus.Permit)
         {
             ChooseBillToEdit aChooseBillToEdit = new ChooseBillToEdit();
             // aChooseBillToEdit.MdiParent = Helper.Instance.ActiveMainWindow;
             aChooseBillToEdit.Show();
         }
         else
         {
             MessageBox.Show(MsgTxt.PrivUserNotAllowedTxt, MsgTxt.InformationCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }