Exemplo n.º 1
0
        public ActionResult AjaxForm()
        {
            var model = new Category
            {
                IsShow   = true,
                Sort     = 0,
                ParentId = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0,
            };
            var lstCate = _categoryDa.GetChildByParentId(false);

            ViewBag.lstCate    = lstCate;
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            var item = lstCate.FirstOrDefault(c => c.ID == model.ParentId);

            if (DoAction == ActionType.Edit)
            {
                model            = _categoryDa.GetById(ArrId.FirstOrDefault());
                ViewBag.ParentId = item != null ? item.IsLevel : 0;
            }
            else
            {
                ViewBag.ParentId = item != null ? item.IsLevel + 1 : 1;
            }
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult AjaxForm()
        {
            var model = new DNLevelRoomItem
            {
                IsShow = true,
                Sort   = 0,
                ID     = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0,
            };

            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            if (DoAction == ActionType.Edit)
            {
                model = _api.GetLevelRoomItem(ArrId.FirstOrDefault());
            }
            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult AjaxForm()
        {
            var sysPage = new ModulePage
            {
                Sort     = 0,
                ParentId = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0,
            };

            if (DoAction == ActionType.Edit)
            {
                sysPage = _da.Get(ArrId.FirstOrDefault());
            }
            ViewBag.ParentID   = _da.GetChildByParentId();
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            return(View(sysPage));
        }
        public ActionResult AjaxForm()
        {
            var model = new DNDocumentLevelItem
            {
                IsShow = true,
                Sort   = 0,
                ID     = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0,
            };

            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            ViewBag.PrarentID  = _api.GetListItemByParentID(UserItem.AgencyID);
            if (DoAction == ActionType.Edit)
            {
                model = _api.GetItemsByID(ArrId.FirstOrDefault());
            }
            return(View(model));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Form dùng cho thêm mới, sửa. Load bằng Ajax dialog
        /// </summary>
        /// <returns></returns>
        public ActionResult AjaxForm()
        {
            var model = new Menu
            {
                IsShow   = true,
                Sort     = 0,
                ParentId = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0
            };

            if (DoAction == ActionType.Edit)
            {
                model = _da.GetById(ArrId.FirstOrDefault());
            }
            ViewBag.ParentID   = _da.GetListByParentId(groupid, Utility.AgencyId);
            ViewBag.CategoryID = _categoryDa.GetChildByParentId(false);
            ViewBag.PageID     = _sysPageDa.GetChildByParentId();
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            return(View(model));
        }
Exemplo n.º 6
0
        public ActionResult AjaxForm()
        {
            var moduleModel = new DN_Module
            {
                IsShow   = true,
                IsAll    = true,
                Ord      = 0,
                ParentID = (ArrId.Any()) ? ArrId.FirstOrDefault() : 1
            };

            if (DoAction == ActionType.Edit)
            {
                moduleModel = _moduleDa.GetByID(ArrId.FirstOrDefault());
            }
            ViewBag.Group      = _groupDa.GetAll();
            ViewBag.PrarentID  = _moduleDa.GetListItemByParentID();
            ViewData.Model     = moduleModel;
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            return(View());
        }
Exemplo n.º 7
0
        public ActionResult AjaxForm()
        {
            var moduleModel = new Module
            {
                IsShow    = true,
                Ord       = 0,
                PrarentID = (ArrId.Any()) ? ArrId.FirstOrDefault() : 0
            };

            if (DoAction == ActionType.Edit)
            {
                moduleModel = _moduleDa.GetById(ArrId.FirstOrDefault());
            }
            var ltsAllItems = _moduleDa.GetAllListSimple();

            ltsAllItems        = _moduleDa.GetAllSelectList(ltsAllItems, moduleModel.ID, true);
            ViewBag.PrarentID  = ltsAllItems;
            ViewData.Model     = moduleModel;
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            return(View());
        }