コード例 #1
0
ファイル: CategoryController.cs プロジェクト: 88886/jnmmes
        public async Task <ActionResult> Save(CategoryViewModel model)
        {
            using (CategoryServiceClient client = new CategoryServiceClient())
            {
                Category obj = new Category()
                {
                    Key         = model.Name.ToUpper(),
                    Status      = model.Status,
                    Description = model.Description,
                    Editor      = User.Identity.Name,
                    EditTime    = DateTime.Now,
                    CreateTime  = DateTime.Now,
                    Creator     = User.Identity.Name
                };
                MethodReturnResult rst = await client.AddAsync(obj);

                if (rst.Code == 0)
                {
                    rst.Message = string.Format(EDCResources.StringResource.Category_Save_Success
                                                , model.Name);
                }
                return(Json(rst));
            }
        }