Exemplo n.º 1
0
        public CResult ProcessAdminLogin(CUserInfo inUserInfo)
        {
            CResult oNewResult = new CResult();

            try
            {
                CUserManager oManager = new CUserManager();



                CResult oResult = oManager.LoginAdminUser(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);
        }
Exemplo n.º 2
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;
                    }
                }
            }
        }