コード例 #1
0
        private void _moAddContactEmail_btnAddToQueue_OnClick(object sender, AddEmailVerifyContact.ContactEmailArgs e)
        {
            //m_lstContactEmailQueuer
            BrightPlatformEntities efDbModel = new BrightVision.Model.BrightPlatformEntities(UserSession.EntityConnection);
            foreach (CTEmailVerifyContact _item in e.lstEmailVerifyContacts)
            {
                if (m_lstContactEmails == null)
                    m_lstContactEmails = new List<Email.ContactEmail>();

                else if (m_lstContactEmails.Find(x => x.contact_id == _item.contact_id) != null)
                    continue;

                _item.email_verify_attempt_1 = _item.email_verify_attempt_1 == null ? 0 : _item.email_verify_attempt_1;
                _item.email_verify_attempt_2 = _item.email_verify_attempt_2 == null ? 0 : _item.email_verify_attempt_2;
                _item.email_verify_attempt_3 = _item.email_verify_attempt_3 == null ? 0 : _item.email_verify_attempt_3;

                Email.ContactEmail _ContactEmail = new Email.ContactEmail();
                _ContactEmail.company_name = _item.company_name;
                _ContactEmail.contact_id = _item.contact_id;
                _ContactEmail.email = _item.email;
                _ContactEmail.last_verified_by = _item.email_last_verified_by == null ? 0 : (int)_item.email_last_verified_by;
                _ContactEmail.last_verified_date = _item.email_last_verified_on;
                _ContactEmail.name = _item.first_name + " " + _item.last_name;
                _ContactEmail.s_verify_attempt_1 = Email.GetVerifyCodeValue((short)_item.email_verify_attempt_1);
                _ContactEmail.s_verify_attempt_2 = Email.GetVerifyCodeValue((short)_item.email_verify_attempt_2);
                _ContactEmail.s_verify_attempt_3 = Email.GetVerifyCodeValue((short)_item.email_verify_attempt_3);
                _ContactEmail.selected = true;
                _ContactEmail.verify_attempt_1 = (short)_item.email_verify_attempt_1;
                _ContactEmail.verify_attempt_2 = (short)_item.email_verify_attempt_2;
                _ContactEmail.verify_attempt_3 = (short)_item.email_verify_attempt_3;
                _ContactEmail.verify_no = _item.email_verify_attempt_1.ToString() + _item.email_verify_attempt_2.ToString() + _item.email_verify_attempt_3.ToString();
                m_lstContactEmails.Add(_ContactEmail);
            }

            this.LoadContactEmails();
        }
コード例 #2
0
        private void FrmSalesConsultant_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.CampaignBooking_DialogEditor_OnEditMode()) {
                NotificationDialog.Information("Bright Sales", "Dialog is currently on edit mode.");
                e.Cancel = true;
                return;
            }

            if (m_BrightSalesProperty.CommonProperty.OnCallMode) {
                NotificationDialog.Information("Bright Sales", "Call is already in progress. Please hang-up and save call log first.");
                e.Cancel = true;
                return;
            }
            else if (!m_BrightSalesProperty.CommonProperty.CallLogSaved) {
                NotificationDialog.Error("Bright Sales", "Please kindly save your call log first.");
                e.Cancel = true;
                return;
            }

            if (m_CampaignBookingModule != null) {
                this.CampaignBookingDataSaved();
                m_CampaignBookingModule.SaveCampaignBooking();
            }

            if (DoneLoggedIn) {
                if (this.TerminateApplication()) {
                    try
                    {
                        //Stop BrightVision Audio Uploader
                        //((new Utilities.WindowsAzureStorageBlobUtility()).CheckBlobFileExists(followUpId, audioId, IsNew))
                        (new BrightVision.Common.Utilities.WindowsAzureStorageBlobUtility()).ForceCloseBrightVisionAudioUploaderApp();

                        var BPContext = new BrightVision.Model.BrightPlatformEntities(UserSession.EntityConnection);
                        //BPContext.FIRelaseUserLock(UserSession.CurrentUser.UserId);
                        Business.ObjectLocking.ReleaseUserLock();

                        //fileUploadManager.Stop();
                        m_oFollowUpDialog.Close();

                        if (m_oCallLogBar.PhoneRegisterSuccess)
                            m_oCallLogBar.UnRegisterPhone();

                        m_oCallLogBar.KillClockThread();
                        DoneLoggedIn = false;
                        Application.Exit();
                        //Environment.FailFast(string.Empty);
                    }
                    catch (Exception ex) {
                        m_EventBus.Notify(new FrmSalesConsultantEvents.Tracer() {
                            ErrorMessage = ex.Message
                        });
                    }
                }
                else
                    e.Cancel = true;
            }
        }