示例#1
0
        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;
        }
示例#2
0
        protected void SignUpForSelectedRole(int RoleToSignUp, int UserID, int CampaignID, int StatusID)
        {
            int    CampaignPlayerID = 0;
            string Username         = "";

            if (Session["Username"] == null)
            {
                Username = "";
            }
            else
            {
                Username = Session["Username"].ToString();
            }
            Classes.cUserCampaign CampaignPlayer = new Classes.cUserCampaign();
            CampaignPlayer.Load(UserID, CampaignID);
            CampaignPlayerID = CampaignPlayer.CampaignPlayerID; // if this comes back empty (-1) make one
            if (CampaignPlayerID == -1)
            {
                CreatePlayerInCampaign(UserID, CampaignID);
                CampaignPlayer.Load(UserID, CampaignID);
                CampaignPlayerID = CampaignPlayer.CampaignPlayerID;
            }
            int RoleAlignment = 2;

            if (RoleToSignUp == 8)
            {
                RoleAlignment = 1;
            }
            Classes.cPlayerRole PlayerRole = new Classes.cPlayerRole();
            PlayerRole.CampaignPlayerRoleID = -1;
            PlayerRole.CampaignPlayerID     = CampaignPlayerID;
            PlayerRole.RoleID          = RoleToSignUp;
            PlayerRole.RoleAlignmentID = RoleAlignment;
            PlayerRole.Save(UserID);
            if (Username != "")
            {
                Classes.cUser LastLogged   = new Classes.cUser(Username, "Password");
                string        LastCampaign = LastLogged.LastLoggedInCampaign.ToString();
                if (LastCampaign == null || LastCampaign == "0")
                {
                    LastLogged.LastLoggedInCampaign = CampaignID;
                    LastLogged.Save();
                    Session["CampaignID"] = CampaignID;
                }
            }
        }
示例#3
0
        protected void ddlCampaigns_SelectedIndexChanged(object sender, EventArgs e)
        {
            MethodBase lmth          = MethodBase.GetCurrentMethod();
            string     lsRoutineName = lmth.DeclaringType + "." + lmth.Name;

            if (ddlCampaigns.SelectedValue == "-1")
            {
                Response.Redirect("~/Campaigns/JoinACampaign.aspx");
            }

            //			Classes.LogWriter oLogWriter = new Classes.LogWriter();

            // If the campaign ID has changed...
            if (CampaignID.ToString() != ddlCampaigns.SelectedValue)
            {
                //				oLogWriter.AddLogMessage("Starting to change campaign from " + CampaignID.ToString() + " to " + ddlCampaigns.SelectedValue, "Master.ddlCampaigns_SelectedIndexChanged", "", Session.SessionID);
                int iCampaignID;
                if (int.TryParse(ddlCampaigns.SelectedValue, out iCampaignID))
                {
                    Session["CampaignID"]   = iCampaignID;
                    Session["CampaignName"] = ddlCampaigns.SelectedItem.Text;

                    //					oLogWriter.AddLogMessage("New campaign will be " + iCampaignID.ToString(), "Master.ddlCampaigns_SelectedIndexChanged", "", Session.SessionID);

                    if (iCampaignID > 0)
                    {
                        // Since the campaign has changed, need to save the last campaign to the database.

                        Classes.cUser      UserInfo  = new Classes.cUser(UserName, "NOPASSWORD", Session.SessionID);
                        Classes.cUtilities utilities = new Classes.cUtilities();
                        SortedList         sParams   = new SortedList();
                        sParams.Add("@intUserId", UserID);
                        DataTable dtCharList = Classes.cUtilities.LoadDataTable("uspGetCharacterIDsByUserID", sParams, "LARPortal", UserName, lsRoutineName + ".GetCharList");
                        DataView  dvCampChar = new DataView(dtCharList, "CampaignID = " + iCampaignID.ToString(), "CharacterAKA", DataViewRowState.CurrentRows);
                        if (dvCampChar.Count > 0)
                        {
                            int iTemp;
                            if (int.TryParse(dvCampChar[0]["CharacterID"].ToString(), out iTemp))
                            {
                                UserInfo.LastLoggedInCharacter    = iTemp;
                                UserInfo.LastLoggedInMyCharOrCamp = "M";
                            }
                        }
                        else
                        {
                            UserInfo.LastLoggedInCharacter = -1;
                        }
                        UserInfo.LastLoggedInCampaign = iCampaignID;
                        UserInfo.Save();

                        Classes.cCampaignBase Campaign = new Classes.cCampaignBase(iCampaignID, UserName, UserID);



                        //oLogWriter.AddLogMessage("UserInfo was saved." + UserInfo.LastLoggedInCampaign.ToString(), "Master.ddlCampaigns_SelectedIndexChanged", "", Session.SessionID);
                        //Classes.cUser NewUserInfo = new Classes.cUser(UserName, "NOPASSWORD", Session.SessionID);
                        //oLogWriter.AddLogMessage("CampaignID after update was " + NewUserInfo.LastLoggedInCampaign.ToString(), "Master.ddlCampaigns_SelectedIndexChanged", "", Session.SessionID);

                        // Now that we have saved the campaign ID to the database, clear the session variables so it will force a reload.
                        Session.Remove("CampaignID");
                        Session.Remove("CampaignName");
                        Session.Remove("CampaignList");
                        Session.Remove("RoleString");

                        LoadData();

                        if (CampaignChanged != null)
                        {
                            CampaignChanged(this, EventArgs.Empty);
                        }
                    }
                    //					oLogWriter.AddLogMessage("Done with adding." + CampaignID.ToString(), "Master.ddlCampaigns_SelectedIndexChanged", "", Session.SessionID);
                }
            }
        }
