當前位置: 首頁>>代碼示例>>C#>>正文


C# BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses方法代碼示例

本文整理匯總了C#中BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses方法的典型用法代碼示例。如果您正苦於以下問題:C# BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses方法的具體用法?C# BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses怎麽用?C# BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BrightPlatformEntities的用法示例。


在下文中一共展示了BrightPlatformEntities.FXbvGetVwCampaignListCompaniesStatuses方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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.FXbvGetVwCampaignListCompaniesStatuses方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。