コード例 #1
0
ファイル: GalleryController.cs プロジェクト: Chitva/Ganjine
        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';");
        }
コード例 #2
0
 public void DeleteWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup)
 {
     _RWorkExperienceGroup.Remove(WorkExperienceGroup);
     _uow.SaveChanges();
 }
コード例 #3
0
 public void SaveWorkExperienceGroup(WorkExperienceGroup WorkExperienceGroup)
 {
     if (WorkExperienceGroup.Id == 0)
     {
         _RWorkExperienceGroup.Add(WorkExperienceGroup);
     }
     else
     {
         _uow.Entry(WorkExperienceGroup).State = EntityState.Modified;
     }
     _uow.SaveChanges();
 }