示例#4
0
        protected void SendApprovalEmail(int CampaignID, int UserID, int Role, string RequestEmail)
        {
            string strFromUser   = "******";
            string strFromDomain = "larportal.com";
            string strFrom       = strFromUser + "@" + strFromDomain;
            string strTo         = RequestEmail;
            //string strSMTPPassword = "******";
            string strSubject   = "";
            string strBody      = "";
            string CampaignName = "";
            string Username     = "";

            if (Session["Username"] != null)
            {
                Username = Session["Username"].ToString();
            }
            string PlayerFirstName    = ""; // Needs defining - Look up based on UserID
            string PlayerLastName     = ""; // Needs defining
            string PlayerEmailAddress = ""; // Needs defining

            Classes.cCampaignBase Campaign = new Classes.cCampaignBase(CampaignID, "Username", UserID);
            CampaignName = Campaign.CampaignName;
            Classes.cUser UserInfo = new Classes.cUser(Username, "Password");
            PlayerFirstName    = UserInfo.FirstName;
            PlayerLastName     = UserInfo.LastName;
            PlayerEmailAddress = Session["MemberEmailAddress"].ToString();
            switch (Role)
            {
            case 6:
                strSubject = "Request to be a Permanent NPC for " + CampaignName;
                strBody    = "A request to be a permanent NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 7:
                strSubject = "Request to be an Event NPC for " + CampaignName;
                strBody    = "A request to be an Evnet NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 8:
                strSubject = "Request to PC " + CampaignName;
                strBody    = "A request to PC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 10:
                strSubject = "Request to NPC " + CampaignName;
                strBody    = "A request to NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            default:
                break;
            }
            Classes.cEmailMessageService NotifyStaff = new Classes.cEmailMessageService();
            try
            {
                NotifyStaff.SendMail(strSubject, strBody, strTo, "", "", "PointsEmail", Username);
            }
            catch (Exception)
            {
                //lblEmailFailed.Text = "There was an issue. Please contact us at [email protected] for assistance.";
            }
            //MailMessage mail = new MailMessage(strFrom, strTo);
            //SmtpClient client = new SmtpClient("smtpout.secureserver.net", 80);
            //client.EnableSsl = false;
            //client.UseDefaultCredentials = false;
            //client.Credentials = new System.Net.NetworkCredential(strFrom, strSMTPPassword);
            //client.Timeout = 10000;
            //NotifyStaff.SendMail()
            //mail.Subject = strSubject;
            //mail.Body = strBody;
            //mail.IsBodyHtml = true;
            //if (strSubject != "")
            //{
            //    try
            //    {
            //        client.Send(mail);
            //    }
            //    catch (Exception)
            //    {

            //    }
            //}
        }
        protected void SendApprovalEmail(int CampaignID, int UserID, int Role, string RequestEmail)
        {
            string strFromUser   = "******";
            string strFromDomain = "larportal.com";
            string strFrom       = strFromUser + "@" + strFromDomain;
            string strTo         = RequestEmail;
            //string strSMTPPassword = "******";
            string strSubject         = "";
            string strBody            = "";
            string CampaignName       = "";
            string PlayerFirstName    = "";          // Needs defining - Look up based on UserID
            string PlayerLastName     = "";          // Needs defining
            string PlayerEmailAddress = "";          // Needs defining

            Classes.cCampaignBase Campaign = new Classes.cCampaignBase(CampaignID, "Username", UserID);
            CampaignName = Campaign.CampaignName;
            Classes.cUser UserInfo = new Classes.cUser(hidUsername.Value, "Password", Session.SessionID);
            PlayerFirstName    = UserInfo.FirstName;
            PlayerLastName     = UserInfo.LastName;
            PlayerEmailAddress = hidMemberEmailAddress.Value;
            switch (Role)
            {
            case 6:
                strSubject = "Request to be a Permanent NPC for " + CampaignName;
                strBody    = "A request to be a permanent NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 7:
                strSubject = "Request to be an Event NPC for " + CampaignName;
                strBody    = "A request to be an Evnet NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 8:
                strSubject = "Request to PC " + CampaignName;
                strBody    = "A request to PC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            case 10:
                strSubject = "Request to NPC " + CampaignName;
                strBody    = "A request to NPC " + CampaignName + " has been received through LARP Portal.  The player information is below.<p></p><p></p>";
                strBody    = strBody + PlayerFirstName + " " + PlayerLastName + "<p></p>" + PlayerEmailAddress + "<p></p><p></p>";
                strBody    = strBody + "Please reply to the player's request within 48 hours.<p></p><p></p>";
                strBody    = strBody + "Thank you<p></p><p></p>LARP Portal staff";
                break;

            default:
                break;
            }
            Classes.cEmailMessageService NotifyStaff = new Classes.cEmailMessageService();
            try
            {
                NotifyStaff.SendMail(strSubject, strBody, strTo, "", "", "PointsEmail", hidUsername.Value);
            }
            catch (Exception)
            {
                //lblEmailFailed.Text = "There was an issue. Please contact us at [email protected] for assistance.";
            }
        }
