Exemplo n.º 1
0
 public void Update(EntrepreneursUpdateRequest model, int userId)
 {
     _dataProvider.ExecuteNonQuery("dbo.Entrepreneurs_Update",
                                   inputParamMapper : delegate(SqlParameterCollection parms)
     {
         parms.AddWithValue("@Id", model.Id);
         parms.AddWithValue("@UserId", userId);
         parms.AddWithValue("@IndustryTypeId", model.IndustryTypeId);
         parms.AddWithValue("@CompanyStatusId", model.CompanyStatusId);
         parms.AddWithValue("@HasSecurityClearance", model.HasSecurityClearance);
         parms.AddWithValue("@HasInsurance", model.HasInsurance);
         parms.AddWithValue("@HasBonds", model.HasBonds);
         parms.AddWithValue("@SpecializedEquipment", model.SpecializedEquipment);
         parms.AddWithValue("@ImageUrl", model.ImageUrl);
     });
 }
Exemplo n.º 2
0
 public ActionResult <SuccessResponse> Update(int id, EntrepreneursUpdateRequest model)
 {
     try
     {
         if (id == model.Id)
         {
             _entrepreneursService.Update(model, _authService.GetCurrentUserId());
             SuccessResponse resp = new SuccessResponse();
             return(Ok200(resp));
         }
         else
         {
             return(StatusCode(400, new ErrorResponse("Bad Request: Body Id does not match Entity")));
         }
     }
     catch (Exception ex)
     {
         Logger.LogError(ex.ToString());
         return(StatusCode(500, new ErrorResponse(ex.Message)));
     }
 }