public ActionResult AddCategor(CategoryModel model) { LessonPlanCategory cat = new LessonPlanCategory(); cat.Name = model.Name; cat.ParentId = model.ParentId; cat.HasParent = true; cat.CreatedBy = "Naveed"; cat.CreatedOn = DateTime.Now; cat.IsActive = true; unitOfWork.LessonPlanCategoryRepository.Insert(cat); unitOfWork.Save(); return(RedirectToAction("Index", model.controller, new { Id = model.ParentId })); }
public CategoryModel ToObj(LessonPlanCategory LessonsPlan) { if (LessonsPlan != null) { CategoryModel obj = new CategoryModel() { Id = LessonsPlan.Id, Name = LessonsPlan.Name, URL = LessonsPlan.ImageURL, controller = LessonsPlan.ControllerName }; return(obj); } return(null); }