示例#6
0
 protected void btnSignUp_Click(object sender, EventArgs e)
 {
     if (Session["AttemptedPassword"] == null)
     {
         txtPasswordNew.Text = "";
     }
     else
     {
         txtPasswordNew.Text = Session["AttemptedPassword"].ToString();
         txtPasswordNew.Attributes.Add("value", txtPasswordNew.Text);
     }
     if (Session["AttemptedPasswordRetype"] == null)
     {
         txtPasswordNewRetype.Text = "";
     }
     else
     {
         txtPasswordNewRetype.Text = Session["AttemptedPasswordRetype"].ToString();
         txtPasswordNewRetype.Attributes.Add("value", txtPasswordNewRetype.Text);
     }
     if (Page.IsValid)
     {
         lblSignUpErrors.Text = "";
         // 1 - No duplicate usernames allowed
         Classes.cLogin Login = new Classes.cLogin();
         Login.CheckForExistingUsername(txtNewUsername.Text);
         if (Login.MemberID != 0)  // UserID is taken
         {
             lblSignUpErrors.Text = "This username is already in use.  Please select a different one.";
         }
         // 2 - Password must meet parameter standards
         int            ValidPassword;
         Classes.cLogin PasswordValidate = new Classes.cLogin();
         PasswordValidate.ValidateNewPassword(txtPasswordNew.Text);
         ValidPassword = PasswordValidate.PasswordValidation;
         if (ValidPassword == 0)
         {
             if (lblSignUpErrors.Text != "")
             {
                 lblSignUpErrors.Text = lblSignUpErrors.Text + "<p></p>" + PasswordValidate.PasswordFailMessage + ".";
             }
             else
             {
                 lblSignUpErrors.Text = PasswordValidate.PasswordFailMessage + ".";
             }
         }
         // 3 - Both passwords must be the same
         if (txtPasswordNew.Text != txtPasswordNewRetype.Text)
         //set an error message
         {
             if (lblSignUpErrors.Text != "")
             {
                 lblSignUpErrors.Text = lblSignUpErrors.Text + "<p></p>Passwords don't match.  Please re-enter.";
             }
             else
             {
                 lblSignUpErrors.Text = "Passwords don't match.  Please re-enter.";
             }
             txtPasswordNew.Text       = "";
             txtPasswordNewRetype.Text = "";
         }
         // 4 - New request - If the email address is already on file, warn them and suggest they go to the Forgot Username / Password section
         Classes.cLogin ExistingEmailAddress = new Classes.cLogin();
         ExistingEmailAddress.GetUsernameByEmail(txtEmail.Text);
         if (ExistingEmailAddress.Username != "")
         {
             if (lblSignUpErrors.Text != "")
             {
                 lblSignUpErrors.Text = lblSignUpErrors.Text + "<p></p>This email address is already associated with an account.  If you've forgotten your username or password, please use the link above.";
             }
             else
             {
                 lblSignUpErrors.Text = "This email address is already associated with an account.  If you've forgotten your username or password, please use the link above.";
             }
         }
         // If there were errors, display them and return to form
         if (lblSignUpErrors.Text != "")
         {
             lblSignUpErrors.Visible = true;
             txtNewUsername.Focus();
         }
         else
         {
             // Everything is ok.  Create the record.  If successful, go to the member demographics screen.
             Classes.cUser NewUser = new Classes.cUser(txtNewUsername.Text, txtPasswordNew.Text);
             NewUser.FirstName     = txtFirstName.Text;
             NewUser.LastName      = txtLastName.Text;
             NewUser.LoginPassword = txtPasswordNew.Text;
             NewUser.LoginEmail    = txtEmail.Text;
             NewUser.LoginName     = txtNewUsername.Text;
             NewUser.Save();
             Classes.cLogin Activation = new Classes.cLogin();
             Activation.Load(txtNewUsername.Text, txtPasswordNew.Text);
             string ActivationKey = "";
             ActivationKey = Activation.SecurityResetCode;
             GenerateWelcomeEmail(txtFirstName.Text, txtLastName.Text, txtNewUsername.Text, txtEmail.Text, ActivationKey);
             Response.Write("<script>");
             Response.Write("window.open('NewUserLoginDirections.aspx','_blank')");
             Response.Write("</script>");
             // TODO-Rick-0e Account for versioning of 'terms of use' and keeping track of date/time and which version user agreed to
         }
     }
     else
     {
         // TODO-Rick-3 On create user if something totally unexpected is wrong put up a message
     }
 }
