Exemplo n.º 1
0
        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));
            }
        }