protected void btnChangePwd_Click(object sender, EventArgs e) { try { string strQuerystring = clsLoginHandler.Decryptdata((Convert.ToString(Request.QueryString["dataobj"]))); clsLoginView objDeserialize = new JavaScriptSerializer().Deserialize <clsLoginView>(strQuerystring); clsLogin objData = new clsLogin(); objData.UniqueCode = objDeserialize.UniqueCode; objData.UserID = objDeserialize.UserID; objData.EmailID = objDeserialize.EmailID; objData.Password = Encryption.EncryptDecrypt.Encrypt(txtNewPwd.Text.Trim(), true); clsLoginHandler.UpdateUniqueID("ResetPassword", objData); lblError.Text = "Your password has been updated successfully."; txtNewPwd.Text = string.Empty; txtConfirmPwd.Text = string.Empty; StringBuilder strBody = new StringBuilder(); strBody.Append("<HTML><BODY>" + "<font family=Times New Roman;>Hello!</br></br>"); strBody.Append("Your password to access http://uno.cms.co.in/uno has been successfully changed. Please keep it in a secure place."); strBody.Append("</br></br>"); strBody.Append("If you have not changed your password lately, then someone must have done it on your behalf. "); strBody.Append("</br></br>"); strBody.Append("Regards,</br>" + Application["ClientName"].ToString() + "</font>"); strBody.Append("</BODY></HTML>"); strBody.Append("</br></br>"); Mail.SendMail("*****@*****.**", objData.EmailID, "", "ResetPassword", strBody.ToString()); } catch (Exception ex) { lblError.Text = "Error Occured : " + ex.Message.ToString(); } }
protected void cstvOldPassword_ServerValidate(object source, ServerValidateEventArgs args) { try { lblError.Visible = false; lblError.Text = ""; if (Session["uid"].ToString() == null) { Response.Redirect("Login.aspx", true); return; } clsLogin objLogin = clsLoginHandler.GetLoginDetails("GetLogin", Session["uid"].ToString()); if (txtOldPass.Text == Encryption.EncryptDecrypt.Decrypt(objLogin.Password, true)) { args.IsValid = true; } else { args.IsValid = false; } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }
private void btnLogin_Click(object sender, EventArgs e) { if (IsValidated()) { try { clsLogin user = new clsLogin(); user.UserName = txtName.Text; user.Password = txtPassword.Text; clsDBLogin dbLogin = new clsDBLogin(); dbLogin.CheckUser(user); if (dbLogin.Count > 0) { this.Hide(); frmMenu ss = new frmMenu(); ss.Show(); } else { MessageBox.Show("User Name or Password is incorrect. Please try again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtName.Clear(); txtPassword.Clear(); txtName.Focus(); } } catch (ApplicationException ex) { MessageBox.Show("Error:" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
//MySqlConnection con = new MySqlConnection("server=191.234.183.224; Uid=root; Password=bitnami; Database=iejesusnazareno; Port=3306"); public String ConsultarUsuario(clsLogin log) { con.Open(); MySqlCommand cmd; MySqlDataReader consulta; String resultado = null; try { cmd = new MySqlCommand("consultausuario", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("nomusu", log.Usuario); cmd.Parameters.AddWithValue("claveusu", log.Clave); consulta = cmd.ExecuteReader(); while (consulta.Read()) { resultado = consulta.GetString(0); } con.Close(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } return(resultado); }
public DataSet SavePassword(clsLogin objLogin) { dataAccess = new DataAccess(); Object[] parameters = new Object[] { objLogin.UserLoginId, objLogin.Password }; return(dataAccess.LoadDataSet(parameters, "P_SaveNewPassword", "SaveNewPassword")); }
private void button1_Click(object sender, EventArgs e) { Login log = new Login(); log.Usuario = txtUser.Text; log.Password = txtPass.Text; clsLogin clsl = new clsLogin(); int variabledeevaluacion = clsl.acceso(log); if (variabledeevaluacion == 1) { MessageBox.Show("WELCOM"); FormMenu frm = new FormMenu(); //para mostrar el usuario en una etiqueta frm.usuarioEstado = txtUser.Text; frm.Show(); this.Hide(); } else { MessageBox.Show("FALSE"); } }
private void button1_Click(object sender, EventArgs e) { Login log = new Login(); log.Usuario = txtUser.Text; log.Password = txtPassword.Text; clsLogin clsL = new clsLogin(); int variabledeevaluacion = clsL.accceso(log); if (variabledeevaluacion == 1) { MessageBox.Show("welcome"); frmMenu frm = new frmMenu(); frm.usuarioEstado = txtUser.Text; frm.Show(); this.Hide(); } else { MessageBox.Show("false"); } }
private void btnAdd_Click(object sender, EventArgs e) { if (IsValidated()) { try { clsLogin user = new clsLogin(); user.UserName = txtUser.Text; user.Password = txtPassword.Text; clsDBLogin dbLogin = new clsDBLogin(); int Useradded = 0; Useradded = dbLogin.AddUser(user); if (Useradded > 0) { lblMessage.Text = "User has been added."; txtUser.Clear(); txtPassword.Clear(); txtUser.Focus(); } else { lblMessage.Text = "Error. Please try again."; txtUser.Clear(); txtPassword.Clear(); txtUser.Focus(); } } catch (ApplicationException ex) { MessageBox.Show("Error:" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public DataSet IsEmployeeIDValid(clsLogin objLogin) { SqlParameter[] objParam = new SqlParameter[2]; objParam[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); objParam[0].Value = objLogin.EmployeeID; objParam[1] = new SqlParameter("@Password", SqlDbType.VarChar, 15); objParam[1].Value = objLogin.Password; DataSet dsEmployeeExists = new DataSet(); try { dsEmployeeExists = SqlHelper.ExecuteDataset(sqlConn, CommandType.StoredProcedure, "sp_IsEmployeeIDValid", objParam); return(dsEmployeeExists); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLLogin.cs", "IsEmployeeIDValid", ex.StackTrace); throw new V2Exceptions(); } }
public int isEmployeeSuperAdmin(clsLogin objLogin) { int recordcount; SqlParameter[] objParam = new SqlParameter[1]; objParam[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); objParam[0].Value = objLogin.EmployeeID; try { recordcount = Convert.ToInt32(SqlHelper.ExecuteScalar(sqlConn, CommandType.StoredProcedure, "IsEmployeeSuperAdmin", objParam)); return(recordcount); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLLogin.cs", "isEmployeeSuperAdmin", ex.StackTrace); throw new V2Exceptions(); } }
public static string login(string user, string pass) { string message = ""; try { DataTable dt = new clsLogin().login(user, pass).Tables[0]; if (dt.Columns.Count > 1) { string eid = dt.Rows[0][1].ToString(); message = dt.Rows[0][0].ToString(); if (eid != "0") { System.Web.HttpContext.Current.Session["user"] = user; System.Web.HttpContext.Current.Session["eid"] = eid; } } else { message = dt.Rows[0][0].ToString(); } } catch (Exception ex) { Custom.generatelog(null, null, "Login", ex.Message + ex.StackTrace); message = ex.Message + "|2"; } return(message); }
public void UserNameMaxPlusOne() { clsLogin lg = new clsLogin(); Boolean OK = false; string Name = "coo0lcarwasblack"; OK = lg.isUserValid(Name); Assert.IsFalse(OK); }
public Int32 AddUser(clsLogin user) { //add the parameters db.AddParameter("@UserName", user.UserName); db.AddParameter("@Password", user.Password); //execute the stored procedure return(db.Execute("sproc_tblUsers_Insert")); }
public void UserNameMinPlusOne() { clsLogin lg = new clsLogin(); Boolean OK = false; string Name = "bb"; OK = lg.isUserValid(Name); Assert.IsTrue(OK); }
public DataSet GetUserCompanyTeam(clsLogin objLogin, int intTeamId) { dataAccess = new DataAccess(); Object[] parametes = new Object[2] { objLogin.UserLoginId, intTeamId }; return(dataAccess.LoadDataSet(parametes, "P_GetUserCompaniesTeam", "UserCompanies")); }
public DataSet UpdateLoginDetails(clsLogin objLogin, string strLock) { dataAccess = new DataAccess(); Object[] parametes = new Object[4] { objLogin.UserName, strLock, objLogin.IPAddress, objLogin.UserSessionId }; return(dataAccess.LoadDataSet(parametes, "P_UpdateLoginDetails", "UpdateLogindetails")); }
public DataSet GetUserCompany(clsLogin objLogin) { dataAccess = new DataAccess(); Object[] parametes = new Object[1] { objLogin.UserLoginId }; return(dataAccess.LoadDataSet(parametes, "P_GetUserCompanies", "UserCompanies")); }
public DataSet GetOldPassword(clsLogin objLogin) { dataAccess = new DataAccess(); Object[] parametes = new Object[1] { objLogin.UserLoginId }; return(dataAccess.LoadDataSet(parametes, "P_GetOldPassword", "OldPassword")); }
public DataSet UpdateLogOut(clsLogin objLogin) { dataAccess = new DataAccess(); Object[] parametes = new Object[2] { objLogin.UserLoginId, objLogin.UserSessionId }; return(dataAccess.LoadDataSet(parametes, "P_UserLogout", "UserLogout")); }
public DataSet ValidateUser(clsLogin objLogin) { dataAccess = new DataAccess(); Object[] parametes = new Object[2] { objLogin.UserName, objLogin.Password }; return(dataAccess.LoadDataSet(parametes, "P_GetUser", "UserInfo")); }
public void UserNameMaxBoundary() { clsLogin lg = new clsLogin(); Boolean OK = false; string Name = "coolcarwasblack"; OK = lg.isUserValid(Name); Assert.IsTrue(OK); }
public U8LoginInfor(object u8login) { if (u8login != null) { _U8Login = u8login; _U8LoginClass = (clsLogin)u8login; Setting(); } }
private clsLogin GetLoginDetails() { clsLogin lg = new clsLogin(); clsDBLogin dbLogin = new clsDBLogin(); return(lg); }
public usp_UserDetailsGet_Result CheckLoginStatus(clsLogin logindetails) { // string username = "******"; string pwd = "123456"; //List<usp_UserDetailsGet_Result> UserDetails = playschool.usp_UserDetailsGet(username, pwd).ToList(); //List<usp_UserDetailsGet_Result> UserDetails = playschool.usp_UserDetailsGet(logindetails.username, logindetails.pssword).FirstOrDefault(); usp_UserDetailsGet_Result UserDetails = playschool.usp_UserDetailsGet(logindetails.username, logindetails.pssword).FirstOrDefault(); return(UserDetails); }
public clsMessage ChangePassword(string Uname, string OldPassword, string NewPassword) { clsMessage rm = new clsMessage(); clsLogin Login = new clsLogin(); rm = Login.changePassword(Uname, OldPassword, NewPassword); return(rm); }
public clsMessage CheckLogin(string UserName, string Password) { clsMessage status = new clsMessage(); clsLogin Login = new clsLogin(); status = Login.checkLogin(UserName, Password); return(status); }
public int CheckUseLoginDetails(string UserName, string Password) { clsLogin objLogin = new clsLogin(); objLogin.UserName = UserName; objLogin.Password = Password; int MemberId = objLogin.ChekUserLogin(); return(MemberId); }
/// <summary> /// 通过移动端传递过来的token解析本地登录对象 /// </summary> /// <param name="token"></param> /// <returns></returns> public static U8LoginInfor GetLoginInfo(string token) { string userToken = ContextManager.SingletonInstance.GetCurrentUserToken(token); var vblogin = new clsLogin(); vblogin.ConstructLogin(userToken); string taksId = token; vblogin.set_TaskId(ref taksId); return(new U8LoginInfor(vblogin)); }
public void TestProperties() { clsLogin cl = new clsLogin(); string user = "******"; cl.UserName = user; Assert.AreEqual(cl.UserName, user); string password = "******"; cl.Password = password; Assert.AreEqual(cl.Password, password); }
public System.Windows.Forms.Control CreateControl(clsLogin login, string MenuID, string Paramters) { Pubvar.ConnString = login.GetLoginInfo().ConnString.ToString(); Pubvar.UserId = login.GetLoginInfo().UserName.ToString(); Pubvar.userToken = login.userToken.ToString(); Pubvar.accid = login.GetLoginInfo().AccID.ToString(); //初始化自定义用户控件对象 bestglimportusercontrol = new ImportGLVoucher(); return(bestglimportusercontrol); }