Exemplo n.º 1
0
        private void GetDropDownListData(CampaignRegisterViewModel model)
        {
            var myWatch = new Stopwatch();

            ViewBag.CustomerList =
                _customerBusiness.GetCustomersByAccount(ApplicationUserCurrent.AccountId)
                .Select(s => new SelectListItem()
            {
                Text = s.Name, Value = s.Id.ToString()
            })
                .ToList();

            myWatch.Start();
            ViewBag.StatusList =
                _statusCampaignBusiness.GetStatusCampaigns()
                .Select(s => new SelectListItem()
            {
                Text = s.Name, Value = s.Id.ToString()
            })
                .ToList();
            myWatch.Stop();

            Debugger.Log(0, "Drop", $"ms: {myWatch.ElapsedMilliseconds}");

            ViewBag.SupervisorList =
                _userBusiness.GetUserListByType(CTypePerson.PersonSupervisor, ApplicationUserCurrent.AccountId)
                .Select(s => new SelectListItem()
            {
                Text = s.Profile.Name, Value = s.Id.ToString()
            })
                .ToList();

            ViewBag.ChannelList =
                _channelBusiness.GetChanelListByCustomer(model.IdCustomer, ApplicationUserCurrent.AccountId);

            ViewBag.Services =
                _serviceBusiness.GetServicesByChannelId(ApplicationUserCurrent.AccountId, model.IdChannel)
                .Select(c => new SelectListItem()
            {
                Text = c.Name, Value = c.Id.ToString()
            })
                .ToList();
        }
Exemplo n.º 2
0
 public List <StatusCampaign> GetAllStatusCampaigns()
 {
     return(statusCampaignBusiness.GetStatusCampaigns());
 }