Beispiel #1
0
        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';");
        }
Beispiel #2
0
 public void DeleteWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup)
 {
     _RWorkExperienceGroup.Remove(WorkExperienceGroup);
     _uow.SaveChanges();
 }
Beispiel #3
0
 public void SaveWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup)
 {
     if (WorkExperienceGroup.Id == 0)
     {
         _RWorkExperienceGroup.Add(WorkExperienceGroup);
     }
     else
     {
         _uow.Entry(WorkExperienceGroup).State = EntityState.Modified;
     }
     _uow.SaveChanges();
 }