Esempio n. 1
0
 public static ProductGroupVendorAddCommand ToCommandVenderAdd(this ProductGroupVendorAddRequest request, string uid)
 {
     if (request == null)
     {
         return(null);
     }
     return(new ProductGroupVendorAddCommand()
     {
         ProductGroupId = request.ProductGroupId,
         UpdatedUid = uid,
         VendorId = request.VendorId
     });
 }
Esempio n. 2
0
 public async Task <IActionResult> AddVendor([FromBody] ProductGroupVendorAddRequest request)
 {
     try
     {
         BaseResponse     response = new BaseResponse();
         ValidationResult validate = ProductGroupVendorAddRequestValidator.ValidateModel(request);
         if (validate.IsValid)
         {
             response = await _productGroupAppService.AddVendor(request);
         }
         else
         {
             response.SetFail(validate.Errors.Select(p => p.ToString()));
         }
         return(Json(response));
     }
     catch (Exception e)
     {
         _logger.LogError(e, Common.Common.GetMethodName(), request);
         throw;
     }
 }