示例#1
0
        public IActionResult Edit(int id)
        {
            var emp    = lopHocRepository.Get(id);
            var result = new EditLopHocViewsModels()
            {
                Name = emp.LopHocName,
                Id   = emp.LopHocId
            };

            return(View(result));
        }
示例#2
0
        public IActionResult Edit(EditLopHocViewsModels models)
        {
            var empl = new LopHoc()
            {
                LopHocId   = models.Id,
                LopHocName = models.Name
            };

            if (empl != null)
            {
                lopHocRepository.Edit(empl);
                return(RedirectToAction("Index", new { id = empl.LopHocId }));
            }
            return(View(models));
        }