public int InsertLog(LoginSchema objLoginSchema) { login_conn = new SqlConnection(); login_conn = SQLHelper.OpenConnection(); SqlParameter[] _param = new SqlParameter[3]; try { _param[0] = new SqlParameter("@UserSessionID", SqlDbType.UniqueIdentifier); _param[0].Value = (objLoginSchema.Usersessionid); _param[1] = new SqlParameter("@UserID", SqlDbType.UniqueIdentifier); _param[1].Value = objLoginSchema.User_id; _param[2] = new SqlParameter("@IPSecurities", SqlDbType.VarChar); _param[2].Value = Convert.ToString(objLoginSchema.IPAddress); SqlCommand command = new SqlCommand(); command.CommandText = "uspInsertUserLog"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; int result = HelperCls.ExecuteNonQuery(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); return(result); } catch (Exception Ex) { throw Ex; } finally { login_conn.Close(); login_conn.Dispose(); } }
//added Mahesh Patel on 27-12-2018 public int GetUserPasswordLDM(LoginSchema objLoginSchema) { try { ds = new DataSet(); int password; login_conn = new SqlConnection(); login_conn = SQLHelper.OpenConnection(); SqlParameter[] _param = new SqlParameter[1]; _param[0] = new SqlParameter("@UserName", SqlDbType.VarChar); _param[0].Value = objLoginSchema.UserName; _param[0].Size = 50; SqlCommand command = new SqlCommand(); command.CommandText = "[uspGetUserLDMPassword]"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; password = Convert.ToInt32(HelperCls.ExecuteScalar(login_conn, null, command.CommandType, command.CommandText, _param)); return(password); } catch (Exception ex) { throw ex; } finally { SQLHelper.CloseConnection(login_conn); login_conn.Dispose(); } }
public int UpdateUserPassword(LoginSchema objLoginSchema) { login_conn = new SqlConnection(); login_conn = SQLHelper.OpenConnection(); SqlParameter[] _param = new SqlParameter[2]; try { _param[0] = new SqlParameter("@UserName", SqlDbType.VarChar); _param[0].Value = (objLoginSchema.UserName); _param[1] = new SqlParameter("@Password", SqlDbType.VarChar); _param[1].Value = Convert.ToString(objLoginSchema.Password); SqlCommand command = new SqlCommand(); command.CommandText = "uspUpdateUserPassword"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; int result = HelperCls.ExecuteNonQuery(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); return(result); } catch (Exception Ex) { throw Ex; } finally { login_conn.Close(); login_conn.Dispose(); } }
public DataSet GetEmailIDbyUserID(LoginSchema objLoginSchmema) { try { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); objTran = login_conn.BeginTransaction(); string user_names = " Select UM.EmailId as EmailId,UM.MobileNo as MobileNo,UM.UserID as UserID,UM.UsertypeID as UsertypeID, " + " UM.Username as UserName,UM.Password as UPassword,PasswordChanged,IsActive,IsLoggedin from UserMaster UM inner join EmployeeMaster EM on UM.UserID=EM.UserID " + " where UM.EmailId='" + objLoginSchmema.EmailId1 + "' "; ds = HelperCls.ExecuteDataset(login_conn, objTran, CommandType.Text, user_names); return(ds); } catch (Exception ex) { throw ex; } finally { objTran.Commit(); HelperCls.CloseConnection(login_conn); ds = null; } }
public string SetForgotPassword(LoginSchema objLoginSchema) { string result; try { objLoginDAL = new LoginDAL(); result = objLoginDAL.SetForgotPassword(objLoginSchema); return(result); } catch (Exception ex) { throw ex; } }
public int UpdateUserPassword(LoginSchema objLoginSchema) { int result; try { objLoginDAL = new LoginDAL(); result = objLoginDAL.ChangeResetPasswordSVT(objLoginSchema); return(result); } catch (Exception ex) { throw ex; } }
public int InsertLog(LoginSchema objLoginSchema) { int result; try { objLoginDAL = new LoginDAL(); result = objLoginDAL.InsertLog(objLoginSchema); return(result); } catch (Exception ex) { throw ex; } }
public int LoginUser_ForgotPassword(LoginSchema objLoginSchema) { int result; try { objLoginDAL = new LoginDAL(); result = objLoginDAL.UpdateUserPassword(objLoginSchema); return(result); } catch (Exception ex) { throw ex; } }
// Added by Anand Dated on 07-08-2018 public int ChangePwd(LoginSchema objLoginSchema) { int result; try { objLoginDAL = new LoginDAL(); result = objLoginDAL.ChangePwd(objLoginSchema); return(result); } catch (Exception ex) { throw ex; } }
public int ForceChangePasswordBL(LoginSchema r_objLoginSchema) { try { objLoginDAL = new LoginDAL(); returnval = objLoginDAL.ForceChangePasswordDAL(r_objLoginSchema); return(returnval); } catch (Exception e) { return(0); } finally { objLoginDAL = null; returnval = 0; } }
public int insertAttemptBAL(LoginSchema r_objLoginSchema) { try { objLoginDAL = new LoginDAL(); returnval = objLoginDAL.IncreaseAttemptCount(r_objLoginSchema); return(returnval); } catch (Exception e) { return(0); } finally { objLoginDAL = null; r_objLoginSchema = null; returnval = 0; } }
public int insertSession(LoginSchema r_objLoginSchema) { try { objLoginDAL = new LoginDAL(); returnval = objLoginDAL.insertSession(r_objLoginSchema); return(returnval); } catch (Exception e) { return(0); } finally { objLoginDAL = null; r_objLoginSchema = null; returnval = 0; } }
public DataSet GetEmailIDbyUserID(LoginSchema objLoginSchmema) { try { objLoginDAL = new LoginDAL(); ds = objLoginDAL.GetEmailIDbyUserID(objLoginSchmema); return(ds); } catch (Exception e) { return(null); } finally { objLoginDAL = null; ds = null; } }
public DataSet GetUsernameforchangepassword(LoginSchema r_objLoginSchema) { try { objLoginDAL = new LoginDAL(); res_user = objLoginDAL.CheckUsernameforchangepassword(r_objLoginSchema); return(res_user); } catch (Exception e) { return(null); } finally { objLoginDAL = null; r_objLoginSchema = null; ds = null; res_user = null; } }
public DataSet CheckForgotPwdToken(LoginSchema objLoginSchema) { try { objLoginDAL = new LoginDAL(); ds = objLoginDAL.CheckForgotPwdToken(objLoginSchema); return(ds); } catch (Exception ex) { throw ex; } finally { objLoginDAL = null; ds = null; } }
public string GetUrl(LoginSchema r_objLoginSchema) { try { objLoginDAL = new LoginDAL(); ds = objLoginDAL.GetUrl(r_objLoginSchema); res_user1 = ds.Tables[0].Rows[0][0].ToString(); return(res_user1); } catch (Exception e) { return(null); } finally { objLoginDAL = null; r_objLoginSchema = null; ds = null; res_user1 = null; } }
public DataSet CheckUsernameforchangepassword(LoginSchema objLoginSchema) { try { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); string user_names = "select UserID,PasswordChanged,Password,Attempt from UserMaster where userId='" + objLoginSchema.UserID.ToString() + "' and IsActive='1'"; ds = HelperCls.ExecuteDataset(login_conn, null, CommandType.Text, user_names); return(ds); } catch (Exception e) { return(null); } finally { HelperCls.CloseConnection(login_conn); ds = null; } }
public DataSet GetUrl(LoginSchema objLoginSchema) { try { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); string user_names = "select UserTypeUrl from UserType,UserMaster where UserType.UsertypeID=UserMaster.UserTypeID and UserMaster.UserID='" + objLoginSchema.UserID + "'"; ds = HelperCls.ExecuteDataset(login_conn, null, CommandType.Text, user_names); return(ds); } catch (Exception e) { return(null); } finally { HelperCls.CloseConnection(login_conn); ds = null; } }
public string SetForgotPassword(LoginSchema objLoginSchema) { try { ds = new DataSet(); login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); StringBuilder var1 = new StringBuilder(); SqlParameter[] _param = new SqlParameter[4]; _param[0] = new SqlParameter("@EmailID", SqlDbType.VarChar); _param[0].Value = objLoginSchema.EmailId1; _param[1] = new SqlParameter("@UserID", SqlDbType.UniqueIdentifier); _param[1].Value = new Guid(objLoginSchema.UserID); _param[2] = new SqlParameter("@QueryNo", SqlDbType.Int); _param[2].Value = 2; _param[3] = new SqlParameter("@ForgetPasswordToken", SqlDbType.VarChar); _param[3].Value = "ForgetPAsswordToken"; SqlCommand command = new SqlCommand(); command.CommandText = "sp_GetUserDetailsForForgotPassword"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; ds = HelperCls.ExecuteDataset(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); string result = ds.Tables[0].Rows[0][0].ToString(); return(result); } catch (Exception ex) { throw ex; } finally { HelperCls.CloseConnection(login_conn); // login_conn.Dispose(); } }
public DataSet CheckForgotPwdToken(LoginSchema objLoginSchmema) { try { ds = new DataSet(); login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); StringBuilder var1 = new StringBuilder(); SqlParameter[] _param = new SqlParameter[4]; _param[0] = new SqlParameter("@EmailID", SqlDbType.VarChar); _param[0].Value = objLoginSchmema.EmailId1; _param[1] = new SqlParameter("@UserID", SqlDbType.VarChar); _param[1].Value = objLoginSchmema.UserID; _param[2] = new SqlParameter("@QueryNo", SqlDbType.Int); _param[2].Value = 3; _param[3] = new SqlParameter("@ForgetPasswordToken", SqlDbType.VarChar); _param[3].Value = "ForgetPAsswordToken"; SqlCommand command = new SqlCommand(); command.CommandText = "sp_GetUserDetailsForForgotPassword"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; ds = HelperCls.ExecuteDataset(login_conn, null, command.CommandType, command.CommandText, _param); return(ds); } catch (Exception ex) { throw ex; } finally { HelperCls.CloseConnection(login_conn); ds = null; } }
// Added Mahesh Patel on 18-05-2018// public int GetUserPasswordLDM(LoginSchema r_objLoginSchema) { try { int password; objLoginDAL = new LoginDAL(); password = objLoginDAL.GetUserPasswordLDM(r_objLoginSchema); return(password); } catch (Exception e) { return(0); } finally { objLoginDAL = null; r_objLoginSchema = null; ds = null; res_user1 = null; } }
// Added By KP on 18-05-2018// public string GetUserPassword(LoginSchema r_objLoginSchema) { try { string password; objLoginDAL = new LoginDAL(); password = objLoginDAL.GetUserPassword(r_objLoginSchema); return(password); } catch (Exception e) { return(null); } finally { objLoginDAL = null; r_objLoginSchema = null; ds = null; res_user1 = null; } }
protected void LinkButton1_Click(object sender, EventArgs e) { LoginBL objLoginBL = new LoginBL(); LoginSchema objLoginSchema = new LoginSchema(); objLoginSchema.UserID = Session["userid"].ToString(); System.Web.Security.FormsAuthentication.SignOut(); for (int i = 0; i < Request.Cookies.Count; i++) { if (Request.Cookies[i].Name != ".ASPXANONYMOUS" || Request.Cookies[i].Name != "CaptchaImageText") { HttpCookie myCookie = default(HttpCookie); myCookie = Request.Cookies[i]; myCookie.Value = string.Empty; myCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Set(myCookie); } } HttpContext.Current.Profile.SetPropertyValue("RandomToken", string.Empty); HttpContext.Current.Profile.SetPropertyValue("AuthToken", string.Empty); for (int i = 0; i < Session.Count - 1; i++) { if (!(Session.Keys[i] == "CaptchaImageText")) { Session[Session.Keys[i]] = null; } } for (int i = 0; i < Request.Cookies.Count; i++) { HttpCookie myCookie = default(HttpCookie); myCookie = Request.Cookies[i]; myCookie.Value = string.Empty; myCookie.Expires = DateTime.Now.AddDays(-1); Response.Cookies.Set(myCookie); } }
// Added by Anand Dated on 07-08-2018 public int ChangePwd(LoginSchema objLoginSchema) { login_conn = new SqlConnection(); login_conn = SQLHelper.OpenConnection(); SqlParameter[] _param = new SqlParameter[4]; try { _param[0] = new SqlParameter("@UserID", SqlDbType.VarChar); _param[0].Value = (objLoginSchema.UserID); _param[1] = new SqlParameter("@CurrentPassword", SqlDbType.VarChar); _param[1].Value = objLoginSchema.ChangedPassword; _param[2] = new SqlParameter("@Newpassword", SqlDbType.VarChar); _param[2].Value = objLoginSchema.ConfirmPassword; _param[3] = new SqlParameter("@Seed", SqlDbType.VarChar); _param[3].Value = objLoginSchema.SessionID; SqlCommand command = new SqlCommand(); command.CommandText = "uspChangePassword"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; int result = HelperCls.ExecuteNonQuery(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); return(result); } catch (Exception Ex) { throw Ex; } finally { login_conn.Close(); login_conn.Dispose(); } }
public int ForceChangePasswordDAL(LoginSchema objLoginSchmema) { try { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); objTran = login_conn.BeginTransaction(); string user_names = "update UserMaster set Password='******',PasswordChanged='1' where UserID='" + objLoginSchmema.UserID + "' COLLATE SQL_Latin1_General_CP1_CS_AS"; returnval = HelperCls.ExecuteNonQuery(login_conn, objTran, CommandType.Text, user_names); return(returnval); } catch (Exception e) { return(0); } finally { objTran.Commit(); HelperCls.CloseConnection(login_conn); returnval = 0; } }
public int insertSession(LoginSchema objLoginSchema) { try { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); objTran = login_conn.BeginTransaction(); string user_names = "insert into UserSession ([UserID],[SessionID],[LoggedInAt],[LoggedFrom]) values(CAST('" + objLoginSchema.UserID + "'as uniqueidentifier),'" + objLoginSchema.SessionID + "',GetDate(),'" + objLoginSchema.IPAddress + "')"; returnval = HelperCls.ExecuteNonQuery(login_conn, objTran, CommandType.Text, user_names); return(returnval); } catch (Exception e) { return(0); } finally { objTran.Commit(); HelperCls.CloseConnection(login_conn); returnval = 0; } }
public int ChangeResetPasswordSVT(LoginSchema objLoginSchema) { try { ds = new DataSet(); login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); StringBuilder var1 = new StringBuilder(); SqlParameter[] _param = new SqlParameter[3]; _param[0] = new SqlParameter("@EmailID", SqlDbType.VarChar); _param[0].Value = objLoginSchema.EmailId1; _param[1] = new SqlParameter("@Password", SqlDbType.VarChar); _param[1].Value = objLoginSchema.Password; _param[2] = new SqlParameter("@ForgetPasswordToken", SqlDbType.VarChar); _param[2].Value = objLoginSchema.ForgotPasswordToken; SqlCommand command = new SqlCommand(); command.CommandText = "Proc_AdminUserRegistration"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; int result = HelperCls.ExecuteNonQuery(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); return(result); } catch (Exception ex) { throw ex; } finally { login_conn.Close(); login_conn.Dispose(); } }
public int IncreaseAttemptCount(LoginSchema objLoginSchema) { login_conn = new SqlConnection(); login_conn = HelperCls.OpenConnection(); SqlParameter[] _param = new SqlParameter[2]; try { //_param[0] = new SqlParameter("@UserID", SqlDbType.VarChar); //_param[0].Value = Convert.ToString(objLoginSchema.UserID); _param[0] = new SqlParameter("@QueryNo", SqlDbType.Int); _param[0].Value = (objLoginSchema.QueryNo); _param[1] = new SqlParameter("@UserName", SqlDbType.VarChar); _param[1].Value = Convert.ToString(objLoginSchema.UserName); _param[1].Size = 50; SqlCommand command = new SqlCommand(); command.CommandText = "SP_GetLogin"; command.CommandTimeout = 5000; command.CommandType = CommandType.StoredProcedure; int result = HelperCls.ExecuteNonQuery(login_conn, null, CommandType.StoredProcedure, command.CommandText, _param); return(result); } catch (Exception Ex) { throw Ex; } finally { login_conn.Close(); login_conn.Dispose(); } }