public ActionResult AddParentMenu(int? ParentId, string WhichOpen, string MenuTextHtml, string ParentMenuName, string Type, int Priority) { if (IsValidSessions()) { WorkExperienceGroup WorkExperienceGroup = new WorkExperienceGroup(); if (Type == "add") { int LanguageId = Convert.ToInt32(Session["Language"].ToString()); WorkExperienceGroup.Name = ParentMenuName; WorkExperienceGroup.ParentID = ParentId; WorkExperienceGroup.Priority = Priority; WorkExperienceGroup.LanguageId = Convert.ToInt32(Session["Language"].ToString()); _RWorkExperience.SaveWorkExperienceGroup(WorkExperienceGroup); ViewBag.MenuList =_RWorkExperience.WorkExperienceGroups.Where(x=>x.LanguageId==LanguageId).ToList(); return PartialView("_WorkExperienceGroupTreeview"); } else { WorkExperienceGroup =_RWorkExperience.DetailsWorkExperienceGroup(Convert.ToInt32(ParentId)); WorkExperienceGroup.Name = ParentMenuName; _RWorkExperience.SaveWorkExperienceGroup(WorkExperienceGroup); return PartialView("_asdasd"); } } else return JavaScript("window.location.href ='/Admin/Home/Login';"); }
public void DeleteWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup) { _RWorkExperienceGroup.Remove(WorkExperienceGroup); _uow.SaveChanges(); }
public void SaveWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup) { if (WorkExperienceGroup.Id == 0) { _RWorkExperienceGroup.Add(WorkExperienceGroup); } else { _uow.Entry(WorkExperienceGroup).State = EntityState.Modified; } _uow.SaveChanges(); }