public bool UpdateUsersReviews(UserReviewsModel model, string userid)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         try
         {
             SqlParameter[] parameters = new SqlParameter[] {
                 new SqlParameter("@id", model.Id),
                 new SqlParameter("@UserId", userid),
                 new SqlParameter("@name", model.Name),
                 new SqlParameter("@Email", model.Email),
                 new SqlParameter("@Tagline", model.Tagline),
                 new SqlParameter("@Message", model.Message),
             };
             var data =
                 SqlHelper.ExecuteNonQuery
                 (
                     connection,
                     CommandType.StoredProcedure,
                     "usp_UpdateSuccessStory",
                     parameters
                 );
             if (data > 0)
             {
                 return(true);
             }
         }
         finally
         {
             SqlHelper.CloseConnection(connection);
         }
     }
     throw new Exception("Unable to delete data");
 }
Example #2
0
        public bool UpdateUserReview(UsersReviewsViewModel data, string userid)
        {
            var model = new UserReviewsModel()
            {
                Id      = data.Id,
                Name    = data.Name,
                Tagline = data.Tagline,
                Message = data.Message,
                Email   = data.Email
            };
            var result = usersReviewsRepository.UpdateUsersReviews(model, userid);

            if (result)
            {
                return(true);
            }
            throw new Exception("Unable to Update data");
        }