Ejemplo n.º 1
0
        public ViewResult Edit(int id = 0)
        {
            SectionViewModel model = new SectionViewModel();

            if (id > 0)
            {
                model = SectionMapper.ToViewModel(sectionSrv.Get(id));
            }

            model.CurrentRole = UserManager.GetRoles(User.Identity.GetUserId()).FirstOrDefault();

            return(View(model));
        }
Ejemplo n.º 2
0
        // GET: Sections/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Section section = sectionService.Get(id);

            if (section == null)
            {
                return(HttpNotFound());
            }
            return(View(section));
        }
Ejemplo n.º 3
0
        public JsonResult GetSections(SectionViewModel model)
        {
            var sections = sectionService.Get(model)
                           .Select(s => new
            {
                s.Id,
                s.Name,
                DateCreate = s.DateCreate.ToShortDateString(),
                s.IsActive,
                s.IsDelete
            });

            return(Json(new { data = sections, model.draw, recordsTotal = model.Total, recordsFiltered = model.Total }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public SectionModel GetSection([FromBody] int id)
        {
            var response = _iSectionService.Get(x => x.Id == id);
            //_iSectionService.Dispose();

            var model = _iMapper.Map <SectionModel>(response);

            return(model);
        }
        public HttpResponseMessage Gets(int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemsResponse <SectionEnrollment> response = new ItemsResponse <SectionEnrollment>();

            response.Items = _sectionService.Get(id);
            return(Request.CreateResponse(response));
        }
Ejemplo n.º 6
0
        // GET: Groups/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Group group = groupService.Get(id);

            if (group == null)
            {
                return(HttpNotFound());
            }
            List <Section> sections = new List <Section>();

            foreach (var item in groupSectionService.GetAll().Where(x => x.GroupID == group.ID))
            {
                sections.Add(sectionService.Get(item.SectionID));
            }
            if (sections.Count > 0)
            {
                ViewBag.Sections = sections;
            }
            return(View(group));
        }
Ejemplo n.º 7
0
 public ActionResult Edit(int id)
 {
     return(View(sectionService.Get(id)));
 }
Ejemplo n.º 8
0
 public Core.Dto.Section Get(Guid id)
 {
     return(_sectionService.Get(id));
 }