public bool VerifyLogin(ref clsSignin objSignIn) { if ((new AccountDAL()).VerifyLoginDal(ref objSignIn)) { return(true); } return(false); }
public ActionResult SignUp(clsSignin objSignin) { try { //if ((new AccountBLL()).VerifyLogin(ref objSignin)) //{ // FormsAuthentication.SetAuthCookie(objSignin.Username, false); // Response.Cookies[objSignin.Username].Expires = DateTime.Now.AddSeconds(10); // Session["UserInfo"] = objSignin; // return Json(new { Status = "Success" }); //} return(Json(new { Status = "Failure", Message = "Username/Password does not match" })); } catch (Exception ex) { return(Json(new { Status = "Failure", Message = "A network related issue occered. Please try again to login" })); } }
public bool VerifyLoginDal(ref clsSignin objSignIn) { using (var maincontext = new Entity.LostAndFindEntities()) { try { string emailId = objSignIn.Username; string password = objSignIn.password; var objUsers = maincontext.VerifyLogin(objSignIn.Username, objSignIn.password).FirstOrDefault(); if (objUsers != null) { objSignIn.Email = objUsers.EmailId; objSignIn.FirstName = objUsers.FirstName; objSignIn.LastName = objUsers.LastName; objSignIn.Role = objUsers.Role; objSignIn.Username = objUsers.Username; objSignIn.Phone = objUsers.Phone; objSignIn.UserId = objUsers.id; return(true); } else { return(false); } } catch (Exception ex) { var text = ex.Message; } objSignIn = null; return(false); } }