Beispiel #1
0
 private void GetData(int pCustomerId, int pCampaignId, int pSubCampaignId)
 {
     m_SubCampaignId = pSubCampaignId;
     using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
         gcNurtureSubCampaign.DataSource = null;
         gcNurtureSubCampaign.DataSource = _efDbContext.FIGetSubCampaignNurtureList(pCustomerId, pCampaignId, pSubCampaignId).ToList();
     }
 }
Beispiel #2
0
        public void GetEventTypes(int pSubCampaignId = 0, string pDefaultEventType = null)
        {
            List<EventType> _lstEventTypes = new List<EventType>();
            _lstEventTypes.Add(new EventType() { id = -1, name = "Call Back" });
            //_lstEventTypes.Add(new EventType() { id = -2, name = "Follow Up Mail" }); //https://brightvision.jira.com/browse/PLATFORM-2285
            _lstEventTypes.Add(new EventType() { id = -3, name = "Todo" });

            if (pSubCampaignId > 0) {
                m_EventSubCampaignId = pSubCampaignId;
                using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
                    int _CampaignId = (int)_efDbContext.subcampaigns.FirstOrDefault(i => i.id == m_EventSubCampaignId).campaign_id;
                    int _CustomerId = (int)_efDbContext.campaigns.FirstOrDefault(i => i.id == _CampaignId).customer_id;
                    List<CTSubCampaignNurtureItem> _lstNurtureItems = _efDbContext.FIGetSubCampaignNurtureList(_CustomerId, _CampaignId, m_EventSubCampaignId).ToList();
                    if (_lstNurtureItems.Count > 0) {
                        foreach (CTSubCampaignNurtureItem _item in _lstNurtureItems) {
                            if (!Convert.ToBoolean(_item.selected))
                                continue;

                            _lstEventTypes.Add(new EventType() { id = _item.sub_campaign_id, name = string.Format("Nurture ({0} > {1} > {2})", _item.customer_name, _item.campaign_name, _item.sub_campaign_name) });
                        }
                    }
                }
            }

            /*
             * https://brightvision.jira.com/browse/PLATFORM-2759
            */
            icboEventType.Properties.Items.Clear();
            int iImageIndex = 0;
            for (int i = 0; i < _lstEventTypes.Count; i++) {
                switch (_lstEventTypes[i].name) {
                    case "Call Back": iImageIndex = 0; break;
                    case "Todo": iImageIndex = 1; break;
                    default: iImageIndex = 2; break;
                }
                icboEventType.Properties.Items.Add(new ImageComboBoxItem(_lstEventTypes[i].name, _lstEventTypes[i].id, iImageIndex));
            }
            icboEventType.Properties.SmallImages = m_images;

            this.icboEventType.EditValueChanged -= new System.EventHandler(this.icboEventType_EditValueChanged);
            if (string.IsNullOrEmpty(pDefaultEventType) || pDefaultEventType.Equals("Make Call"))
                icboEventType.EditValue = -1;
            else if (pDefaultEventType.Equals("Send Mail"))
                icboEventType.EditValue = -2;
            else if (pDefaultEventType.Equals("Todo"))
                icboEventType.EditValue = -3;
            this.icboEventType.EditValueChanged += new System.EventHandler(this.icboEventType_EditValueChanged);
        }