public bool IfEmailAddressIsUnique(string email) { try { DLL.User obj = new DLL.User(); return(obj.IfEmailAddressIsUnique(email)); } catch (Exception ex) { return(false); } }
public bool IfUserNameIsUnique(string userName) { try { DLL.User obj = new DLL.User(); return(obj.IfUserNameIsUnique(userName)); } catch (Exception ex) { return(false); } }
public bool AuthenticateUser(string userName, string password) { try { DLL.User obj = new DLL.User(); return(obj.AuthenticateUser(userName, password)); } catch (Exception ex) { return(false); } }
public bool Insert(string userName, string password) { try { if (userName != String.Empty && password != String.Empty) { DLL.User employee = new DLL.User(); return(employee.Insert(userName, password)); } else { return(false); } } catch (Exception ex) { return(false); } }
public IHttpActionResult UserRegistration(UserModel user) { var masssage = string.Empty; if (ModelState.IsValid) { var userExist = db.Users.Where(t => t.UserId.ToLower() == user.UserId.ToLower()).FirstOrDefault(); if (userExist != null) { masssage = "USER_EXIST"; return(Json(masssage)); } User objUser = new DLL.User(); objUser.UserId = user.UserId; objUser.Password = user.Password; objUser.Email = user.Email; objUser.FullName = user.FullName; db.Users.Add(objUser); db.SaveChanges(); masssage = "SUCCESS"; } return(Json(masssage)); }