private void GetUser() { Security.ClsUsers oUser = new Security.ClsUsers(); try { oUser.GetUser(txtUser.Text, txtPwd.Text); //I NEED TO EVALUATE FOR NOTHING COMING BACK Session.Add("USERCODE", oUser.UserID); Session.Add("USERNAME", oUser.UserName); Session.Add("HouseID", oUser.HouseID); } catch (Exception ex) { lblError.Text = "GetUser:"******"USERCODE"] > 0) { ValidateAccess(); //Call CheckForStats() } else { lblError.Text = "Invalid Username/Password"; } }
private string AccessType(long Usercode, string sScreen) { string functionReturnValue = null; Security.ClsUsers oUser = new Security.ClsUsers(); try { oUser.GetAccess(Usercode, sScreen, Session["CompanyID"]); functionReturnValue = oUser.AccessType; } catch (Exception ex) { lblError.Text = "AccessType:" + ex.Message; functionReturnValue = 0; return functionReturnValue; } finally { oUser = null; } return functionReturnValue; }
private void CheckUser() { Security.ClsUsers oSecurity = new Security.ClsUsers(); try { var _with5 = oSecurity; _with5.GetUser(txtUser.Text, txtPwd.Text); //Session["UserName"] = .UserName //Session["SeasonDesc"] = .SeasonDesc Session["Usertype"] = _with5.Usertype; Session["UserID"] = _with5.UserID; Session["HouseID"] = _with5.HouseID; Session["CompanyID"] = _with5.CompanyID; //Session["CompanyName"] = .CompanyName //Session["ImageName"] = .ImageName //Session["TimeZone"] = .TimeZone Session["SeasoniD"] = _with5.SeasonID; } catch (Exception ex) { lblError.Text = "Invalid Username/Password"; } finally { oSecurity = null; } }
protected void lnkForgot_Click(object sender, System.EventArgs e) { string Email = null; string pwd = null; Security.ClsUsers oUser = new Security.ClsUsers(); try { if (string.IsNullOrEmpty(txtUser.Text)) { lblError.Text = "ERROR - Missing User"; return; } oUser.GetEmail(Session["CompanyID"], txtUser.Text); Email = oUser.Email; if (!IsEmail(Email)) { lblError.Text = "Invalid/missing Email"; return; } pwd = oUser.PWord; if (Email > "" & pwd > "") { EmailReset(Email, pwd); } else { lblError.Text = "Invalid/missing Username"; } } catch (Exception ex) { lblError.Text = "lnkForgot:" + ex.Message; } finally { oUser = null; } }