Exemple #1
0
        public async Task <ActionResult> Save(MaterialTypeViewModel model)
        {
            using (MaterialTypeServiceClient client = new MaterialTypeServiceClient())
            {
                MaterialType obj = new MaterialType()
                {
                    Key = model.Name,
                    MainProductQtyPerLot = model.MainProductQtyPerLot,
                    MainRawQtyPerLot     = model.MainRawQtyPerLot,
                    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(FMMResources.StringResource.MaterialType_Save_Success
                                                , model.Name);
                }
                return(Json(rst));
            }
        }