Ejemplo n.º 1
0
 private void LoadUserLoginForm()
 {
     PopupDialog objPopupDialog = new PopupDialog();
     m_UserLogin = new UserLogin(objPopupDialog);
     m_UserLogin.AfterLogin += new UserLogin.AfterLoginEventHandler(objFrmUserLogin_AfterLogin);
     objPopupDialog.IsLogin = true;
     objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     objPopupDialog.MinimizeBox = false;
     objPopupDialog.MaximizeBox = false;
     objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
     objPopupDialog.Text = "Login to Sales Consultant Application";
     objPopupDialog.Controls.Add(m_UserLogin);
     objPopupDialog.ClientSize = new Size(m_UserLogin.Width + 2, m_UserLogin.Height + 2);
     objPopupDialog.ShowDialog(this.ParentForm);
     objPopupDialog.Controls.Remove(m_UserLogin);
     m_UserLogin.AfterLogin -= new UserLogin.AfterLoginEventHandler(objFrmUserLogin_AfterLogin);
     m_UserLogin.Dispose();
     m_UserLogin = null;
 }
Ejemplo n.º 2
0
        private void cmdCreateCollectedData_Click(object sender, EventArgs e)
        {
            if (gvMatchingCompany.RowCount < 1)
                return;

            DialogResult objChoice = MessageBox.Show("Are you sure to generate collected data records for this selected import file?", "Import File", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (objChoice == DialogResult.No)
                return;

            if (m_objImportList == null)
                return;
            else if (m_objImportList.id < 1)
                return;

            //
            //WaitDialog.Show(ParentForm, "Creating collected data.");
            //DataImportUtility.CreateImportListCollectedData(m_objImportList.id);
            ImportCollectedData objImportCollectedData = new ImportCollectedData();
            objImportCollectedData.ImportFileId = m_objImportList.id;
            objImportCollectedData.CustomerId = m_objImportList.customer_id == null ? 0 : m_objImportList.customer_id;
            m_objPopupDialog = new PopupDialog();
            m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
            m_objPopupDialog.MinimizeBox = false;
            m_objPopupDialog.MaximizeBox = false;
            m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
            m_objPopupDialog.Text = "Import File Collected Data";
            m_objPopupDialog.Controls.Add(objImportCollectedData);
            m_objPopupDialog.ClientSize = new Size(objImportCollectedData.Width + 2, objImportCollectedData.Height + 2);
            m_objPopupDialog.ShowDialog(this.ParentForm);
            //WaitDialog.Close();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes the popup dialog for company entry and loads the popup dialog
 /// </summary>
 private void DisplayCompanyForm()
 {
     m_objAddCompanyForm = new AddCompany();
     m_objAddCompanyForm.m_objParentControl = this;
     m_objPopupDialog = new PopupDialog();
     m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     m_objPopupDialog.MinimizeBox = false;
     m_objPopupDialog.MaximizeBox = false;
     m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
     m_objPopupDialog.Text = "Manager Application - Add Company";
     m_objPopupDialog.Controls.Add(m_objAddCompanyForm);
     m_objPopupDialog.ClientSize = new Size(m_objAddCompanyForm.Width + 2, m_objAddCompanyForm.Height + 2);
     m_objPopupDialog.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 4
0
        private void ShowKeyboard()
        {
            if (!m_InCall)
                return;

            PhoneKeyboard keyboard = new PhoneKeyboard();
            keyboard.KeyUp += new MouseUpPhoneKeyboardHandler(keyboard_KeyUp);
            keyboard.KeyDown += new MouseDownPhoneKeyboardHandler(keyboard_KeyDown);
            phoneKeyboard = new PopupDialog(keyboard);
            phoneKeyboard.MinimizeBox = false;
            phoneKeyboard.MaximizeBox = false;
            phoneKeyboard.StartPosition = FormStartPosition.Manual;
            Point locationOnForm = btnKeyPad.FindForm().PointToClient(btnKeyPad.Parent.PointToScreen(btnKeyPad.Location));
            Point loc = new Point(locationOnForm.X-200, locationOnForm.Y + 30);
            phoneKeyboard.Location = loc;
            phoneKeyboard.Owner = this.ParentForm;
            phoneKeyboard.Show();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes the popup dialog for campaign entry and loads the popup dialog
        /// </summary>
        private void DisplayCampaignForm(bool IsNew)
        {
            //if (IsNew)
            //{
            //    m_objAddCampaignForm = new AddCampaign();
            //    m_objAddCampaignForm.isNew = true;
            //}
            //else
            //{
            //    m_objAddCampaignForm = new AddCampaign(AddCampaign.SaveType.SaveTypeEdit, m_objCampaign);
            //    m_objAddCampaignForm.isNew = false;
            //}

            m_objAddCampaignForm = new AddCampaign(AddCampaign.SaveType.SaveTypeEdit, m_objCampaign);
            m_objAddCampaignForm.IsNew = false;
            m_objAddCampaignForm.CustomerId = m_objCustomer.id;
            m_objAddCampaignForm.m_objParentControl = this;
            m_objPopupDialog = new PopupDialog();
            m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
            m_objPopupDialog.MinimizeBox = false;
            m_objPopupDialog.MaximizeBox = false;
            m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
            m_objPopupDialog.Text = "Manager Application - Customers & Campaigns";
            m_objPopupDialog.Controls.Add(m_objAddCampaignForm);
            m_objPopupDialog.ClientSize = new Size(m_objAddCampaignForm.Width + 2, m_objAddCampaignForm.Height + 2);
            m_objPopupDialog.ShowDialog(this.ParentForm);
        }
Ejemplo n.º 6
0
        public FrmSalesConsultant()
        {
            InitializeComponent();

            #region Background Thread for Event Logging
            nextRefreshTime = DateTime.Now;
            refreshInterval = TimeSpan.FromSeconds(0.20);

            stats = new int[6];

            work = new WorkQueue();
            work.ConcurrentLimit = 100;
            work.AllWorkCompleted += new EventHandler(work_AllWorkCompleted);
            work.WorkerException += new ResourceExceptionEventHandler(work_WorkerException);
            work.ChangedWorkItemState += new ChangedWorkItemStateEventHandler(work_ChangedWorkItemState);

            minThreads = ((WorkThreadPool)work.WorkerPool).MinThreads;
            maxThreads = ((WorkThreadPool)work.WorkerPool).MaxThreads;
            concurrentLimit = work.ConcurrentLimit;
            #endregion
            #region Toggle Bar Menu
            m_oCallViewBar = new CallViewBar() {
                Dock = DockStyle.Fill
            };

            m_oCallLogBar = new CallLogBar() {
                Dock = DockStyle.Fill,
                Visible = false
            };

            pnlToggleBar.Controls.Clear();
            pnlToggleBar.Controls.AddRange(new Control[] { m_oCallViewBar, m_oCallLogBar });
            #endregion
            #region Follow Up Popup Window
            m_oFollowUp = new FollowUpEditor() {
                Dock = DockStyle.Fill
            };
            m_oFollowUp.btnSave_OnClick += new FollowUpEditor.btnSaveOnClickEventHandler(m_oFollowUp_btnSave_OnClick);
            m_oFollowUp.GetListSource += new FollowUpEditor.GetListSourceEventHandler(m_oFollowUp_GetListSource);
            m_oFollowUpDialog = new PopupDialog() {
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MinimizeBox = false,
                MaximizeBox = false,
                StartPosition = FormStartPosition.CenterScreen,
                Text = "Follow Up Window",
                ClientSize = new Size(m_oFollowUp.Width + 2, m_oFollowUp.Height + 2),
                CloseBox = false
            };
            m_oFollowUpDialog.Controls.Add(m_oFollowUp);
            //m_oFollowUpDialog.FormClosing += new FormClosingEventHandler(m_oFollowUpDialog_FormClosing);
            #endregion
            #region Call & Follow Up Toggle Bar
            m_oFollowUpBar = new FollowUpBar() {
                Dock = DockStyle.Fill
            };
            //m_oFollowUpBar.btnTop_OnClick += new FollowUpBar.btnTopOnClickEventHandler(m_oFollowUpBar_btnTop_OnClick);
            //m_oFollowUpBar.btnPrevious_OnClick += new FollowUpBar.btnPreviousOnClickEventHandler(m_oFollowUpBar_btnPrevious_OnClick);
            //m_oFollowUpBar.btnNext_OnClick += new FollowUpBar.btnNextOnClickEventHandler(m_oFollowUpBar_btnNext_OnClick);
            //m_oFollowUpBar.btnLoad_OnClick += new FollowUpBar.btnLoadOnClickEventHandler(m_oFollowUpBar_btnLoad_OnClick);
            //m_oFollowUpBar.GetCampaignBookingContactList += new FollowUpBar.GetCampaignBookingContactListEventHandler(m_oFollowUpBar_GetCampaignBookingContactList);
            //m_oFollowUpBar.GetCampaignBookingArgs += new FollowUpBar.GetCampaignBookingArgsEventHandler(m_oFollowUpBar_GetCampaignBookingArgs);
            //m_oFollowUpBar.HasBrowsableData += new FollowUpBar.HasBrowsableDataEventHandler(m_oFollowUpBar_HasBrowsableData);
            //m_oFollowUpBar.HasPendingCallAndLog += new FollowUpBar.HasPendingCallAndLogEventHandler(m_oFollowUpBar_HasPendingCallAndLog);
            //m_oFollowUpBar.btnSave_OnClick += new FollowUpBar.btnSaveOnClickEventHandler(m_oFollowUpBar_btnSave_OnClick);
            //m_oFollowUpBar.LoadFollowUps += new FollowUpBar.LoadFollowUpsEventHandler(m_oFollowUpBar_LoadFollowUps);
            //m_oFollowUpBar.CanWorkOnCompany += new FollowUpBar.CanWorkOnCompanyEventHandler(m_oFollowUpBar_CanWorkOnCompany); //+= new FollowUpBar.DialogOnEditModeEventHandler(m_oFollowUpBar_DialogOnEditMode);

            m_oCallLogRemarksBar = new CallLogRemarks() {
                Dock = DockStyle.Fill,
                Visible = false
            };
            m_oCallLogRemarksBar.btnSaveCallLog_OnClick += new CallLogRemarks.btnSaveCallLogOnClickEventHandler(m_oCallLogRemarksBar_btnSaveCallLog_OnClick);
            m_oCallLogRemarksBar.EndCall_Initiated += new CallLogRemarks.EndCallInitiatedEventHandler(m_oCallLogRemarksBar_EndCall_Initiated);
            m_oCallLogRemarksBar.GetContactPerson += new CallLogRemarks.GetContactPersonEventHandler(m_oCallLogRemarksBar_GetContactPerson);
            m_oCallLogRemarksBar.UserOnCall += new CallLogRemarks.UserOnCallEventHandler(m_oCallLogRemarksBar_UserOnCall);
            m_oCallLogRemarksBar.UserOnCallForceStop += new CallLogRemarks.UserOnCallForceStopEventHandler(m_oCallLogRemarksBar_UserOnCallForceStop);
            pnlCallLogAndFollowUp.Controls.Clear();
            pnlCallLogAndFollowUp.Controls.AddRange(new Control[] {
                m_oFollowUpBar,
                m_oCallLogRemarksBar
            });
            #endregion
            #region Help Information Form
            m_HelpInfo.Shown += new EventHandler(m_HelpInfo_Shown);
            m_HelpInfo.FormClosed += new FormClosedEventHandler(m_HelpInfo_FormClosed);
            #endregion

            this.RegisterEvents();
            this.SetStateCallerBarGroup(false);

            tcSalesConsultant.CustomHeaderButtons[0].Enabled = false;
            tcSalesConsultant.CustomHeaderButtons[0].Visible = false;

            /**
             * https://brightvision.jira.com/browse/PLATFORM-3141
             * disable the mouse wheel scrolling.
             */
            cboCampaignList.MouseWheel += cboCampaignList_MouseWheel;
        }
Ejemplo n.º 7
0
        private void ___bbiDeleteDialog_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (m_oDialog == null)
                return;

            if (CampaignId <= 0 && AccountId <= 0 && FinalListId <= 0 && SubCampaignId <= 0)
                return;

            bool _editable = true;
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection))
            {
                sub_campaign_account_lists _eftCurrentCompany = _efDbContext.sub_campaign_account_lists.FirstOrDefault(i => i.final_list_id == FinalListId && i.account_id == AccountId);
                if (_eftCurrentCompany != null)
                {
                    if (_eftCurrentCompany.locked_by != null && _eftCurrentCompany.locked_by != UserSession.CurrentUser.UserId)
                        _editable = false;

                    _efDbContext.Detach(_eftCurrentCompany);
                }
            }

            if (!_editable)
            {
                NotificationDialog.Information("Bright Sales", "Delete not allowed. Currently worked by another user.");
                return;
            }

            int? contact_id = SelectedContact == null || SelectedContact.id <= 0 ? (int?)null : SelectedContact.id;

            //if (MessageBox.Show("Are you sure to delete values in this dialog for this contact?", "System Information",
            //    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;

            DeleteDialog ddDiag = new DeleteDialog();
            PopupDialog wDialog = new PopupDialog();
            wDialog.Text = "Cancel or Delete";
            wDialog.ClientSize = new Size(ddDiag.Size.Width + 5, ddDiag.Size.Height + 5);
            ddDiag.Dock = DockStyle.Fill;
            wDialog.Controls.Clear();
            wDialog.Controls.Add(ddDiag);
            wDialog.MinimizeBox = false;
            wDialog.MaximizeBox = false;
            wDialog.CloseBox = true;
            wDialog.StartPosition = FormStartPosition.CenterScreen;
            wDialog.FormBorderStyle = FormBorderStyle.FixedToolWindow;

            bool _IsCancelled = false;
            if (wDialog.ShowDialog() == DialogResult.OK)
            {
                //Cancel all changes made since last saved (reload all data);
                if (ddDiag.SelectedValue == 1)
                {
                    //m_OnPressCancel = true;
                    m_AnswerBindingOnProgress = true;
                    this.LoadDialogQuestionnaires();
                    m_AnswerBindingOnProgress = false;
                    int? _ContactId = null;
                    if (SelectedContact != null && SelectedContact.id > 0)
                        _ContactId = SelectedContact.id;

                    using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection))
                    {
                        _efDbContext.event_log.AddObject(new event_log()
                        {
                            event_id = (int)BrightVision.Common.Classes.EventLog.EventTypes.DIALOG_EVENT,
                            user_id = UserSession.CurrentUser.UserId,
                            subcampaign_id = SubCampaignId,
                            account_id = AccountId,
                            contact_id = _ContactId,
                            local_datetime = DateTime.Now,
                            computer_name = UserSession.CurrentUser.ComputerName,
                            param1 = "Cancel Dialog",
                            param2 = "Success",
                            param3 = string.Format("Dialog Id: {0}", m_oDialog.id),
                            param4 = null,
                            param5 = null,
                            param6 = null
                        });

                        _efDbContext.SaveChanges();
                    }
                    msgDialogStatus.Show(this.ParentForm, "Bright Sales", "Dialog successfully cancelled.");
                    _IsCancelled = true;
                    m_EventBus.Notify(new DialogEditorEvents.OnDelete());
                }
                //Delete dialog contact question data (delete all stored data related to contact)
                else if (ddDiag.SelectedValue == 2)
                {
                    if (SelectedContact == null || SelectedContact.id < 1)
                    {
                        NotificationDialog.Information("Bright Sales", "No contact selected.");
                        return;
                    }

                    WaitDialog.Show(this.ParentForm, "Deleting...");
                    BusinessAnswer.DeleteAnswers(m_oDialog.id, contact_id, CampaignId, AccountId, false);
                    int? _ContactId = null;
                    if (SelectedContact != null && SelectedContact.id > 0)
                        _ContactId = SelectedContact.id;

                    using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection))
                    {
                        _efDbContext.event_log.AddObject(
                            new event_log()
                            {
                                event_id = (int)BrightVision.Common.Classes.EventLog.EventTypes.DIALOG_EVENT,
                                user_id = UserSession.CurrentUser.UserId,
                                subcampaign_id = SubCampaignId,
                                account_id = AccountId,
                                contact_id = _ContactId,
                                local_datetime = DateTime.Now,
                                computer_name = UserSession.CurrentUser.ComputerName,
                                param1 = "Delete Contact Dialog",
                                param2 = "Success",
                                param3 = string.Format("Dialog Id: {0}", m_oDialog.id),
                                param4 = null,
                                param5 = null,
                                param6 = null
                            }
                        );
                        _efDbContext.SaveChanges();
                    }
                    msgDialogStatus.Show(this.ParentForm, "Bright Sales", "Dialog contacts successfully deleted.");
                    _IsCancelled = false;

                    DisposeGroupControls(layoutControlGroupQuestionnaire);
                    m_BrightSalesProperty.CampaignBooking.Questionnaire.Mode = SelectionProperty.DialogSaveMode.Unspecified;
                    m_EventBus.Notify(new DialogEditorEvents.AfterDelete()
                    {
                        IsCancelled = _IsCancelled
                    });

                    WaitDialog.Close();
                    this.LoadDialogQuestionnaires();
                }
                //Delete dialog company question data (delete all stored data related to company)
                else if (ddDiag.SelectedValue == 3)
                {
                    WaitDialog.Show(this.ParentForm, "Deleting...");
                    BusinessAnswer.DeleteAnswers(m_oDialog.id, contact_id, CampaignId, AccountId, true);
                    int? _ContactId = null;
                    if (SelectedContact != null && SelectedContact.id > 0)
                        _ContactId = SelectedContact.id;

                    using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection))
                    {
                        _efDbContext.event_log.AddObject(
                            new event_log()
                            {
                                event_id = (int)BrightVision.Common.Classes.EventLog.EventTypes.DIALOG_EVENT,
                                user_id = UserSession.CurrentUser.UserId,
                                subcampaign_id = SubCampaignId,
                                account_id = AccountId,
                                contact_id = _ContactId,
                                local_datetime = DateTime.Now,
                                computer_name = UserSession.CurrentUser.ComputerName,
                                param1 = "Delete Account Dialog",
                                param2 = "Success",
                                param3 = string.Format("Dialog Id: {0}", m_oDialog.id),
                                param4 = null,
                                param5 = null,
                                param6 = null
                            }
                        );
                        _efDbContext.SaveChanges();
                    }
                    msgDialogStatus.Show(this.ParentForm, "Bright Sales", "Dialog accounts successfully deleted.");
                    _IsCancelled = false;

                    DisposeGroupControls(layoutControlGroupQuestionnaire);
                    m_BrightSalesProperty.CampaignBooking.Questionnaire.Mode = SelectionProperty.DialogSaveMode.Unspecified;
                    m_EventBus.Notify(new DialogEditorEvents.AfterDelete()
                    {
                        IsCancelled = _IsCancelled
                    });

                    WaitDialog.Close();
                    this.LoadDialogQuestionnaires();
                }

                //if (ddDiag.SelectedValue != 1) {
                //    DisposeGroupControls(layoutControlGroupQuestionnaire);
                //    m_BrightSalesProperty.CampaignBooking.Questionnaire.Mode = SelectionProperty.DialogSaveMode.Unspecified;
                //    m_EventBus.Notify(new DialogEditorEvents.AfterDelete() {
                //        IsCancelled = _IsCancelled
                //    });

                //    //DialogEditorAfterDeleteEventNotifier
                //    //if (OnDeleteCompleted != null)
                //    //    OnDeleteCompleted(this, _args);

                //    WaitDialog.Close();
                //    this.LoadDialogQuestionnaires();
                //}
                //else {
                //    m_EventBus.Notify(new DialogEditorEvents.OnDelete());

                //    //if (OnDeleleteToggleButtons != null)
                //    //    OnDeleleteToggleButtons(this, new EventArgs());
                //}
            }
        }
