예제 #1
0
        public ActionResult Index()
        {
            //var highlightOrder = _highlightOrderService.GetHighlights(new GetHighlightOrdersRequest());
            var viewModel = new HighlightOrderViewModel();
            viewModel.Groups = _highlightGroupService.GetHighlightGroups(new GetHighlightGroupsRequest
            {
                Take = -1,
                SortingDictionary = new Dictionary<string, SortOrder> { { "Order", SortOrder.Ascending } }
            }).HighlightGroups.Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Name }).ToList();
            viewModel.Groups.Insert(0, new SelectListItem { Value = "0", Text = "Choose Group" });

            viewModel.RoleGroupOptions = _roleService.GetRoleGroups(new Services.Requests.RoleGroup.GetRoleGroupsRequest
            {
                Take = -1,
                SortingDictionary = new Dictionary<string, SortOrder> { { "Name", SortOrder.Ascending } }
            }).RoleGroups.Select(x => new SelectListItem
            {
                Text = x.Name,
                Value = x.Id.ToString()
            }).ToList();
            return View(viewModel);
        }
예제 #2
0
 public JsonResult SaveStatic(HighlightOrderViewModel viewModel)
 {
     var req = viewModel.MapTo<SaveStaticHighlightOrderRequest>();
     return Json(HighlightOrderService.SaveStaticHighlight(req));
 }