コード例 #1
0
        public ActionResult UpdateCategory()
        {
            InformationCategoryEntity category = RequestArgs <InformationCategoryEntity>();

            if (category == null)
            {
                return(RespondResult(false, "参数无效。"));
            }

            category.Domain = UserContext.User.Domain;
            _informationManager.UpdateCategory(category);

            #region 操作日志

            _operatedLogManager.Create(new OperatedLogEntity()
            {
                Domain      = DomainContext.Domain.Id,
                AppId       = DomainContext.AppId,
                User        = UserContext.User.Id,
                IP          = Request.UserHostAddress,
                Module      = EnumModule.Information,
                Description = "更新分类信息分类"
            });

            #endregion

            return(RespondResult());
        }
コード例 #2
0
        public void UpdateCategory(InformationCategoryEntity informationCategory)
        {
            if (informationCategory == null)
            {
                Debug.Assert(false, "informationCategory 为空");
                return;
            }

            _dataBase.Update(informationCategory);
        }
コード例 #3
0
        public void CreateCategory(InformationCategoryEntity informationCategory)
        {
            if (informationCategory == null)
            {
                Debug.Assert(false, "informationCategory 为空");
                return;
            }

            informationCategory.CreateTime = DateTime.Now;
            _dataBase.Insert(informationCategory);
        }
コード例 #4
0
        public ActionResult GetCategory()
        {
            string id = Request.QueryString["id"];

            if (String.IsNullOrEmpty(id))
            {
                return(RespondResult(false, "参数无效。"));
            }

            InformationCategoryEntity category = _informationManager.GetCategory(Guid.Parse(id));

            return(RespondDataResult(category));
        }
コード例 #5
0
        public InformationCategoryEntity GetCategory(Guid id)
        {
            InformationCategoryEntity category = new InformationCategoryEntity();

            category.Id = id;

            if (_dataBase.Fill <InformationCategoryEntity>(category))
            {
                return(category);
            }
            else
            {
                return(null);
            }
        }