Ejemplo n.º 8
0
        private void btnRemoveCompany_Click(object sender, EventArgs e)
        {
            if (gvCampaignList.RowCount < 1)
                return;

            if (HasPendingCallAndLog()) {
                NotificationDialog.Information("Bright Sales", "A call is in progress or there's a pending call log to be saved.");
                return;
            }

            //if (UserOnWorkMode) {
            //    MessageBox.Show("You are currently working on a company. Please kindly close it first before refreshing the dropdown list.", "Bright Sales", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}

            //m_CampaignListParamsLoaded = false;
            this.GetSelectedCampaignListRowCommonlyUsedFields();
            //m_CampaignListParamsLoaded = true;
            //if (m_AccountLocked && m_AccountLockedBy != UserSession.CurrentUser.UserId)

            int _AcctId = ValidationUtility.TryParseInt(gvCampaignList.GetRowCellValue(m_CampaignListSelectedRow, "account_id").ToString());
            int _FinalListId = ValidationUtility.TryParseInt(gvCampaignList.GetRowCellValue(m_CampaignListSelectedRow, "final_list_id").ToString());
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                sub_campaign_account_lists _item = _efDbContext.sub_campaign_account_lists.FirstOrDefault(i =>
                    i.account_id == _AcctId &&
                    i.final_list_id == _FinalListId
                );
                if (_item != null)
                    _efDbContext.Detach(_item);

                if (_item.locked && _item.locked_by == UserSession.CurrentUser.UserId) {
                    DialogResult _dlg = MessageBox.Show(
                        string.Format("You're currently working on this company.{0}Are you sure to de-activate this company?", Environment.NewLine),
                        "Bright Sales",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question
                    );
                    if (_dlg == DialogResult.No)
                        return;
                }
                else if (_item.locked && _item.locked_by != UserSession.CurrentUser.UserId) {
                    user _user = _efDbContext.users.FirstOrDefault(i => i.id == _item.locked_by);
                    if (_user != null)
                        _efDbContext.Detach(_user);

                    NotificationDialog.Error("Bright Sales", string.Format("This company is currently worked by {0}.", _user.fullname));
                    return;
                }
            }

            //if (UserOnWorkMode) {
            //    if (m_AccountLockedBy != UserSession.CurrentUser.UserId)
            //        MessageBox.Show(String.Format("This company is currently worked by {0}.", m_AccountLockUser), "Bright Sales", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //    else
            //        MessageBox.Show("You're currently working on a company. Please close it first before de-activating.", "Bright Sales", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //    return;
            //}

            string Message = String.Format("This is a global deletion from all campaigns and sub-campaigns.{0}Are you sure you want to de-activate this company?", Environment.NewLine);
            DialogResult objDialog = MessageBox.Show(Message, "De-activate Company", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (objDialog == DialogResult.No)
                return;

            m_DoneLoadingCampaignList = false;
            DeActivateAccount objDeActivateAccount = new DeActivateAccount() {
                AccountId = m_AccountId,
                FinalListId = m_FinalListId
            };
            objDeActivateAccount.AfterSave += new DeActivateAccount.AfterSaveEventHandler(objDeActivateAccount_AfterSave);

            PopupDialog objPopupDialog = new PopupDialog() {
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MinimizeBox = false,
                MaximizeBox = false,
                StartPosition = FormStartPosition.CenterScreen,
                Text = "De-Activate Account"
            };

            objPopupDialog.Controls.Add(objDeActivateAccount);
            objPopupDialog.ClientSize = new Size(objDeActivateAccount.Width + 2, objDeActivateAccount.Height + 2);
            objPopupDialog.ShowDialog();

            //if (objPopupDialog.ShowDialog(this.ParentForm) == DialogResult.OK) {
            //    WaitDialog.Show(ParentForm, "Loading list.");
            //    var x = Business.ObjectLocking.ReleaseLock(m_FinalListId, m_AccountId);
            //    //gcCampaignList.RefreshDataSource();
            //    this.LoadCampaignList();
            //    //this.LoadSelectedPage(m_SelectedPageName); //todo:  get this on campaign list booking details module
            //    //m_objMainForm.m_CampaignBookingModule.LoadCampaignBookingData(true); // todo: call this later using form event handler on sales consultant form

            //    /**
            //     * event raiser
            //     */
            //    if (gvCampaignList.RowCount > 0 && btnRemoveCompany_OnClick != null) {
            //        this.SetCampaignListAppointmentParams();
            //        CampaignListArgs _Args = new CampaignListArgs();
            //        _Args.ContactId = m_ContactId;
            //        _Args.CompanyName = m_CompanyName;
            //        _Args.CampaignBookingAppointment = m_objSubCampaignAppointmentParams;
            //        _Args.CampaignListMode = CampaignListMode;
            //        _Args.BreadCrumb =
            //            string.Format("{0} > {1} > {2} > {3}{4}{5}",
            //                CustomerName,
            //                CampaignName,
            //                SubCampaignName,
            //                string.IsNullOrEmpty(m_CompanyName) ? "" : m_CompanyName,
            //                string.IsNullOrEmpty(m_CompanyCity) ? "" : ", " + m_CompanyCity,
            //                string.IsNullOrEmpty(m_CompanyCountry) ? "" : ", " + m_CompanyCountry
            //            );
            //        btnRemoveCompany_OnClick(this, _Args);
            //    }
            //    else if (gvCampaignList.RowCount < 1 && OnCampaignListEmpty != null)
            //        OnCampaignListEmpty();

            //    WaitDialog.Close() ;
            //}
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Displays the add follow up form
        /// </summary>
        private void DisplayFollowUpForm()
        {
            if (oAppointment == null || m_oContactView.SelectedContact == null)
            {
                MessageBox.Show("No selected company/contact.", "Add Event Follow Ups", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            WaitDialog.CreateWaitDialog("Loading add follow up form.");
            m_objFollowUpForm = new ManageEventFollowUp(m_oContactView.SelectedContact.id, oAppointment);
            m_objFollowUpForm.ParentModule = this;
            PopupDialog objPopupDialog = new PopupDialog();
            objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
            objPopupDialog.MinimizeBox = false;
            objPopupDialog.MaximizeBox = false;
            objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
            objPopupDialog.Text = "Add Event Follow Up";
            objPopupDialog.Controls.Add(m_objFollowUpForm);
            objPopupDialog.ClientSize = new Size(m_objFollowUpForm.Width + 2, m_objFollowUpForm.Height + 2);
            WaitDialog.CloseWaitDialog();
            objPopupDialog.ShowDialog(this.ParentForm);
        }
Ejemplo n.º 10
0
        private void simpleButtonEdit_Click(object sender, EventArgs e)
        {
            if (gridViewDialog.RowCount < 1)
                return;

            WaitDialog.Show(ParentForm, "Loading components...");
            popupDialog = new PopupDialog();
            Padding pads = popupDialog.Padding;
            pads.Left = 5;
            popupDialog.StartPosition = FormStartPosition.CenterScreen;
            popupDialog.Text = "Edit Dialog";

            GridView view = gridViewDialog;
            if (view != null || view.SelectedRowsCount > 0) {
                var ctscd = view.GetRow(view.GetSelectedRows()[0]) as CTSubCampaignDialogs;
                ucNewDialog1 = new NewDialog(ctscd);
                ucNewDialog1.ParentController = this;
            }

            ucNewDialog1.Dock = DockStyle.Fill;
            popupDialog.Controls.Add(ucNewDialog1);
            popupDialog.ClientSize = new Size(1460, 930);
            popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing);
            WaitDialog.Close();
            popupDialog.ShowDialog(this.ParentForm);
        }
Ejemplo n.º 11
0
        private void btnAddCompany_Click(object sender, EventArgs e)
        {
            //if (UserOnWorkMode) {
            //    MessageBox.Show("You are currently working on a company. Please kindly close it first before selecting new companies.", "Bright Sales", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}

            WaitDialog.Show(ParentForm, "Loading components...");
            AddSubCampaignAccount _ucSubCampaignAccount = new AddSubCampaignAccount();
            _ucSubCampaignAccount.cmdAddToSubCampaign_OnClick += new AddSubCampaignAccount.cmdAddToSubCampaignOnClickHandler(_ucSubCampaignAccount_cmdAddToSubCampaign_OnClick);
            PopupDialog _dlgPopup = new PopupDialog();
            //_ucSubCampaignAccount.CampaignListModule = this;
            _dlgPopup.FormBorderStyle = FormBorderStyle.FixedSingle;
            _dlgPopup.MinimizeBox = false;
            _dlgPopup.MaximizeBox = false;
            _dlgPopup.StartPosition = FormStartPosition.CenterScreen;
            _dlgPopup.Text = "Add Companies";
            _dlgPopup.Controls.Add(_ucSubCampaignAccount);
            _dlgPopup.ClientSize = new Size(_ucSubCampaignAccount.Width + 2, _ucSubCampaignAccount.Height + 2);
            WaitDialog.Close();
            _dlgPopup.ShowDialog(this.ParentForm);
        }
Ejemplo n.º 12
0
 private void simpleButtonCloneDialog_Click(object sender, EventArgs e)
 {
     WaitDialog.Show(ParentForm, "Loading components...");
     popupDialogTemplate = new PopupDialog();
     popupDialogTemplate.MaximizeBox = false;
     popupDialogTemplate.MinimizeBox = false;
     popupDialogTemplate.StartPosition = FormStartPosition.CenterScreen;
     popupDialogTemplate.Text = "Clone Dialog From All Dialog Templates";
     ucTemplateDialog1 = new TemplateDialog();
     ucTemplateDialog1.Dock = DockStyle.Fill;
     ucTemplateDialog1.ParentController = this;
     popupDialogTemplate.Controls.Add(ucTemplateDialog1);
     popupDialogTemplate.ClientSize = new Size(ucTemplateDialog1.Width + 10, ucTemplateDialog1.Height + 10);
     popupDialogTemplate.FormClosed += new FormClosedEventHandler(popupDialogTemplate_FormClosed);
     WaitDialog.Close();
     popupDialogTemplate.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 13
0
 private void simpleButtonAdd_Click(object sender, EventArgs e)
 {
     WaitDialog.Show(ParentForm, "Loading components...");
     popupDialog = new PopupDialog();
     Padding pads = popupDialog.Padding;
     pads.Left = 5;
     popupDialog.StartPosition = FormStartPosition.CenterScreen;
     popupDialog.Text = "Add Dialog";
     ucNewDialog1 = new NewDialog();
     ucNewDialog1.ParentController = this;
     ucNewDialog1.Dock = DockStyle.Fill;
     popupDialog.Controls.Add(ucNewDialog1);
     popupDialog.ClientSize = new Size(1460, 930);
     popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing);
     WaitDialog.Close();
     popupDialog.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes the popup dialog for user entry
        /// </summary>
        private void DisplayUserForm(bool IsNew)
        {
            WaitDialog.Show(ParentForm, "Loading components...");
            if (IsNew)
            {
                m_objAddUserForm = new AddUser();
                m_objAddUserForm.IsNew = true;
            }
            else
            {
                m_objAddUserForm = new AddUser(AddUser.SaveType.SaveTypeEdit, m_objUser);
                m_objAddUserForm.IsNew = false;
            }

            m_objAddUserForm.UserType = AddUser.eUserType.CustomerUser;
            m_objAddUserForm.InitializeModule();
            m_objAddUserForm.objCustomerUserControl = this;
            PopupDialog m_objPopupDialog = new PopupDialog();
            m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
            m_objPopupDialog.MinimizeBox = false;
            m_objPopupDialog.MaximizeBox = false;
            m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
            m_objPopupDialog.Text = "Manager Application - Users";
            m_objPopupDialog.Controls.Add(m_objAddUserForm);
            m_objPopupDialog.ClientSize = new Size(m_objAddUserForm.Width + 2, m_objAddUserForm.Height + 2);
               WaitDialog.Close();
            m_objPopupDialog.ShowDialog(this.ParentForm);
        }
Ejemplo n.º 15
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);
            }
        }
