private void DisplaySelectedTabPage() { m_SelectedPage = eSelectedPage.None; WaitDialog.Show(ParentForm, "Loading components..."); int _AccountId = 0; int _ContactId = 0; int _FinalListId = m_BrightSalesProperty.CommonProperty.FinalListId; int _SubCampaignId = m_BrightSalesProperty.CommonProperty.SubCampaignId; int _CampaignId = m_BrightSalesProperty.CommonProperty.CampaignId; int _CustomerId = m_BrightSalesProperty.CommonProperty.CustomerId; if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignList) { _AccountId = m_BrightSalesProperty.CommonProperty.AccountId; _ContactId = m_BrightSalesProperty.CommonProperty.ContactId; } else if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignBooking) { _AccountId = m_BrightSalesProperty.CommonProperty.CurrentWorkedAccountId; _ContactId = m_BrightSalesProperty.CommonProperty.CurrentWorkedContactId; } #region Contact Information if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabContactInformation)) { m_SelectedPage = eSelectedPage.ContactInformation; if (m_ContactInformation == null) { m_ContactInformation = new ContactInformation(m_CallingEnvironment); //m_ContactInformation.btnNew_OnClick += new ContactInformation.btnNewOnClickHandler(m_ContactInformation_btnNew_OnClick); //m_ContactInformation.btnSave_OnClick += new ContactInformation.btnSaveOnClickHandler(m_ContactInformation_btnSave_OnClick); //m_ContactInformation.btnCancel_OnClick += new ContactInformation.btnCancelOnClickHandler(m_ContactInformation_btnCancel_OnClick); //m_ContactInformation.btnDelete_OnClick += new ContactInformation.btnDeleteOnClickHandler(m_ContactInformation_btnDelete_OnClick); m_ContactInformation.Dock = DockStyle.Fill; pnlContact.Dock = DockStyle.Fill; pnlContact.Controls.Clear(); pnlContact.Controls.Add(m_ContactInformation); } m_ContactInformation.AllowSaving = m_AllowSave; if (m_BrightSalesProperty.CommonProperty != null) { ///*DAN: https://brightvision.jira.com/browse/PLATFORM-2448 // * Added instance on the ContactView modules so that it gets actualy focused row values //*/ ////----------------------------------------------------------------- //if (m_ContactView == null) //{ // m_ContactView = ContactView.Instance(); // if (m_ContactView.gvContact.DataRowCount > 0) // { // GridView view = m_ContactView.gcContact.FocusedView as GridView; // int.TryParse(view.GetRowCellValue(view.FocusedRowHandle, "id").ToString(), out _ContactId); // } //} ////----------------------------------------------------------------- if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignList && m_BrightSalesProperty.CampaignList.CampaignListMode == SelectionProperty.CampaignListMode.CompaniesOnly) m_ContactInformation.Disable(); else { m_ContactInformation.ResetParamaters(); m_ContactInformation.Show(_ContactId, _FinalListId, ReloadContacInformationtData, _AccountId); } } if (m_DialogEditorSaveMode == SelectionProperty.DialogSaveMode.Edit) m_ContactInformation.SetAsReadOnly(true); ReloadContacInformationtData = false; } #endregion #region Company Information else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabCompanyInformation)) { m_SelectedPage = eSelectedPage.CompanyInfortmation; if (m_CompanyInformation == null) { m_CompanyInformation = new CompanyInformation(m_CallingEnvironment); //m_CompanyInformation.OnCompanyInformationSaved += new CompanyInformation.CompanyInformationSavedEventHandler(m_CompanyInformation_OnCompanyInformationSaved); //m_CompanyInformation.OnCompanyInformationRefresh += new CompanyInformation.CompanyInformationRefreshEventHandler(m_CompanyInformation_OnCompanyInformationRefresh); m_CompanyInformation.Dock = DockStyle.Fill; pnlCompany.Dock = DockStyle.Fill; pnlCompany.Controls.Clear(); pnlCompany.Controls.Add(m_CompanyInformation); } m_CompanyInformation.AllowSaving = m_AllowSave; if (m_BrightSalesProperty.CommonProperty != null) m_CompanyInformation.Show(_AccountId, _FinalListId); if (m_DialogEditorSaveMode == SelectionProperty.DialogSaveMode.Edit) m_CompanyInformation.SetAsReadOnly(true); } #endregion #region Event & Follow Up Log else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabCallLog)) { m_SelectedPage = eSelectedPage.CallLog; if (m_CallLog == null) { m_CallLog = new EventFollowUpLog(); m_CallLog.Dock = DockStyle.Fill; m_CallLog.HideAdditionalPanels(); //m_CallLog.AfterDelete += new EventFollowUpLog.AfterDeleteEventHandler(m_CallLog_AfterDelete); //m_CallLog.WorkNurtureEvent += new EventFollowUpLog.WorkNurtureEventEventHandler(m_CallLog_WorkNurtureEvent); pnlCallLog.Dock = DockStyle.Fill; pnlCallLog.Controls.Clear(); pnlCallLog.Controls.Add(m_CallLog); } if (m_BrightSalesProperty.CommonProperty != null) { if (ReloadCallLog) { m_CallLog.ReloadData = true; ReloadCallLog = false; } m_CallLog.AllowSaving = m_AllowSave; m_CallLog.Show(_SubCampaignId, _AccountId); } } #endregion #region Booking Schedule else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabBooking)) { /** * if no sub-campaign assigned yet, just bypass */ if (m_BrightSalesProperty.CommonProperty == null) { WaitDialog.Close(); return; } m_SelectedPage = eSelectedPage.BookingSchedule; if (m_BookingSchedule == null) { m_BookingSchedule = new BookingSchedules(); m_BookingSchedule.Dock = DockStyle.Fill; pnlBookingSchedule.Dock = DockStyle.Fill; pnlBookingSchedule.Controls.Clear(); pnlBookingSchedule.Controls.Add(m_BookingSchedule); } if (m_BrightSalesProperty.CommonProperty != null) m_BookingSchedule.Show(_SubCampaignId); } #endregion #region Collected Data else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabCollectedData)) { /** * reload logic should always come first, not unless with reason to put * in betwwen the logic or in last. * * as for like contact information, reloading of data happens on the Show() method. * here we implement it as a separate call for easier tracing ang maintenance. */ if (ReloadCollectedData) { if (m_BrightSalesProperty.CommonProperty != null && m_CollectedData != null) m_CollectedData.Reload(); ReloadCollectedData = false; } else { m_SelectedPage = eSelectedPage.CollectedData; if (m_CollectedData == null) { m_CollectedData = new CollectedData(); m_CollectedData.Dock = DockStyle.Fill; pnlCollectedData.Dock = DockStyle.Fill; pnlCollectedData.Controls.Clear(); pnlCollectedData.Controls.Add(m_CollectedData); } if (m_BrightSalesProperty.CommonProperty != null) { m_CollectedData.AccountId = _AccountId; m_CollectedData.SubCampaignId = _SubCampaignId; m_CollectedData.CampaignId = _CampaignId; m_CollectedData.CustomerId = _CustomerId; m_CollectedData.ContactId = null; if (_ContactId > 0) m_CollectedData.ContactId = _ContactId; if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignList && m_BrightSalesProperty.CampaignList.CampaignListMode == SelectionProperty.CampaignListMode.CampaniesAndContacts) { m_CollectedData.CollectedDataFilterByContact = true; m_CollectedData.SetContactCollectedDataButton(false); } if (_ContactId > 0) m_CollectedData.ContactId = _ContactId; m_CollectedData.Activate(); m_CollectedData.Show(); } if (m_DialogEditorSaveMode == SelectionProperty.DialogSaveMode.Edit) m_CollectedData.SetAsReadOnly(true); } } #endregion #region Company Website else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabCompanyWebsite)) { m_SelectedPage = eSelectedPage.CompanyWebsite; if (m_CompanyWebsite == null) { m_CompanyWebsite = new CompanyWebsite(); m_CompanyWebsite.Dock = DockStyle.Fill; pnlCompanyWebsite.Dock = DockStyle.Fill; pnlCompanyWebsite.Controls.Clear(); pnlCompanyWebsite.Controls.Add(m_CompanyWebsite); } if (m_BrightSalesProperty.CommonProperty != null) m_CompanyWebsite.Show(_AccountId); } #endregion #region Google Search else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabGoogleSearch)) { m_SelectedPage = eSelectedPage.GoogleSearch; if (m_GoogleSearch == null) { m_GoogleSearch = new GoogleSearch(); m_GoogleSearch.Dock = DockStyle.Fill; pnlGoogleSearch.Dock = DockStyle.Fill; pnlGoogleSearch.Controls.Clear(); pnlGoogleSearch.Controls.Add(m_GoogleSearch); m_GoogleSearch.LoadGoogleSearch(); } } #endregion #region LinkedIn else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabLinkedIn)) { m_SelectedPage = eSelectedPage.LinkedIn; if (m_LinkedIn == null) { m_LinkedIn = new LinkedIn(); m_LinkedIn.Dock = DockStyle.Fill; pnlLinkedIn.Dock = DockStyle.Fill; pnlLinkedIn.Controls.Clear(); pnlLinkedIn.Controls.Add(m_LinkedIn); } if (m_BrightSalesProperty.CommonProperty != null) m_LinkedIn.LoadLinkedIn(_AccountId, _ContactId); } #endregion #region Brightvision Standard Question else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabBvStandardQuestion)) { //m_SelectedPage = eSelectedPage.BvStandardQuestion; //if (m_BvStandardQuestion == null) { // m_BvStandardQuestion = new BvStandardQuestion(); // m_BvStandardQuestion.Dock = DockStyle.Fill; // pnlBvStandardQuestion.Dock = DockStyle.Fill; // pnlBvStandardQuestion.Controls.Clear(); // pnlBvStandardQuestion.Controls.Add(m_BvStandardQuestion); //} //if (m_BrightSalesProperty.CommonProperty != null) // m_BvStandardQuestion.Show(_SubCampaignId, _AccountId, _ContactId); } #endregion #region Map Company else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabMapCompany)) { m_SelectedPage = eSelectedPage.MapCompany; if (m_MapCompany == null) { m_MapCompany = new MapCompany(); m_MapCompany.Dock = DockStyle.Fill; pnlMapCompany.Dock = DockStyle.Fill; pnlMapCompany.Controls.Clear(); pnlMapCompany.Controls.Add(m_MapCompany); } if (m_BrightSalesProperty.CommonProperty != null) { m_MapCompany.SetParameters(_FinalListId); m_MapCompany.PrepareLocations(); } if (!ShowSpecificCompanyMapLocation) m_MapCompany.Show(false, null); else m_MapCompany.Show(true, _AccountId); ShowSpecificCompanyMapLocation = false; } #endregion #region Map Contact else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabMapContact)) { m_SelectedPage = eSelectedPage.MapContact; if (m_MapContact == null) { m_MapContact = new MapContact(); m_MapContact.Dock = DockStyle.Fill; pnlMapContact.Dock = DockStyle.Fill; pnlMapContact.Controls.Clear(); pnlMapContact.Controls.Add(m_MapContact); } if (m_BrightSalesProperty.CommonProperty != null) { m_MapContact.SetParameters(_FinalListId, _AccountId); m_MapContact.PrepareLocations(); } if (!ShowSpecificContactMapLocation) m_MapContact.Show(false, null); else { /** * if call has been made from campaign list */ if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignList) { if (m_BrightSalesProperty.CampaignList.CampaignListMode == SelectionProperty.CampaignListMode.CompaniesOnly) m_MapContact.Show(false, null); else m_MapContact.Show(true, _ContactId); } /** * if call has been made from campaign booking */ else if (CallingEnvironment == SelectionProperty.CallingEnvironment.CampaignBooking) m_MapContact.Show(true, _ContactId); } ShowSpecificContactMapLocation = false; } #endregion #region Brightvision Sales Script else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabBvSalesScript)) { m_SelectedPage = eSelectedPage.BvSalesScript; if (m_BvSalesScript == null) { m_BvSalesScript = new BvSalesScript(); m_BvSalesScript.Dock = DockStyle.Fill; pnlBvSalesScript.Dock = DockStyle.Fill; pnlBvSalesScript.Controls.Clear(); pnlBvSalesScript.Controls.Add(m_BvSalesScript); } m_BvSalesScript.AllowSaving = m_AllowSave; if (m_BrightSalesProperty.CommonProperty != null) m_BvSalesScript.Show(_FinalListId); } #endregion #region My Sales Script else if (tcCampaignExtraDetail.SelectedTabPage.Equals(tabMySalesScript)) { m_SelectedPage = eSelectedPage.MySalesScript; if (m_MySalesScript == null) { m_MySalesScript = new MySalesScript(); m_MySalesScript.Dock = DockStyle.Fill; pnlMySalesScript.Dock = DockStyle.Fill; pnlMySalesScript.Controls.Clear(); pnlMySalesScript.Controls.Add(m_MySalesScript); } m_MySalesScript.AllowSaving = m_AllowSave; if (m_BrightSalesProperty.CommonProperty != null) m_MySalesScript.Show(m_BrightSalesProperty.CommonProperty.FinalListId); } #endregion WaitDialog.Close(); }
public void InitializeCampaignBooking() { m_LoadingFromButtonPress = true; m_IsReleaseCancel = false; #region Original Code //public void LoadCampaignBookingData(bool InitializeOnly = false) //this.InitializeMySalesScriptView(); //this.InitializeContactInformationForm(); //this.InitializeCompanyInformationForm(); //this.InitializeStandardQuestionView(); //this.InitializeCompanyWebsiteView(); //this.InitializeGoogleSearchView(); //this.InitializeCollectedDataView(); //this.InitializeGeoMapContactView(); #endregion #region Contact View m_ContactViewOnInitialize = true; if (m_oContactView == null) { m_oContactView = new ContactView(); m_oContactView.Dock = DockStyle.Fill; m_oContactView.OnContactSaved += new ContactView.ContactSavedEventHandler(m_oContactView_OnContactSaved); m_oContactView.GridControlMouseDown += new MouseEventHandler(m_oContactView_GridControlMouseDown); m_oContactView.GridControlMouseUp += new MouseEventHandler(m_oContactView_GridControlMouseUp); m_oContactView.GridControlKeyUp += new KeyEventHandler(m_oContactView_GridControlKeyUp); m_oContactView.GridControlKeyDown += new KeyEventHandler(m_oContactView_GridControlKeyDown); m_oContactView.ActiveChanged += new ContactView.ActiveChangedEventHander(m_oContactView_ActiveChanged); m_oContactView.PopulateContactView_Initiated += new ContactView.PopulateContactViewInitiatedEventHandler(m_oContactView_PopulateContactView_Initiated); pnlContactView.Controls.Clear(); pnlContactView.Controls.Add(m_oContactView); } m_ContactViewOnInitialize = false; #endregion #region Dialog Editor if (m_oDialogEditor == null) { m_oDialogEditor = new DialogEditor() { Dock = DockStyle.Fill }; pnlDialogEditor.Controls.Clear(); pnlDialogEditor.Controls.Add(m_oDialogEditor); m_oContactView.DialogEditorModule = m_oDialogEditor; } #endregion #region Event Followup Log if (m_oEventFollowupLog == null) { m_oEventFollowupLog = new EventFollowUpLog() { AllowSaving = true, Dock = DockStyle.Fill }; pnlEventFollowUpLog.Controls.Clear(); pnlEventFollowUpLog.Controls.Add(m_oEventFollowupLog); } #endregion #region Campaign Extra Detail if (m_CampaignExtraDetail == null) { m_CampaignExtraDetail = new CampaignExtraDetail() { CallingEnvironment = SelectionProperty.CallingEnvironment.CampaignBooking }; m_CampaignExtraDetail.Dock = DockStyle.Fill; pnlCampaignExtraDetail.Controls.Clear(); pnlCampaignExtraDetail.Controls.Add(m_CampaignExtraDetail); } #endregion }