Пример #1
0
        public void GetAllServiceTypes()
        {
            var result = _service.GetAll();
            var count  = result.Count();

            Assert.AreEqual(2, count);
        }
Пример #2
0
        public ActionResult Index2(int id = -1)
        {
            if (id == -1)
            {
                id = 1;
            }

            ViewBag.ID       = id;
            ViewBag.Services = ServiceTypeService.GetAll();
            return(View());
        }
Пример #3
0
        //
        // GET: /AdminService/
        public ActionResult List()
        {
            var model = ServiceTypeService.GetAll();

            if (TempData["Error"] != null)
            {
                ViewBag.Error = TempData["Error"];
            }

            return(View(model));
        }
Пример #4
0
        public static IEnumerable <SelectListItem> FillddlServiceType()
        {
            var service    = new ServiceTypeService();
            var leaveTypes = service.GetAll();
            var listitems  = leaveTypes.Select(x =>

                                               new SelectListItem
            {
                Text  = x.ServiceName,
                Value = x.Id.ToString()
            });

            return(listitems);
        }
Пример #5
0
        public DashboardModel GetPosts2ByCurrentUser()
        {
            var model = new DashboardModel()
            {
                Labels = new List <string>(),
                Datas  = new List <int>()
            };

            if (HttpUtil.UserProfile == null)
            {
                return(model);
            }

            var list     = PostService.GetAllByUserId(HttpUtil.UserProfile.ID);
            var services = ServiceTypeService.GetAll();

            foreach (var s in services)
            {
                model.Labels.Add(s.Name);
                model.Datas.Add(list.Count(l => l.ServiceID == s.ID));
            }

            return(model);
        }
Пример #6
0
        public static IEnumerable<SelectListItem> FillddlServiceType()
        {
            var service = new ServiceTypeService();
            var leaveTypes = service.GetAll();
            var listitems = leaveTypes.Select(x =>

                new SelectListItem
                {
                    Text = x.ServiceName,
                    Value = x.Id.ToString()
                });
            return listitems;
        }
        // GET: ServiceTypes
        public ActionResult Index()
        {
            var servicetype = Service.GetAll();

            return(View(servicetype));
        }
 public ActionResult <List <ServiceTypeDto> > GetServiceTypes()
 {
     return(_service.GetAll());
 }
Пример #9
0
 public List <Service> GetAllServices()
 {
     return(ServiceTypeService.GetAll());
 }