Example #1
0
        private void btnChangePassword_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (UserSession.CurrentUser.UserId <= 0)
            {
                NotificationDialog.Error("Bright Sales", "You haven't yet log in properly.");
                return;
            }

            m_frmChangePassword = new ChangePassword() {
                StartPosition = FormStartPosition.CenterParent
            };
            m_frmChangePassword.InvalidOldPassword -= m_frmChangePassword_InvalidOldPassword;
            m_frmChangePassword.InvalidOldPassword += m_frmChangePassword_InvalidOldPassword;
            m_frmChangePassword.PasswordsDoesNotMatch -= m_frmChangePassword_PasswordsDoesNotMatch;
            m_frmChangePassword.PasswordsDoesNotMatch += m_frmChangePassword_PasswordsDoesNotMatch;
            m_frmChangePassword.AfterSave -= m_frmChangePassword_AfterSave;
            m_frmChangePassword.AfterSave += m_frmChangePassword_AfterSave;
            m_frmChangePassword.PasswordsMustBeDifferent -= m_frmChangePassword_PasswordsMustBeDifferent;
            m_frmChangePassword.PasswordsMustBeDifferent += m_frmChangePassword_PasswordsMustBeDifferent;
            m_frmChangePassword.ShowDialog(this);
        }
Example #2
0
        private void objFrmUserLogin_AfterLogin()
        {
            /*
             * Start Bright Vision WindowsAzureStorageBlob Uploading Utility Application
             */
            (new Utils.WindowsAzureStorageBlobUtility()).RunWindowsAzureStorageBlob();
            (new Utils.WindowsAzureStorageBlobUtility()).RunMoveFailedAudioFile();

            //this.Text = "BrightSales     User: "******"BuildEnvironment") + " - " + UserSession.CurrentUser.UserFullName;
            this.WindowState = FormWindowState.Maximized;
            this.DoneLoggedIn = true;
            this.SetFormControls(true);
            this.SetBrightManagerTab();
            this.LoadCampaignListSelection();
            if (m_CampaignListModule != null)
                m_CampaignListModule.SetExtraDetailModuleAsReadOnly(false);

            m_UserLogin.AfterLogin -= new UserLogin.AfterLoginEventHandler(objFrmUserLogin_AfterLogin);
            if (!m_oCallLogBar.PhoneRegisterSuccess) {
                BackgroundWorker _bw = new BackgroundWorker() {
                    WorkerSupportsCancellation = true
                };
                _bw.DoWork += new DoWorkEventHandler(_bw_DoWork);
                _bw.RunWorkerAsync();
                //m_oCallLogBar.RegisterPhone();
            }

            audio_settings _item = AudioSettingUtility.GetUserAudioSetting();

            /*
             * https://brightvision.jira.com/browse/PLATFORM-2375
             * Will only going to check if Phone setting is set to internal.
            */
            if (_item != null && _item.mode == 0)
            {
                if (!FacadeSoftPhone.MicrophoneDeviceOk() || !FacadeSoftPhone.SpeakerDeviceOk())
                {
                    NotificationDialog.Information("Bright Sales", "No microphone/speaker device found.");
                    return;
                }

                if (_item.mic_volume == null || _item.speaker_volume == null)
                {
                    NotificationDialog.Information("Bright Sales", "Microphone/speaker settings not yet set.");
                    PopupDialog dialog = new PopupDialog(new AudioSettings(), "Phone Settings");
                    dialog.ShowDialog(this);
                    return;
                }
            }

            user _eftUser = null;
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                _eftUser = _efDbContext.users.FirstOrDefault(i => i.id == UserSession.CurrentUser.UserId);
                _efDbContext.Detach(_eftUser);
            }

            if (_eftUser.password.ToLower() == HashUtility.GetHashPassword("1234").ToLower()) {
                NotificationDialog.Information("Bright Sales", "Please kindly update your password first.");
                m_frmChangePassword = new ChangePassword(true) {
                    StartPosition = FormStartPosition.CenterParent
                };
                m_frmChangePassword.InvalidOldPassword -= m_frmChangePassword_InvalidOldPassword;
                m_frmChangePassword.InvalidOldPassword += m_frmChangePassword_InvalidOldPassword;
                m_frmChangePassword.PasswordsDoesNotMatch -= m_frmChangePassword_PasswordsDoesNotMatch;
                m_frmChangePassword.PasswordsDoesNotMatch += m_frmChangePassword_PasswordsDoesNotMatch;
                m_frmChangePassword.AfterSave -= m_frmChangePassword_AfterSave;
                m_frmChangePassword.AfterSave += m_frmChangePassword_AfterSave;
                m_frmChangePassword.PasswordsMustBeDifferent -= m_frmChangePassword_PasswordsMustBeDifferent;
                m_frmChangePassword.PasswordsMustBeDifferent += m_frmChangePassword_PasswordsMustBeDifferent;
                m_frmChangePassword.ShowDialog(this);
            }
        }