Esempio n. 1
0
        public UserCompaniesInfo getUsercompanyInfo()
        {
            List <CompanyTO> CompanyList = new List <CompanyTO>();
            List <Int32>     companyIds  = new List <Int32>();

            if (HttpContext.Current.Session["companyId"] != null)
            {
                companyIds = (List <Int32>)HttpContext.Current.Session["companyId"];
                foreach (var item in companyIds)
                {
                    var data = cmpRepo.getAllCompanies().Where(x => x.Company_Id == item && x.IsActive == true).FirstOrDefault();
                    if (data != null)
                    {
                        CompanyList.Add(data);
                    }
                }
                userComapniesData.comPanies = CompanyList;

                userComapniesData.companyId = companyIds;
                return(userComapniesData);
            }

            else
            {
                return(userComapniesData);
            }
        }
Esempio n. 2
0
 // GET: Companies
 public ActionResult Index()
 {
     return(View(cmpRepo.getAllCompanies()));
 }