Beispiel #1
0
        public void Update(ProviderLicenseUpdateRequest model, int userId)
        {
            string procName = "dbo.Licenses_Update";

            _data.ExecuteNonQuery(procName, inputParamMapper : delegate(SqlParameterCollection col)
            {
                col.AddWithValue("@Id", model.Id);
                col.AddWithValue("@LicenseStateId", model.LicenseStateId);
                col.AddWithValue("@LicenseNumber", model.LicenseNumber);
                col.AddWithValue("@DateExpires", model.DateExpires);
                col.AddWithValue("@ModifiedBy", userId);
            });
        }
        public ActionResult <ItemResponse <int> > Update(ProviderLicenseUpdateRequest model)
        {
            int          code     = 200;
            BaseResponse response = null;

            try
            {
                int userId = _authService.GetCurrentUserId();
                _service.Update(model, userId);
                response = new SuccessResponse();
            }
            catch (Exception ex) {
                code     = 500;
                response = new ErrorResponse(ex.Message);
            }
            return(StatusCode(code, response));
        }