Ejemplo n.º 1
0
        public ActionResult Create(ModelSysMenuManageCreate model, FormCollection collection)
        {
            SysMenu sysMenu = null;
            try
            {
                model.Save();
                if (model.SysMenuId != null)
                {

                    sysMenu = bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == model.SysMenuId));
                }
                else
                {

                    sysMenu = bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == model.MenuId));
                }

                if (sysMenu != null && sysMenu.ParentID != null)
                {

                    if (bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == sysMenu.ID)).ParentID != null)
                    {
                        SysMenu sysMenu2 = bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == sysMenu.ParentID));
                        if (sysMenu2.ParentID != null)
                        {
                            if (bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == sysMenu2.ID)).ParentID != null)
                            {
                                SysMenu sysMenu3 = bizSysMenu.GetFirst(ReflectionTools.SerializeExpression<SysMenu>(x => x.ID == sysMenu2.ParentID));
                                if (sysMenu3.ParentID == null)
                                {
                                    return Content(WebTools.ScriptCloseEmbeddedFrameDialog(DialogOption.GetDefaultInstance()));
                                }
                            }
                        }
                        else if (sysMenu2.ParentID == null && model.SysMenuId == null)
                        {
                            return Content(WebTools.ScriptCloseEmbeddedFrameDialog(DialogOption.GetDefaultInstance()));
                        }
                    }
                }
                var option = DialogOption.GetDefaultInstance();
                option.RefreshOpenerAsynchronous = false;
                option.HighlightData = model.SysMenuEntity.ID;
                return Content(WebTools.ScriptCloseDialog(option));
            }
            catch
            {
                Error = CNDreams.Resources.Properties.Resources.M00002E;
                model.RetriveData();
                return View(model);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 创建或修改菜单
 /// </summary>
 public ActionResult Create(ModelSysMenuManageCreate model)
 {
     ViewBag.PageState = model.PageState;
     model.RetriveData();
     return View(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 验证菜单名是否存在
 /// </summary>
 public ActionResult RemoteCheckMenuName(ModelSysMenuManageCreate model)
 {
     return false ? Json(false, JsonRequestBehavior.AllowGet) : Json(true, JsonRequestBehavior.AllowGet);
 }