protected void Page_Load(object sender, EventArgs e) { Session["ActiveLeftNav"] = "Security"; string uName = ""; int uID = 0; if (Session["Username"] != null) { uName = Session["Username"].ToString(); } if (Session["UserID"] != null) { uID = (Session["UserID"].ToString().ToInt32()); } Classes.cUser Demography = new Classes.cUser(uName, "Password"); Classes.cPlayer PLDemography = new Classes.cPlayer(uID, uName); lblUsername.Text = uName; lblFirstName.Text = Demography.FirstName; if (Demography.MiddleName.Length > 0) { lblMI.Text = Demography.MiddleName.Substring(0, 1); } lblLastName.Text = Demography.LastName; lblNickName.Text = Demography.NickName; }
protected void Page_Load(object sender, EventArgs e) { lblError.Text = string.Empty; lblErrorQuestions.Text = string.Empty; lblErrorQuestion2.Text = string.Empty; lblErrorQuestion3.Text = string.Empty; lblPasswordReqs.Text = "<span class=" + "\"" + "glyphicon glyphicon-question-sign" + "\"" + "></span>"; lblPasswordReqs.ToolTip = "LARP Portal login passwords must be at least 7 characters long and contain at least " + "1 uppercase letter, 1 lowercse letter, 1 number and 1 special character"; if (Session["Username"] == null) { btnSave.Visible = false; return; } Session["ActiveLeftNav"] = "Security"; uName = ""; uID = 0; if (Session["Username"] != null) { uName = Session["Username"].ToString(); } if (Session["UserID"] != null) { uID = (Session["UserID"].ToString().ToInt32()); } //This method is not loading my email so nothing works Demography = new Classes.cUser(uName, "Password"); PLDemography = new Classes.cPlayer(uID, uName); UserLoggedIn = new Classes.cLogin(); //this needs to be done in order to show security questions as per ForgotPassword existing logic UserLoggedIn.ValidateUserForPasswordReset(uName, Demography.PrimaryEmailAddress.EmailAddress, Demography.LastName); if (IsPostBack == false) { txtUsername.Text = uName; txtFirstName.Text = Demography.FirstName; if (Demography.MiddleName.Length > 0) { txtMI.Text = Demography.MiddleName.Substring(0, 1); } txtLastName.Text = Demography.LastName; txtNickName.Text = Demography.NickName; if (string.IsNullOrWhiteSpace(Demography.PrimaryEmailAddress.EmailAddress)) { lblError.Text = "Primary email must be setup first"; return; } txtSecurityAnswer1.Text = UserLoggedIn.SecurityAnswer1; txtSecurityAnswer2.Text = UserLoggedIn.SecurityAnswer2; txtSecurityAnswer3.Text = UserLoggedIn.SecurityAnswer3; txtSecurityQuestion1.Text = UserLoggedIn.SecurityQuestion1; txtSecurityQuestion2.Text = UserLoggedIn.SecurityQuestion2; txtSecurityQuestion3.Text = UserLoggedIn.SecurityQuestion3; } }
protected void Page_Load(object sender, EventArgs e) { lblMessage.Text = string.Empty; Session["DefaultPlayerProfilePath"] = "img/player/"; Session["ActiveLeftNav"] = "Demographics"; string uName = ""; int uID = 0; if (Session["Username"] != null) { uName = Session["Username"].ToString(); } if (Session["UserID"] != null) { uID = (Session["UserID"].ToString().ToInt32()); } Demography = new Classes.cUser(uName, "Password"); PLDemography = new Classes.cPlayer(uID, uName); string fn = Demography.FirstName; string mi = ""; if (Demography.MiddleName.Length > 0) { mi = Demography.MiddleName.Substring(0, 1); } string ln = Demography.LastName; string gen = PLDemography.GenderStandared.ToUpper(); string othergen = PLDemography.GenderOther; DateTime dob = PLDemography.DateOfBirth; string strdob = dob.ToString("MM/dd/yyyy"); string nick = Demography.NickName; string pen = PLDemography.AuthorName; string forum = Demography.ForumUserName; string pict = PLDemography.UserPhoto; if (pict == "") { imgPlayerImage.ImageUrl = "http://placehold.it/150x150"; } else { if (string.IsNullOrWhiteSpace(Path.GetDirectoryName(pict))) { imgPlayerImage.ImageUrl = "img/player/" + pict; } else { imgPlayerImage.ImageUrl = pict; } } string emergencynm = PLDemography.EmergencyContactName; string emergencyContactPhone = string.Empty; if (PLDemography.EmergencyContactPhone != null) { emergencyContactPhone = PLDemography.EmergencyContactPhone; Int32 iPhone; if (Int32.TryParse(emergencyContactPhone.Replace("(", "").Replace(")", "").Replace("-", ""), out iPhone)) { emergencyContactPhone = iPhone.ToString("(###)###-####"); } } //Classes.cPhone EmergencyPhone = new Classes.cPhone(); //string emergencyph = EmergencyPhone.PhoneNumber; // = PLDemography.EmergencyContactPhone; // Need to define the list for Addresses // Need to define the list for Phone Numbers // Need to define the list for Email Addresses txtGenderOther.Visible = false; if (!IsPostBack) { txtFirstName.Text = fn; txtMI.Text = mi; txtLastName.Text = ln; if (gen.Length > 0 && "MFO".Contains(gen)) { ddlGender.SelectedValue = gen; } txtGenderOther.Text = othergen; txtDOB.Text = strdob; txtEmergencyName.Text = emergencynm; txtEmergencyPhone.Text = emergencyContactPhone; txtUsername.Text = uName; txtNickname.Text = nick; txtPenname.Text = pen; txtForumname.Text = forum; if (Session["dem_Img_Url"] != null && !string.IsNullOrWhiteSpace(Session["dem_Img_Url"].ToString())) { imgPlayerImage.ImageUrl = Session["dem_Img_Url"].ToString(); } List <cAddress> _addresses = new List <cAddress>(); if (Demography.UserAddresses != null) { _addresses = Demography.UserAddresses.ToList(); } _addresses.Add(new cAddress()); //always add an empty one in case they need to insert a new one Session["dem_Addresses"] = _addresses; List <cPhone> _phones = new List <cPhone>(); if (Demography.UserPhones != null) { _phones = Demography.UserPhones.ToList(); } _phones.Add(new cPhone()); Session["dem_Phones"] = _phones; List <cEMail> _emails = new List <cEMail>(); if (Demography.UserEmails != null) { _emails = Demography.UserEmails.ToList(); } _emails.Add(new cEMail()); Session["dem_Emails"] = _emails; BindAllGrids(); } }