public ActionResult CreateNewRentals(string name, string movie) { bool boolean = true; if (RentalHelper.CountingMovieDuplicates(name, movie) <= MovieHelper.CountingMovieDuplicates(name, movie)) { RentalHelper.WriteNewRental(name, movie); if (RentalHelper.DoesMovieReturned(name, movie)) { ErrorMsg = "There seems to be a problem, the movie rental has not been made, try again"; boolean = true; } else { ErrorMsg = "Movie rental successful!"; boolean = false; } } var ReqOfRent = new { strMsg = ErrorMsg, Isbool = boolean }; return(Json(ReqOfRent)); }