Ejemplo n.º 1
0
        public CSystemManagementForm()
        {
            InitializeComponent();

            CMouseConfig tempMouseConfig = ConfigManager.GetConfig<CMouseConfig>();
            CCommonConstants tempCommonConstants = ConfigManager.GetConfig<CCommonConstants>();

            CUserAccess tempUserAccess = tempCommonConstants.UserInfo.UserAccess;
            ExitButton.Enabled = tempUserAccess.ExitRms == 1;
            MergeTableButton.Enabled = tempUserAccess.MergeTable == 1;
            OpenDrawerButton.Enabled = tempUserAccess.OpenDrawer == 1;
            ReviewTransactionButton.Enabled = tempUserAccess.ReviewTransaction == 1;
            TillReportingButton.Enabled = tempUserAccess.TillReporting == 1;
            TransfertableButton.Enabled = tempUserAccess.TransferTable == 1;
            ViewReportButton.Enabled = tempUserAccess.ViewReport == 1;
            VoidTableButton.Enabled = tempUserAccess.VoidTable == 1;
            UnlockTableButton.Enabled = tempUserAccess.UnlockTable == 1;
            BookingButton.Enabled = tempUserAccess.Booking == 1;

            //if (tempUserAccess.Users == 1)
            //    UserButton.Enabled = true;

            CustomerButton.Enabled = tempUserAccess.Customers == 1;
            DepositButton.Enabled = tempUserAccess.Deposit == 1;
            UpdateItemsButton.Enabled = tempUserAccess.UpdateItems == 1;

            //if (tempUserAccess.LogRegister == 1)
            //    btnLogRecords.Enabled = true;

            //For Log register this code will be optimized later
            CUserManager tempUserManager = new CUserManager();
            CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(tempCommonConstants.UserInfo).Data;
            //if (tempUserAccess2.LogRegister == 1)
            //    btnLogRecords.Enabled = true;
            //if (tempUserAccess2.ProcessDeliveryTime == 1)
            //{
            //    btnSetDefaultTime.Enabled = true;
            //}
            //if (tempUserAccess2.KitchenText == 1)
            //{
            //    btnKitchenText.Enabled = true;
            //}
            btnSystemSettings.Enabled = tempUserAccess2.SystemSettings == 1;

               // LoadGraph();

            //lblVersionNumber.Text = RMSGlobal.m_rmsVersionNumber;
        }