Ejemplo n.º 16
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     AddSubCampaignConfigTemplate objForm = new AddSubCampaignConfigTemplate();
     objForm.AfterSave += new AddSubCampaignConfigTemplate.AfterSaveEventHandler(objForm_AfterSave);
     objForm.Dock = DockStyle.Fill;
     PopupDialog m_objPopupDialog = new PopupDialog();
     m_objPopupDialog.MinimizeBox = false;
     m_objPopupDialog.MaximizeBox = false;
     m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
     m_objPopupDialog.Text = "Add Sub-campaign Xml Config";
     m_objPopupDialog.ClientSize = new Size(objForm.Width + 2, objForm.Height + 2);
     m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     m_objPopupDialog.Controls.Add(objForm);
     m_objPopupDialog.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 17
0
 private void barButtonItemPhoneSettings_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     PopupDialog dialog = new PopupDialog(new AudioSettings(), "Phone Settings");
     dialog.ShowDialog(this);
 }
Ejemplo n.º 18
0
 private void btnHelp_Click(object sender, EventArgs e)
 {
     SubCampaignConfigurationHelp _control = new SubCampaignConfigurationHelp() {
         Dock = DockStyle.Fill
     };
     PopupDialog _dlg = new PopupDialog() {
         MinimizeBox = false,
         MaximizeBox = false,
         StartPosition = FormStartPosition.CenterScreen,
         Text = "Sub Campaign Configuration Settings Keywords",
         FormBorderStyle = FormBorderStyle.FixedSingle
     };
     _dlg.ClientSize = new Size(_control.Width + 2, _control.Height + 2);
     _dlg.Controls.Add(_control);
     _dlg.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 19
0
        private void GridUtilityMenu_EditEventOnClick()
        {
            if (gvEventLog.RowCount < 1)
                return;

            if (m_BrightSalesProperty.CampaignBooking.Questionnaire.Mode == SelectionProperty.DialogSaveMode.Edit) {
                NotificationDialog.Warning("Bright Sales", "This dialog is currently being edited.");
                return;
            }

            SalesConsultant.Business.BrightSalesGridUtility.EditEventOnClick -= new SalesConsultant.Business.BrightSalesGridUtility.EditEventOnClickEventHandler(GridUtilityMenu_EditEventOnClick);
            CTScEventAndFollowUpLog _item = gvEventLog.GetFocusedRow() as CTScEventAndFollowUpLog;
            if (_item == null || _item.event_type.Equals("Call Log") || _item.event_type.Equals("Nurture Log"))
                return;

            bool _EditAllowed = false;
            if (_item.assigned_user == UserSession.CurrentUser.UserId || _item.created_by.Equals(UserSession.CurrentUser.UserFullName))
                _EditAllowed = true;

            if (!_EditAllowed)
                return;

            /** /
            bool _EditAllowed = false;
            if (_item.event_type.Equals("Nurture Event") || _item.event_type.Equals("Make Call"))
                _EditAllowed = true;

            if (!_EditAllowed)
                return;
            /**/

            int _FinalListId;
            event_followup_log _data;
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                _data = _efDbContext.event_followup_log.FirstOrDefault(i => i.id == _item.id);
                _FinalListId = (int)_efDbContext.final_lists.FirstOrDefault(i => i.sub_campaign_id == _data.subcampaign_id).id;
                _efDbContext.Detach(_data);
            }

            if (_data == null)
                return;

            #region Initialize Editor
            FollowUpEditor _control = new FollowUpEditor() {
                Dock = DockStyle.Fill,
                IsNurtureEvent = false
            };
            _control.btnSave_OnClick += new FollowUpEditor.btnSaveOnClickEventHandler(_control_btnSave_OnClick);

            PopupDialog _dlg = new PopupDialog() {
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MinimizeBox = false,
                MaximizeBox = false,
                StartPosition = FormStartPosition.CenterScreen,
                Text = "Edit Task",
                ClientSize = new Size(_control.Width + 2, _control.Height + 2),
                CloseBox = false
            };
            _dlg.Controls.Add(_control);
            #endregion

            int _EventType = 0;
            if (_item.event_type.Equals("Nurture Event")) {
                _EventType = (int)_data.subcampaign_id;
                _control.IsNurtureEvent = true;
            }
            else if (_item.event_type.Equals("Make Call"))
                _EventType = -1;
            else if (_item.event_type.Equals("Todo"))
                _EventType = -3;

            _control.SubCampaignId = SubCampaignId;
            _control.Prepare();
            _control.GetEventTypes(SubCampaignId);
            _control.SetSelectedEventType(_EventType);
            _control.LoadSalesUsers((int)_data.subcampaign_id, (int)_data.assigned_user);
            _control.SetCampaignInfo(_data);

            List<CTScSubCampaignContactList> _ContactList = ObjectSubCampaign.GetSubCampaignContacts((int)_data.subcampaign_id, (int)_data.account_id, _FinalListId);
            if (_ContactList.Count > 0) {
                _control.LoadContactPersons(_ContactList);
                CTScSubCampaignContactList _contact = _ContactList.Find(i => i.id == (int)_data.contact_id);
                if (_contact != null) {
                    _control.ContactPerson = _contact;
                    _control.LoadSelectedContact(false);
                }
            }

            _dlg.ShowDialog(this);
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Display edit import file form
 /// </summary>
 private void DisplayEditImportFileForm()
 {
     this.Cursor = Cursors.WaitCursor;
     this.SetFocusedViewInstance();
     EditImportFile objFrmImportFile = new EditImportFile(this.m_objImportList);
     objFrmImportFile.objParentControl = this;
     m_objPopupDialog = new PopupDialog();
     m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     m_objPopupDialog.MinimizeBox = false;
     m_objPopupDialog.MaximizeBox = false;
     m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
     m_objPopupDialog.Text = m_MessageBoxCaption;
     m_objPopupDialog.Controls.Add(objFrmImportFile);
     m_objPopupDialog.ClientSize = new Size(objFrmImportFile.Width + 2, objFrmImportFile.Height + 2);
     m_objPopupDialog.ShowDialog(this.ParentForm);
     this.Cursor = Cursors.Default;
 }
Ejemplo n.º 21
0
        private void simpleButtonMultipleList_Click(object sender, EventArgs e)
        {
            EditorStringCollection oESCol = new EditorStringCollection();
            PopupDialog oPopupDiag = new PopupDialog();
            oPopupDiag.StartPosition = FormStartPosition.CenterScreen;
            oPopupDiag.Text = "String Collection Editor";
            oPopupDiag.ClientSize = new Size(oESCol.Width + 10, oESCol.Height + 10);
            oPopupDiag.MinimumSize = new Size(oESCol.Width + 10, oESCol.Height + 10);
            oESCol.Dock = DockStyle.Fill;
            oPopupDiag.Controls.Add(oESCol);
            if (oPopupDiag.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                return;

            string[] stringCol = oESCol.StringCollection.Lines;
            if (stringCol != null && stringCol.Length > 0) {
                PropertyInfo pi = answerOptionList[SelectedIndex].MultipleChoiceValues.GetType().GetProperty("Item");
                stringCol = string.Join(",", stringCol).Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                foreach (string str in stringCol) {
                    var instance = Activator.CreateInstance(pi.PropertyType) as MultipleChoiceValue;
                    instance.TextPrefix = str;
                    answerOptionList[SelectedIndex].MultipleChoiceValues.Add(instance);
                }
                listBoxControlMembers.Refresh();
                listBoxControlMembers.SelectedIndex = answerOptionList[SelectedIndex].MultipleChoiceValues.Count - 1;
            }
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Display new import form
 /// </summary>
 private void DisplayNewImportForm()
 {
     m_objFrmNewImport = new NewImport();
     m_objFrmNewImport.m_objUserControl = this;
     m_objPopupDialog = new PopupDialog();
     m_objPopupDialog.FormBorderStyle = FormBorderStyle.FixedSingle;
     m_objPopupDialog.MinimizeBox = false;
     m_objPopupDialog.MaximizeBox = false;
     m_objPopupDialog.StartPosition = FormStartPosition.CenterScreen;
     m_objPopupDialog.Text = m_MessageBoxCaption;
     m_objPopupDialog.Controls.Add(m_objFrmNewImport);
     m_objPopupDialog.ClientSize = new Size(m_objFrmNewImport.Width + 2, m_objFrmNewImport.Height + 2);
     m_objPopupDialog.ShowDialog(this.ParentForm);
 }
Ejemplo n.º 23
0
        private void btnEditFollowUpDetails_Click(object sender, EventArgs e)
        {
            if (EventId < 1)
            {
                NotificationDialog.Error("Bright Sales", "No editable data is available.");
                return;
            }

            m_EventBus.Notify(new FollowUpBarEvents.GetCampaignBookingArgs() {
                ForWorkModePurpose = false
            });

            //CampaignBookingProperty.CampaignBoookingArguments _args = GetCampaignBookingArgs(false);
            if (m_BrightSalesProperty.EventsProperty.CampaignBookingArgs == null || m_BrightSalesProperty.EventsProperty.CampaignBookingArgs.oAppointment == null)
                return;

            WaitDialog.Show("Loading Data ...");
            #region Initialize Editor
            m_Editor = new FollowUpEditor() {
                Dock = DockStyle.Fill,
                IsNurtureEvent = false
            };
            m_Editor.btnSave_OnClick += new FollowUpEditor.btnSaveOnClickEventHandler(m_Editor_btnSave_OnClick);
            m_dlgEditor = new PopupDialog() {
                FormBorderStyle = FormBorderStyle.FixedSingle,
                MinimizeBox = false,
                MaximizeBox = false,
                StartPosition = FormStartPosition.CenterScreen,
                Text = "Edit Current Follow Up",
                ClientSize = new Size(m_Editor.Width + 2, m_Editor.Height + 2),
                CloseBox = false
            };
            m_dlgEditor.Controls.Add(m_Editor);
            #endregion

            CampaignBookingProperty.CampaignBoookingArguments _args = m_BrightSalesProperty.EventsProperty.CampaignBookingArgs;
            //bool IsDeActivated = false;
            int _FinalListId;
            event_followup_log _data;
            using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                _data = _efDbContext.event_followup_log.FirstOrDefault(i => i.id == _args.Id);
                _FinalListId = (int)_efDbContext.final_lists.FirstOrDefault(i => i.sub_campaign_id == _data.subcampaign_id).id;
                _efDbContext.Detach(_data);

                /*
                 * https://brightvision.jira.com/browse/PLATFORM-3070
                 * DAN: Inrelated to fixing the issue as must not be able to edit when account is already deactivated.
                 */
                sub_campaign_account_lists _eftSubCampaignAccount = _efDbContext.sub_campaign_account_lists.FirstOrDefault(p =>
                   p.account_id == _data.account_id &&
                   p.final_list_id == _FinalListId &&
                   p.active == true
                );

                if (_eftSubCampaignAccount == null) {
                    NotificationDialog.Warning("Bright Sales", "This account has been de-activated");
                    WaitDialog.Close();
                    return;
                }

                _efDbContext.Detach(_eftSubCampaignAccount);

                //if (_eftSubCampaignAccount != null)
                //    _efDbContext.Detach(_eftSubCampaignAccount);
                //else
                //    IsDeActivated = true;
            }

            //if (IsDeActivated)
            //{
            //    NotificationDialog.Warning("Bright Sales", "This account has been de-activated");
            //    //return;
            //}

            if (_data.event_type.Equals("Nurture Event"))
                m_Editor.IsNurtureEvent = true;

            m_Editor.SubCampaignId = _args.oAppointment.SubCampaignId;
            m_Editor.AccountId = _args.oAppointment.AccountId;
            m_Editor.Prepare();

            if (!_data.event_type.Equals("Nurture Event")) {
                m_Editor.GetEventTypes(0, _data.event_type);
                m_Editor.LoadSalesUsers((int)_data.subcampaign_id, (int)((_data.assigned_user != null)?_data.assigned_user:0));
                m_Editor.SetCampaignInfo(_args);
                m_ContactList = ObjectSubCampaign.GetSubCampaignContacts(_args.oAppointment.SubCampaignId, _args.oAppointment.AccountId, _args.oAppointment.FinalListId);
            }
            else {
                m_Editor.GetEventTypes((int)_data.source_sub_campaign_id);
                m_Editor.SetSelectedEventType((int)_data.subcampaign_id);
                m_Editor.LoadSalesUsers((int)_data.subcampaign_id, (int)_data.assigned_user);
                m_Editor.SetCampaignInfo(_data);
                m_ContactList = ObjectSubCampaign.GetSubCampaignContacts((int)_data.subcampaign_id, (int)_data.account_id, _FinalListId);
            }

            if (m_ContactList.Count > 0) {
                m_Editor.LoadContactPersons(m_ContactList);
                CTScSubCampaignContactList _contact = m_ContactList.Find(i => i.id == (int)_data.contact_id);
                if (_contact != null) {
                    m_Editor.ContactPerson = _contact;
                    m_Editor.LoadSelectedContact(false);
                }
            }

            WaitDialog.Close();
            m_dlgEditor.ShowDialog(this);
        }
Ejemplo n.º 24
0
 private void cmdAddCompany_Click(object sender, EventArgs e)
 {
     WaitDialog.Show(ParentForm, "Loading...");
     AddSubCampaignAccount _ucSubCampaignAccount = new AddSubCampaignAccount();
     PopupDialog _dlgPopup = new PopupDialog();
     //_ucSubCampaignAccount.ParentController = this;
     _dlgPopup.FormBorderStyle = FormBorderStyle.FixedSingle;
     _dlgPopup.MinimizeBox = false;
     _dlgPopup.MaximizeBox = false;
     _dlgPopup.StartPosition = FormStartPosition.CenterScreen;
     _dlgPopup.Text = "Add Companies";
     _dlgPopup.Controls.Add(_ucSubCampaignAccount);
     _dlgPopup.ClientSize = new Size(_ucSubCampaignAccount.Width + 2, _ucSubCampaignAccount.Height + 2);
     WaitDialog.Close();
     _dlgPopup.ShowDialog(this.ParentForm);
 }