/// <summary> /// Checks if the User Email is available for registration. /// </summary> /// <param name="email">User Email to be checked</param> /// <param name="userId"></param> /// <returns> /// Returns true if User Email is available, else false. /// </returns> public static ResponseOutput CheckUserEmailAvailability(string email, int userId = 0) { SqlUser sqlUser = new SqlUser(); ResponseOutput responseOutput = new ResponseOutput(); responseOutput.IsSuccessful = false; if (!string.IsNullOrWhiteSpace(email)) { bool ret = sqlUser.CheckUserEmailAvailability(email, userId); if (ret) { responseOutput.IsSuccessful = true; responseOutput.OutputMessage = string.Empty; } else { responseOutput.IsSuccessful = false; responseOutput.OutputMessage = "Entered email Id already used, please use another email Id."; } } else { responseOutput.IsSuccessful = false; responseOutput.OutputMessage = "Please enter email Id."; } return responseOutput; }