当前位置: 首页>>代码示例>>C#>>正文


C# BrightPlatformEntities.FIPopulateCampaignListCompanies方法代码示例

本文整理汇总了C#中BrightPlatformEntities.FIPopulateCampaignListCompanies方法的典型用法代码示例。如果您正苦于以下问题:C# BrightPlatformEntities.FIPopulateCampaignListCompanies方法的具体用法?C# BrightPlatformEntities.FIPopulateCampaignListCompanies怎么用?C# BrightPlatformEntities.FIPopulateCampaignListCompanies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrightPlatformEntities的用法示例。


在下文中一共展示了BrightPlatformEntities.FIPopulateCampaignListCompanies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadCampaignList

        private void LoadCampaignList(eCampaignListLoadCallee pLoadType)
        {
            /**
             * unsubscribe this event first so that only data source change
             * will be triggered. this to avoid double calls to related modules
             * when changing views or rows or data source.
             */
            this.SetGridChangeRowEvent(false);
            int _FocusedRow = gvCampaignList.FocusedRowHandle;
            DateTime logDate1 = DateTime.UtcNow;
            m_CampaignListSelectedRow = 0;

            /**
             * set this flag to let know the dialog component that a new campaign list
             * has been loaded, thus, needing to create another dialog instance based
             * on this loaded campaign.
             */
            if (pLoadType == eCampaignListLoadCallee.CampaignListChange ||
                pLoadType == eCampaignListLoadCallee.EventLogOnLoad)
                m_BrightSalesProperty.CampaignBooking.Questionnaire.State = SelectionProperty.DialogEditorState.Empty;

            try {
                m_lsmsCampaignListData = null;
                m_efDbModel = null;
                m_efDbModel = new BrightPlatformEntities(UserSession.EntityConnection) {
                    CommandTimeout = 0
                };

                gcCampaignList.DataSource = null;
                gvCampaignList.Columns.Clear();
                gvCampaignList.FindFilterText = string.Empty;
                lblTotalRows.Text = "Records: 0";
                this.InitializeCampaignListControls(false);
                this.ClearGridFilter();

                if (m_BrightSalesProperty.CampaignList.CampaignListMode == SelectionProperty.CampaignListMode.CompaniesOnly) {
                    m_efDbModel.FIPopulateCampaignListCompanies(SubCampaignId, UserSession.CurrentUser.UserId);
                    int _final_list_id = m_efDbModel.final_lists.FirstOrDefault(i => i.sub_campaign_id == SubCampaignId).id;
                    m_lsmsCampaignListData = new LinqServerModeSource() {
                        DefaultSorting = "id",
                        KeyExpression = "uid",
                        QueryableSource = m_efDbModel.vw_campaign_list_companies.Where(i =>
                            i.final_list_id == _final_list_id &&
                            i.user_id == UserSession.CurrentUser.UserId
                        ).AsQueryable()
                        //QueryableSource = m_efDbModel.FIGetVwCampaignListCompanies(_final_list_id, UserSession.CurrentUser.UserId).ToList().AsQueryable()
                    };
                    m_lsmsCampaignListData.ExceptionThrown += new LinqServerModeExceptionThrownEventHandler(_lsmsCampaignListData_ExceptionThrown);
                    m_lsmsCampaignListData.InconsistencyDetected += new LinqServerModeInconsistencyDetectedEventHandler(_lsmsCampaignListData_InconsistencyDetected);

                    //gcCampaignList.DataSource = m_efDbModel.FIGetVwCampaignListCompanies(_final_list_id, UserSession.CurrentUser.UserId);
                    /** /
                    m_lsmsCampaignListData = new LinqServerModeSource()
                    {
                        DefaultSorting = "id",
                        KeyExpression = "uid",
                        QueryableSource = m_efDbModel.FIGetVwCampaignListCompanies(_final_list_id, UserSession.CurrentUser.UserId).ToList().AsQueryable()
                    };
                    m_lsmsCampaignListData.ExceptionThrown += new LinqServerModeExceptionThrownEventHandler(_lsmsCampaignListData_ExceptionThrown);
                    m_lsmsCampaignListData.InconsistencyDetected += new LinqServerModeInconsistencyDetectedEventHandler(_lsmsCampaignListData_InconsistencyDetected);
                    /**/

                    gcCampaignList.DataSource = m_lsmsCampaignListData;
                    gvCampaignList.Columns["uid"].Visible = false;
                    gvCampaignList.Columns["user_id"].Visible = false;
                    gvCampaignList.Columns["id"].Visible = false;
                    gvCampaignList.Columns["account_id"].Visible = false;
                    gvCampaignList.Columns["locked"].Visible = false;
                    gvCampaignList.Columns["locked_by"].Visible = false;
                    gvCampaignList.Columns["locked_timestamp"].Visible = false;
                    gvCampaignList.Columns["final_list_id"].Visible = false;
                    gvCampaignList.Columns["account_latitude"].Visible = false;
                    gvCampaignList.Columns["account_longitude"].Visible = false;
                    gvCampaignList.Columns["contact_id"].Visible = false;
                    gvCampaignList.Columns["account_address"].Visible = false;
                    gvCampaignList.Columns["contact_status"].Visible = false;
                }
                else if (m_BrightSalesProperty.CampaignList.CampaignListMode == SelectionProperty.CampaignListMode.CampaniesAndContacts) {
                    int _final_list_id = m_efDbModel.final_lists.FirstOrDefault(i => i.sub_campaign_id == SubCampaignId).id;
                    m_efDbModel.FIPopulateCampaignListCompaniesAndContacts(SubCampaignId, _final_list_id, UserSession.CurrentUser.UserId);
                    m_lsmsCampaignListData = new LinqServerModeSource() {
                        DefaultSorting = "id",
                        KeyExpression = "uid",
                        QueryableSource = m_efDbModel.vw_campaign_list_companies_and_contacts.Where(i =>
                            i.final_list_id == _final_list_id &&
                            i.user_id == UserSession.CurrentUser.UserId
                        ).AsQueryable()
                        //QueryableSource = m_efDbModel.FIGetVwCampaignListCompaniesAndContacts(_final_list_id, UserSession.CurrentUser.UserId).ToList().AsQueryable()
                    };
                    m_lsmsCampaignListData.ExceptionThrown += new LinqServerModeExceptionThrownEventHandler(_lsmsCampaignListData_ExceptionThrown);
                    m_lsmsCampaignListData.InconsistencyDetected += new LinqServerModeInconsistencyDetectedEventHandler(_lsmsCampaignListData_InconsistencyDetected);

                    //gcCampaignList.DataSource = m_efDbModel.FIGetVwCampaignListCompaniesAndContacts(_final_list_id, UserSession.CurrentUser.UserId);

                    /** /
                    m_lsmsCampaignListData = new LinqServerModeSource()
                    {
                        DefaultSorting = "id",
                        KeyExpression = "uid",
                        QueryableSource = m_efDbModel.FIGetVwCampaignListCompaniesAndContacts(_final_list_id, UserSession.CurrentUser.UserId).ToList().AsQueryable()
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例2: Index

        public ActionResult Index()
        {
            /**
             * connection info.
             */
            #region Code Logic
            string _Connection = ConfigurationManager.ConnectionStrings["DefaultEntityConnection"].ToString();
            if (string.IsNullOrEmpty(_Connection))
                Response.Redirect(Url.RouteUrl(new { action = "DisplayError", pExceptionMessage = "No available connection. Please kindly contact your administrator." }));
            #endregion

            string sdata = null;
            string _title = "";
            try
            {
                int _subcampaignid = int.Parse(ValidationUtility.IFNullString(Request.QueryString["subcampaignid"], "0"));
                int _userid = int.Parse(ValidationUtility.IFNullString(Request.QueryString["userid"], "0"));
                //_title = ValidationUtility.IFNullString(Request.QueryString["title"], "");

                if (_subcampaignid <= 0 || _userid <= 0)
                {
                    Response.Redirect(Url.RouteUrl(new { action = "DisplayError", pExceptionMessage = "Invalid SubcampaignId or UserId." }));

                }

                using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(_Connection))
                {
                    subcampaign sc = _efDbContext.subcampaigns.FirstOrDefault(i => i.id == _subcampaignid);
                    if (sc != null)
                    {
                        if (ValidationUtility.IFNullString(sc.title, "") != "")
                        {
                            _title = sc.title;
                        }

                        campaign c = _efDbContext.campaigns.FirstOrDefault(i => i.id == sc.campaign_id);
                        _efDbContext.Detach(sc);

                        if (c != null)
                        {
                            if (ValidationUtility.IFNullString(c.campaign_name, "") != "")
                            {
                                _title = c.campaign_name + " > " + _title;
                            }

                            customer cus = _efDbContext.customers.FirstOrDefault(i => i.id == c.customer_id);
                            _efDbContext.Detach(c);

                            if (cus != null)
                            {
                                if (ValidationUtility.IFNullString(cus.customer_name, "") != "")
                                {
                                    _title = cus.customer_name + " > " + _title;
                                }
                                _efDbContext.Detach(cus);
                            }
                        }
                    }

                    _efDbContext.FIPopulateCampaignListCompanies(_subcampaignid, _userid);
                    int _final_list_id = _efDbContext.final_lists.FirstOrDefault(i => i.sub_campaign_id == _subcampaignid).id;

                    List<CXbvGetVwCampaignListCompaniesStatuses> data = _efDbContext.FXbvGetVwCampaignListCompaniesStatuses(_final_list_id, _userid).ToList();

                    for (int i = 0; i < data.Count; i++)
                    {
                        if (sdata != null) sdata += ", ";
                        sdata += "[\"" + data[i].Company_Status + "\", " + data[i].total + "]";
                    }
                    if (sdata != null) sdata = "[" + sdata + "]";

                        //System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
                        //ViewBag.Data = jss.Serialize(data);
                }
            }
            catch (Exception ex)
            {
                Response.Redirect(Url.RouteUrl(new { action = "DisplayError", pExceptionMessage = ex.ToString() }));
            }

            //ViewBag.Data = "[[\"Open\", 321], [\"In Progress\", 370], [\"Not Qualified\", 225], [\"Follow-Up\", 35], [\"relreased\", 19], [\"Approved\", 8]]";
            ViewBag.Title = _title;
            ViewBag.Data = sdata;

            return View();
        }
开发者ID:,项目名称:,代码行数:86,代码来源:


注:本文中的BrightPlatformEntities.FIPopulateCampaignListCompanies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。