Пример #1
0
        public ActionResult Start()
        {
            Session.Clear();



            #region EC-CC Viewbag
            ViewBag.is_cc = is_cc;
            string cc_ext = "";
            if (is_cc)
            {
                cc_ext = "_cc";
            }
            ViewBag.cc_extension = cc_ext;
            #endregion
            List <company>          list             = companyModel.GeCompaniesWithStatus();
            List <SearchCompanyDto> searchCompanyDto = new List <SearchCompanyDto>();

            ViewBag.LogoPath = DomainUtil.LogoBaseUrl(Request.Url.AbsoluteUri.ToLower());
            if (Request.Url.AbsoluteUri.ToLower().Contains("report"))
            {
                ViewBag.LogoPath = "";
            }
            string CurrentURL = Request.Url.AbsoluteUri.ToLower();
            //        if (!CurrentURL.Contains("report"))
            {
                foreach (var item in list)
                {
                    SearchCompanyDto searchCompany = new SearchCompanyDto();
                    searchCompany.label = item.company_nm;
                    searchCompany.value = item.company_code;
                    searchCompanyDto.Add(searchCompany);
                }
            }

            ViewBag.listCompanies = list;
            //JSON goes v View
            var serializer             = new System.Web.Script.Serialization.JavaScriptSerializer();
            EcAuthorizedAttribute attr = new EcAuthorizedAttribute();

            ViewBag.newListComp = serializer.Serialize(searchCompanyDto.ToArray());
            ViewBag.CurrentURL  = CurrentURL;
            return(View());
        }