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()); }