Ejemplo n.º 2
0
        private void CUserInfoForm_Load(object sender, EventArgs e)
        {
            try
            {
                if (m_sOpType.Equals("Update"))
                {
                    NameTextBox.Text = m_oUserInfo.UserName;
                    PasswordTextBox.Text = m_oUserInfo.Password;
                    ConfirmPassTextBox.Text = m_oUserInfo.Password;
                    UserTypeComboBox.SelectedItem = CUserConstant.GetUSerConstant(m_oUserInfo.Type);

                    if (m_oUserInfo.Gender.ToLower().Equals("male")) GenderComboBox.SelectedIndex = 0;
                    else if (m_oUserInfo.Gender.ToLower().Equals("female")) GenderComboBox.SelectedIndex = 1;

                    if (m_oUserInfo.Status == 1) ActiveRadioButton.Checked = true;
                    else if (m_oUserInfo.Status == 0) InActiveRadioButton.Checked = true;

                    CUserManager tempUserManager = new CUserManager();
                    CUserAccess tempUserAccess = (CUserAccess)tempUserManager.GetUserAccess(m_oUserInfo).Data;

                    if (tempUserAccess.MergeTable == 1) MergeCheckBox.Checked = true;
                    if (tempUserAccess.OpenDrawer == 1) OpenDrawerCheckBox.Checked = true;
                    if (tempUserAccess.ReviewTransaction == 1) ReviewCheckBox.Checked = true;
                    if (tempUserAccess.TillReporting == 1) TillCheckBox.Checked = true;
                    if (tempUserAccess.TransferTable == 1) TransferCheckBox.Checked = true;
                    if (tempUserAccess.UnlockTable == 1) UnlockCheckBox.Checked = true;
                    if (tempUserAccess.ViewReport == 1) ViewCheckBox.Checked = true;
                    if (tempUserAccess.VoidTable == 1) VoidCheckBox.Checked = true;
                    if (tempUserAccess.ExitRms == 1) ExitCheckBox.Checked= true;
                    if (tempUserAccess.Customers == 1) CustomersCheckBox.Checked = true;
                    if (tempUserAccess.Users == 1) UsersCheckBox.Checked = true;
                    if (tempUserAccess.Booking == 1) BookingCheckBox.Checked = true;
                    if (tempUserAccess.Deposit == 1) DepositCheckBox.Checked = true;
                    if (tempUserAccess.UpdateItems == 1) UpdateItemCheckBox.Checked = true;
                    if (tempUserAccess.RemoveItems == 1) chkRemoveItems.Checked = true;
                    if (tempUserAccess.LogRegister == 1) chkLogRegister.Checked = true;

                    if (tempUserAccess.ProcessDeliveryTime == 1) chkProcessTime.Checked = true;
                    if (tempUserAccess.KitchenText == 1) chkManageKitchenText.Checked = true;

                    if (tempUserAccess.SystemSettings == 1) chkSettings.Checked = true;

                }
                m_cCurrentControl = NameTextBox;
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 3
0
        public CResult ProcessLogin(CUserInfo inUserInfo)
        {
            CResult oNewResult = new CResult();
            try
            {
                CUserManager oManager = new CUserManager();
                CResult oResult = oManager.LoginUser(inUserInfo);
                if (oResult.IsSuccess && oResult.Data != null)
                {
                    CUserInfo oUser = (CUserInfo)oResult.Data;
                    CResult oResult2 = oManager.GetUserAccess(oUser);
                    if (oResult2.IsSuccess && oResult2.Data != null)
                    {
                        CUserAccess oUserAccess = (CUserAccess)oResult2.Data;

                        oUser.UserAccess = oUserAccess;

                        CUserLogin oUserLogin = new CUserLogin();

                        oUserLogin.UserInfo = oUser;

                        CDalConfig oTempDal = ConfigManager.GetConfig<CDalConfig>();

                        String tempConnStr = oTempDal.ConnectionString;

                        oUserLogin.ConnectionStr = tempConnStr;

                        oNewResult.Data = oUserLogin;

                        oNewResult.IsSuccess = true;

                    }
                }
            }
            catch (Exception ex)
            {
            }
            return oNewResult;
        }
Ejemplo n.º 4
0
        private void LoadExistingData()
        {
            CUserInfo oUserInfo = new CUserInfo();

            oUserInfo.UserID = m_userID;

            CUserAccess oUserAccess = new CUserAccess();

            CUserManager oManager = new CUserManager();

            CResult oResult = oManager.GetUser(oUserInfo);

            if (oResult.IsSuccess && oResult.Data != null)
            {
                oUserInfo = (CUserInfo)oResult.Data;

                txtUserName.Text = oUserInfo.UserName;

                txtPassword.Text = oUserInfo.Password;

                if (oUserInfo.Gender.Trim().Equals("Male"))
                {
                    cmbSex.SelectedIndex = 0;
                }
                else if (oUserInfo.Gender.Trim().Equals("Female"))
                {
                    cmbSex.SelectedIndex = 1;
                }

                if (oUserInfo.Type == 0)
                {
                    cmbUserType.SelectedIndex = 0;
                }

                else if (oUserInfo.Type == 1)
                {
                    cmbUserType.SelectedIndex = 1;
                }

                if (oUserInfo.Status == 1)
                {
                    rdoActive.Checked = true;
                }
                else if (oUserInfo.Status == 0)
                {
                    rdoInActive.Checked = true;
                }

                CResult oResult2 = oManager.GetUserAccess(oUserInfo);

                if (oResult2.IsSuccess && oResult2.Data != null)
                {
                    oUserAccess = (CUserAccess)oResult2.Data;

                    if (oUserAccess.OpenDrawer == 1)
                    {
                        chkOpenDrawer.Checked = true;
                    }

                    if (oUserAccess.VoidTable == 1)
                    {
                        chkVoidTable.Checked = true;
                    }

                    if (oUserAccess.TransferTable == 1)
                    {
                        chkTransferTable.Checked = true;
                    }

                    if (oUserAccess.MergeTable == 1)
                    {
                        chkMergeTable.Checked = true;
                    }

                    if (oUserAccess.ReviewTransaction == 1)
                    {
                        chkReviewTrans.Checked = true;
                    }

                    if (oUserAccess.ViewReport == 1)
                    {
                        chkViewReport.Checked = true;
                    }

                    if (oUserAccess.TillReporting == 1)
                    {
                        chkTillReport.Checked = true;
                    }

                    if (oUserAccess.ExitRms == 1)
                    {
                        chkExitRms.Checked = true;
                    }

                    if (oUserAccess.UnlockTable == 1)
                    {
                        chkUnlockTable.Checked = true;
                    }

                    if (oUserAccess.Booking == 1)
                    {
                        chkBooking.Checked = true;
                    }

                    if (oUserAccess.Users == 1)
                    {
                        chkUsers.Checked = true;
                    }

                    if (oUserAccess.Deposit == 1)
                    {
                        chkDeposit.Checked = true;
                    }

                    if (oUserAccess.Customers == 1)
                    {
                        chkCustomer.Checked = true;
                    }

                    if (oUserAccess.UpdateItems == 1)
                    {
                        chkUpdateItems.Checked = true;
                    }

                    if (oUserAccess.RemoveItems == 1)
                    {
                        chkRemoveItems.Checked = true;
                    }

                    if (oUserAccess.LogRegister == 1)
                    {
                        chkLogRegister.Checked = true;
                    }

                    if (oUserAccess.SystemSettings == 1)
                    {
                        chkSettings.Checked = true;
                    }
                    if (oUserAccess.RmsAdminAccess == 1)
                    {
                        chkRmsAdmin.Checked = true;
                    }
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Addred By Baruri at 06.09.2008
 /// </summary>
 private void ActivateButtons()
 {
     CUserManager tempUserManager = new CUserManager();
     CUserAccess tempUserAccess2 = (CUserAccess)tempUserManager.GetUserAccess(m_cCommonConstants.UserInfo).Data;
     if (tempUserAccess2.RemoveItems == 1)
     {
         g_RemoveButton.Enabled = true;
     }
     else
     {
         g_RemoveButton.Enabled = false;
     }
 }