예제 #1
0
 private void cmdSaveContactInformation_Click(object sender, EventArgs e)
 {
     DialogResult objResult = MessageBox.Show("Are you sure to update this contact's notes?", m_MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     if (objResult == DialogResult.Yes)
     {
         WaitDialog objDialog = new WaitDialog();
         objDialog.CreateNonStaticWaitDialog("Saving contact notes.");
         m_objContactInformationForm.ContactRemarks = txtContactRemarks.Text;
         m_objContactInformationForm.SaveContactInformation();
         objDialog.CloseNonStaticWaitDialog();
     }
 }
예제 #2
0
 private void btnSaveCompanyDetails_Click(object sender, EventArgs e)
 {
     DialogResult objResult = MessageBox.Show("Are you sure to update this company?", m_MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     if (objResult == DialogResult.Yes)
     {
         WaitDialog objDialog = new WaitDialog();
         objDialog.CreateNonStaticWaitDialog("Saving Company Information.");
         m_objCompanyInformationForm.CompanyRemarks = txtCompanySpecificRemarks.Text;
         m_objCompanyInformationForm.SaveCompanyInformation();
         this.LoadCompanyInformation();
         oAppointment.CompanyBoardNumber = m_objCompanyInformationForm.CompanyPhone;
         oAppointment.CompanyWebsite = m_objCompanyInformationForm.CompanyWebsite;
         if (ParentView == eParentView.CompanyContactView)
         {
             CompanyContactView.InitializeCompanyInformationForm(m_DatabaseModel);
             CompanyContactView.LoadCompanyInformation();
         }
         objDialog.CloseNonStaticWaitDialog();
     }
 }
예제 #3
0
        private void btnDeleteDialog_Click(object sender, EventArgs e)
        {
            if (oAppointment != null && m_oContactView != null && m_oContactView.SelectedContact != null)
            {
                DialogResult objDialog = MessageBox.Show("Are you sure to delete values in this dialog for this contact?", "Dialogs", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (objDialog == DialogResult.No)
                    return;

                lcgContact.Enabled = false;
                if (m_oDialog == null)
                {
                    MessageBox.Show("There is no current dialog created for this customer's subcampaign.");
                    return;
                    //prompt message saying that no dialog for current subcampaign and customer.
                }
                WaitDialog wdiag = new WaitDialog();
                wdiag.CreateNonStaticWaitDialog("Deleting dialog values.");
                //WaitDialog.CreateWaitDialog("Deleting dialog values...");
                BusinessAnswer.DeleteAnswers(
                    m_oDialog.id,
                    m_oContactView.SelectedContact.id,
                    oAppointment.CampaignId,
                    oAppointment.AccountId);
                wdiag.CloseNonStaticWaitDialog();

                CloseDialogEditor(false);
                m_oContactView.SaveSubCampaignContactAppointmentStatus(
                    ContactView.eDialogStatus.None,
                    oAppointment.FinalListId,
                    oAppointment.AccountId,
                    oAppointment.SubCampaignId);
                oMode = SaveMode.Unspecified;
                CloseDialogEditor(false);
                ViewDialog();
                lcgContact.Enabled = true;
                //enable campaign booking saving
                cmdSaveExitAsOpen.Enabled = true;
                cmdSaveExitAsInProgress.Enabled = true;
                cmdSaveExitAsFinished.Enabled = true;
                cmdSaveExitAsFollowUp.Enabled = true;
                cmdSelectCompany.Enabled = true;
            }
        }
예제 #4
0
        private void btnAddLog_Click(object sender, EventArgs e)
        {
            if (txtLogFirstName.Text.Length < 1 || txtLogLastname.Text.Length < 1)
            {
                MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            else if (txtLogFirstName.Text.Equals("First name") || txtLogLastname.Text.Equals("Last name"))
            {
                MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            WaitDialog objDialog = new WaitDialog();
            objDialog.CreateNonStaticWaitDialog("Saving event call log.");

            #region Adding of Contact
            //contact objContact = new contact()
            //{
            //    title = txtLogTitle.Text.Trim(),
            //    first_name = txtLogFirstName.Text.Trim(),
            //    last_name = txtLogLastname.Text.Trim(),
            //    active = true
            //};

            //bool IsEdit = false;
            //contact objExistingContact = ObjectContact.GetContact(txtLogFirstName.Text.Trim(), txtLogLastname.Text.Trim(), oAppointment.AccountId);
            //if (objExistingContact != null)
            //{
            //    objContact = null;
            //    objContact = objExistingContact;

            //    if (!objContact.active)
            //    {
            //        string Message = "This contact is currently de-activated." + Environment.NewLine + "Would you like to re-activate this contact?";
            //        DialogResult objResult = MessageBox.Show(Message, "Add Contact", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            //        if (objResult == DialogResult.Yes)
            //        {
            //            objContact.active = true;
            //            IsEdit = true;
            //        }
            //        else
            //        {
            //            WaitDialog.CloseWaitDialog();
            //            return;
            //        }
            //    }
            //}
            //else
            //{
            //    //objContact.id = ObjectContact.GetContactId(txtLogFirstName.Text.Trim(), txtLogLastname.Text.Trim(), oAppointment.AccountId);
            //    IsEdit = false;
            //}

            //int ContactId = ObjectContact.SaveContact(objContact, IsEdit, 0);
            //if (objContact.id < 1)
            //    objContact.id = ContactId;

            //if (!IsEdit)
            //    ObjectCompany.SaveCompanyContact(oAppointment.AccountId, objContact.id);

            //var DuplicateEntry = BPContext.sub_campaign_contact_lists.FirstOrDefault(i => i.final_list_id == oAppointment.FinalListId && i.contact_id == objContact.id);
            //if (DuplicateEntry == null)
            //{
            //    BPContext.sub_campaign_contact_lists.AddObject(new sub_campaign_contact_lists()
            //    {
            //        active = true,
            //        created_by = UserSession.CurrentUser.UserId,
            //        final_list_id = oAppointment.FinalListId,
            //        contact_id = objContact.id,
            //        created_on = DateTime.Now
            //    });
            //}
            #endregion

            this.HangUpCall();
            BPContext.event_followup_log.AddObject(new event_followup_log()
            {
                subcampaign_id = oAppointment.SubCampaignId,
                account_id = oAppointment.AccountId,
                //contact_id = objContact.id,
                contact_id = m_oContactView.SelectedContact != null? m_oContactView.SelectedContact.id: 0,
                title = txtLogTitle.Text,
                short_message = txtLogShortMessage.Text,
                event_type = "Call Log",
                event_status = cbLogCallStatus.Text,
                date_of_transaction = DateTime.Now,
                assigned_user = UserSession.CurrentUser.UserId,
                done = true,
                start_time = Convert.ToDateTime(esiLogCallStart.Text).TimeOfDay,
                end_time = Convert.ToDateTime(esiLogCallEnd.Text).TimeOfDay,
                date_created = DateTime.Now,
                created_by = UserSession.CurrentUser.UserId,
                contact_name = txtLogFirstName.Text + " " + txtLogLastname.Text
            });

            BPContext.SaveChanges();
            m_oContactView.PopulateContactView(oAppointment.SubCampaignId, oAppointment.AccountId, oAppointment.FinalListId);
            //CompanyContactView.PopulateContactView(oAppointment.AccountId, oAppointment.SubCampaignId, oAppointment.FinalListId);
            this.PopulateEventFollowUpView();
            this.SetDefaultEventLogInfos();
            objDialog.CloseNonStaticWaitDialog();
        }
예제 #5
0
        /// <summary>
        /// Save dialog answers
        /// </summary>
        private bool SaveDialogAnswers(ContactView.eDialogStatus status)
        {
            if (!ValidateDialog()) return false;

            WaitDialog wdiag = new WaitDialog();
            wdiag.CreateNonStaticWaitDialog("Saving dialog answers...");
            IQuestionnaire iQuestion = null;
            var objGroupItems = this.layoutControlGroupQuestionnaire.Items;
            foreach (BaseLayoutItem item in objGroupItems) {
                if (item.IsGroup) {
                    if (item.Tag != null) {
                        iQuestion = item.Tag as IQuestionnaire;
                        BusinessAnswer.SaveAnswer(iQuestion.Questionnaire);
                    }
                }
            }
            if (m_oContactView != null) {
                try {
                    m_oContactView.SaveSubCampaignContactAppointmentStatus(
                        status,
                        oAppointment.FinalListId,
                        oAppointment.AccountId,
                        oAppointment.SubCampaignId);
                } catch { }
                oMode = SaveMode.Unspecified;
                CloseDialogEditor(false);
            }
            wdiag.CloseNonStaticWaitDialog();
            return true;
        }
예제 #6
0
        /// <summary>
        /// Load the selected tab  
        /// </summary>
        /// <param name="pageName"></param>
        private void LoadSelectedPage(string pageName)
        {
            switch (pageName) {
                case "lcgBVSalesScript":
                    docBvSalesScript.LoadDocument(Application.StartupPath + @"\docs_temp\bv_script.doc", DocumentFormat.WordML);
                    break;

                case "lcgStandardQuestions":
                    if (m_objStandardQuestionView.StandardQuestionData == null && m_oContactView.SelectedContact != null) {
                        WaitDialog.CreateWaitDialog("Loading standard questions.");
                        m_objStandardQuestionView.LoadStandardQuestions(oAppointment.SubCampaignId, oAppointment.AccountId, m_oContactView.SelectedContact.id);
                        WaitDialog.CloseWaitDialog();
                    }
                    break;

                case "lcgCollectedData":
                    if (m_objCollectedDataView.CollectedDataResult == null) {
                        WaitDialog.CreateWaitDialog("Loading collected data.");
                        m_objCollectedDataView.SubCampaignId = oAppointment.SubCampaignId;
                        m_objCollectedDataView.AccountId = oAppointment.AccountId;
                        if (m_oContactView.SelectedContact == null)
                        {
                            m_objCollectedDataView.ContactId = null;
                            m_objCollectedDataView.LoadCollectedData();
                        }
                        else
                        {
                            m_objCollectedDataView.ContactId = m_oContactView.SelectedContact.id;
                            m_objCollectedDataView.LoadCollectedData();
                        }
                        //this.LoadCollectedData(oAppointment.SubCampaignId, oAppointment.AccountId);
                        m_objCollectedDataView.CollectedDataFilterByContact = true;
                        //m_objCollectedDataView.cbxBrightvisionOwned.Checked = true;
                        //m_objCollectedDataView.cbxCustomerOwned.Checked = true;

                        if (m_oContactView.SelectedContact != null) {
                            m_objCollectedDataView.ContactId = m_oContactView.SelectedContact.id;
                            m_objCollectedDataView.FilterCollectedData();
                        }
                        //this.FilterCollectedData();
                        WaitDialog.CloseWaitDialog();
                    }
                    break;

                case "lcgCompanyWebsite":
                    m_objCompanyWebsiteView.ClearBrowser();
                    if (oAppointment != null)
                        if (!string.IsNullOrEmpty(oAppointment.CompanyWebsite))
                            m_objCompanyWebsiteView.LoadCompanyWebsite(oAppointment.CompanyWebsite);
                    break;

                case "lcgMapContacts":
                    if (m_oContactView.SelectedContact != null)
                    {
                        m_DoneLoadingContactMap = false;
                        this.LoadContactGeoLocations();
                        if (m_GeoMapListContact.Count > 0)
                        {
                            m_objGeoLocationViewerContact.SetGeoMapLocation(m_GeoMapListContact);
                            m_objGeoLocationViewerContact.ShowLocations();
                        }
                        m_DoneLoadingContactMap = true;
                    }
                    break;

                case "lcgGoogleSearch":
                    m_objGoogleSearchView.LoadGoogleSearch();
                    break;

                case "lcgMySalesScript":
                    WaitDialog objDialog = new WaitDialog();
                    objDialog.CreateNonStaticWaitDialog("Loading sales script.");
                    if (!m_DoneLoadingMySalesScript)
                        this.InitializeMySalesScriptView();
                    m_objMySalesScriptForm.LoadUserDocument();
                    objDialog.CloseNonStaticWaitDialog();
                    break;

                case "lcgContactInformation":
                    WaitDialog.CreateWaitDialog("Loading contact information.");
                    this.LoadContactInformation();
                    WaitDialog.CloseWaitDialog();
                    break;
            }
        }