Exemplo n.º 1
0
        public ActionResult CreateOrEdit(Guid id)
        {
            bool isNew = false;
            var  bo    = _Service.GetSingle(id);

            if (bo == null)
            {
                bo    = new DepartmentType();
                bo.ID = id;
                isNew = true;
            }
            var boVM = new DepartmentTypeVM(bo);

            //! 使用调转的方式包括对话框和页面方式
            //var editor = PageComponentRepository<DepartmentTypeVM>.CreateOrEditDialog(boVM, isNew);
            var editor = PageComponentRepository <DepartmentTypeVM> .CreateOrEditPage(boVM, isNew);

            return(Json(editor));
        }