示例#7
0
        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;
            }
        }
示例#8
0
        protected void ddlUserCampaigns_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlUserCampaigns.SelectedValue == "-1")
            {
                Response.Redirect("~/PublicCampaigns.aspx");
            }
            int    intUserID;
            string SelectedText;
            string SelectedValue;

            SelectedText  = ddlUserCampaigns.SelectedItem.Text.ToString();
            SelectedValue = ddlUserCampaigns.SelectedItem.Value.ToString();
            if (Session["UserID"] == null)
            {
                intUserID = -1;    // In theory we can't actually get here so we should just go back to login
                Response.Redirect("~/index.aspx");
            }
            else
            {
                intUserID = Session["UserID"].ToString().ToInt32();
            }
            Classes.cUser User = new Classes.cUser(Session["Username"].ToString(), "PasswordNotNeeded");
            User.UserID = intUserID;
            User.LastLoggedInCampaign = ddlUserCampaigns.SelectedItem.Value.ToInt32();
            Session["CampaignID"]     = ddlUserCampaigns.SelectedItem.Value.ToInt32();
            Session["CampaignName"]   = ddlUserCampaigns.SelectedItem.Text.ToString();
            User.SetCharacterForCampaignUser(intUserID, ddlUserCampaigns.SelectedItem.Value.ToInt32());
            Session["SelectedCharacter"]  = User.LastLoggedInCharacter;
            User.LastLoggedInMyCharOrCamp = "M";    // 5/27/2017-RPierce - If switching campaign list, assume switching to my characters on character tab
            User.Save();
            // 5/27/2018 - RPierce - Remove Campaign Character session variables
            if (Session["CharacterCampaignCharID"] != null)
            {
                Session.Remove("CharacterCampaignCharID");
            }
            if (Session["CharacterSelectCampaign"] != null)
            {
                Session.Remove("CharacterSelectCampaign");
            }
            if (Session["CharacterSelectGroup"] != null)
            {
                Session.Remove("CharacterSelectGroup");
            }
            if (Session["CharacterSelectID"] != null)
            {
                Session.Remove("CharacterSelectID");
            }
            if (Session["CampaignsToEdit"] != null)
            {
                Session.Remove("CampaignsToEdit");
            }
            if (Session["MyCharacters"] != null)
            {
                Session.Remove("MyCharacters");
            }
            // Go get all roles for that campaign and load them into a session variable
            Classes.cPlayerRoles Roles = new Classes.cPlayerRoles();
            Roles.Load(intUserID, 0, ddlUserCampaigns.SelectedItem.Value.ToInt32(), DateTime.Today);
            Session["PlayerRoleString"] = Roles.PlayerRoleString;
            Classes.cURLPermission permissions = new Classes.cURLPermission();
            bool   PagePermission         = true;
            string DefaultUnauthorizedURL = "";

            permissions.GetURLPermissions(Request.RawUrl, intUserID, Roles.PlayerRoleString);
            PagePermission         = permissions._PagePermission;
            DefaultUnauthorizedURL = permissions._DefaultUnauthorizedURL;
            string ReportCheck = Request.RawUrl.Substring(0, 8);

            if (PagePermission == true)
            {
                if (ReportCheck == "/Reports")
                {
                    Response.Redirect("/Reports/ReportsList.aspx");
                }
                else
                {
                    Response.Redirect(Request.RawUrl);
                }
            }

            else
            {
                Response.Redirect(DefaultUnauthorizedURL);
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["ActiveLeftNav"] = "CampaignInfoSetup";
                if (Session["CampaignName"] != null)
                {
                    lblTopCampaignName.Text = Session["CampaignName"].ToString();
                }
                else
                {
                    lblTopCampaignName.Text = "";
                }
            }
            int    CampaignID;
            string UserName;
            int    UserID;

            if (Session["Username"] != null)
            {
                UserName = Session["Username"].ToString();
            }
            else
            {
                UserName = "";
                Response.Redirect("~/index.aspx");
            }
            if (Session["CampaignID"] == null)
            {
                Classes.cUser User = new Classes.cUser(UserName, "PasswordNotNeeded");
                CampaignID = User.LastLoggedInCampaign;
            }
            else
            {
                int.TryParse(Session["CampaignID"].ToString(), out CampaignID);
            }
            if (Session["UserID"] != null)
            {
                int.TryParse(Session["UserID"].ToString(), out UserID);
            }
            //UserID = ((int)Session["UserID"]);
            else
            {
                UserID = 0;
            }
            Classes.cCampaignBase CampaignBase = new Classes.cCampaignBase(CampaignID, UserName, UserID);
            txtCampaignName.Text = CampaignBase.CampaignName;
            DateTime?dtStartDate = CampaignBase.StartDate;

            txtStarted.Text = string.Format("{0:MMM d, yyyy}", dtStartDate);
            DateTime?dtExpEndDate = CampaignBase.ProjectedEndDate;

            txtExpectedEnd.Text  = string.Format("{0:MMM d, yyyy}", dtExpEndDate);
            txtNumEvents.Text    = CampaignBase.ActualNumberOfEvents.ToString();
            txtGameSystem.Text   = CampaignBase.GameSystemName;
            txtGenres.Text       = CampaignBase.GenreList;
            txtStyle.Text        = CampaignBase.StyleDescription;
            txtTechLevel.Text    = CampaignBase.TechLevelName;
            txtSize.Text         = CampaignBase.CampaignSizeRange;
            txtAvgNumEvents.Text = CampaignBase.ProjectedNumberOfEvents.ToString();
            string c1  = CampaignBase.URL;   //CampaignGMURL
            string c2  = "";
            string c4  = "";
            string c6  = "";
            string c8  = "";
            string c10 = "";
            string c12 = "";
            string c14 = "";
            string c16 = "";
            string c18 = "";

            if (CampaignBase.ShowCampaignInfoEmail == true)
            {
                c2 = CampaignBase.InfoRequestEmail;         //CampgaignGMEmail
            }
            string c3 = CampaignBase.CharacterGeneratorURL; //CharacterURL

            if (CampaignBase.ShowCharacterNotificationEmail == true)
            {
                c4 = CampaignBase.CharacterNotificationEMail; //CharacterEmail
            }
            string c5 = CampaignBase.CharacterHistoryURL;     //CharHistoryURl

            if (CampaignBase.ShowCharacterHistoryEmail == true)
            {
                c6 = CampaignBase.CharacterHistoryNotificationEmail; //CharHistoryEmail
            }
            string c7 = CampaignBase.InfoSkillURL;                   //InfoSkillsURL

            if (CampaignBase.ShowInfoSkillEmail == true)
            {
                c8 = CampaignBase.InfoSkillEMail;        //InfoSkillsEmail
            }
            string c9 = CampaignBase.ProductionSkillURL; //ProdSkillsURL

            if (CampaignBase.ShowProductionSkillEmail == true)
            {
                c10 = CampaignBase.ProductionSkillEMail; //ProdSkillsEmail
            }
            string c11 = CampaignBase.PELSubmissionURL;  //PELURL

            if (CampaignBase.ShowPELNotificationEmail == true)
            {
                c12 = CampaignBase.PELNotificationEMail;    //PELEmail
            }
            string c13 = "";

            if (CampaignBase.ShowCPNotificationEmail == true)
            {
                c14 = CampaignBase.CPNotificationEmail;
            }
            string c15 = CampaignBase.JoinURL;

            if (CampaignBase.ShowJoinRequestEmail == true)
            {
                c16 = CampaignBase.JoinRequestEmail;
            }
            string c17 = CampaignBase.RegistrationURL;

            if (CampaignBase.ShowRegistrationNotificationEmail == true)
            {
                c18 = CampaignBase.RegistrationNotificationEmail;
            }
            // Registration Notification Email

            BuildContacts(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18);
            CampaignDescription.Text = CampaignBase.WebPageDescription.Replace("\n", "<br>");
            txtMembershipFee.Text    = CampaignBase.MembershipFee.ToString();
            txtFrequency.Text        = CampaignBase.MembershipFeeFrequency;
            txtMinimumAge.Text       = CampaignBase.MinimumAge.ToString();
            txtSupervisedAge.Text    = CampaignBase.MinimumAgeWithSupervision.ToString();
            txtWaiver1.Text          = "Waiver source TBD"; //TODO-Rick-2 Find the two (or more) waivers - may have to allow for even more
            txtWaiver2.Text          = "Waiver source 2 TBD";
            txtConsent.Text          = "Consent TBD";       //TODO-Rick-3 Find out where the consent is stored (what is consent anyway?)
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    Session["ActiveLeftNav"] = "CampaignInfoSetup";
                    lblTopCampaignName.Text  = Session["CampaignName"].ToString();
                    lblWIP.BackColor         = System.Drawing.Color.Yellow;
                    lblWIP.Text = " (WIP)";
                }
                catch
                {
                    Response.Redirect("ContactUs.aspx", true);
                }
            }
            int    CampaignID;
            string UserName;
            int    UserID;

            if (Session["Username"] != null)
            {
                UserName = Session["Username"].ToString();
            }
            else
            {
                UserName = "";
                //If we have a null Username here should we assume all is FUBAR and redirect to login?
                Response.Redirect("~/index.aspx");
            }
            if (Session["CampaignID"] == null)
            {
                Classes.cUser User = new Classes.cUser(UserName, "PasswordNotNeeded");
                CampaignID = User.LastLoggedInCampaign;
            }
            else
            {
                int.TryParse(Session["CampaignID"].ToString(), out CampaignID);
            }
            if (Session["UserID"] != null)
            {
                UserID = ((int)Session["UserID"]);
            }
            else
            {
                UserID = 0;
            }
            Classes.cCampaignBase CampaignBase = new Classes.cCampaignBase(CampaignID, UserName, UserID);
            txtCampaignName.Text = CampaignBase.CampaignName;
            DateTime?dtStartDate = CampaignBase.StartDate;

            txtStarted.Text = string.Format("{0:MMM d, yyyy}", dtStartDate);
            DateTime?dtExpEndDate = CampaignBase.ProjectedEndDate;

            txtExpectedEnd.Text  = string.Format("{0:MMM d, yyyy}", dtExpEndDate);
            txtNumEvents.Text    = CampaignBase.ActualNumberOfEvents.ToString();
            txtGameSystem.Text   = CampaignBase.GameSystemName;
            txtGenre1.Text       = "Genre1 TBD";
            txtGenre2.Text       = "Genre2 TBD";
            txtStyle.Text        = CampaignBase.StyleDescription;
            txtTechLevel.Text    = CampaignBase.TechLevelName;
            txtSize.Text         = CampaignBase.MarketingCampaignSize.ToString();
            txtAvgNumEvents.Text = CampaignBase.ProjectedNumberOfEvents.ToString();
            // TODO-Jack-Define contacts variables and pass them through programatically to build contacts section
            string c1  = CampaignBase.URL;                               //CampaignGMURL
            string c2  = CampaignBase.InfoRequestEmail;                  //CampgaignGMEmail
            string c3  = CampaignBase.CharacterGeneratorURL;             //CharacterURL
            string c4  = CampaignBase.CharacterNotificationEMail;        //CharacterEmail
            string c5  = CampaignBase.CharacterHistoryURL;               //CharHistoryURl
            string c6  = CampaignBase.CharacterHistoryNotificationEmail; //CharHistoryEmail
            string c7  = CampaignBase.InfoSkillURL;                      //InfoSkillsURL
            string c8  = CampaignBase.InfoSkillEMail;                    //InfoSkillsEmail
            string c9  = CampaignBase.ProductionSkillURL;                //ProdSkillsURL
            string c10 = CampaignBase.ProductionSkillEMail;              //ProdSkillsEmail
            string c11 = CampaignBase.PELSubmissionURL;                  //PELURL
            string c12 = CampaignBase.PELNotificationEMail;              //PELEmail

            BuildContacts(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12);
            //CampaignHeader.Text = "Description Header (Source TBD?)";
            CampaignDescription.Text = CampaignBase.WebPageDescription;
            txtMembershipFee.Text    = CampaignBase.MembershipFee.ToString();
            txtFrequency.Text        = CampaignBase.MembershipFeeFrequency;
            txtMinimumAge.Text       = CampaignBase.MinimumAge.ToString();
            txtSupervisedAge.Text    = CampaignBase.MinimumAgeWithSupervision.ToString();
            txtWaiver1.Text          = "Waiver source TBD"; //TODO-Rick-2 Find the two (or more) waivers - may have to allow for even more
            txtWaiver2.Text          = "Waiver source 2 TBD";
            txtConsent.Text          = "Consent TBD";       //TODO-Rick-2 Find out where the consent is stored (what is consent anyway?)
        }
示例#11
0
        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();
            }
        }