コード例 #1
0
        /// <summary>
        /// After changing Login, load stored information.
        /// </summary>
        /// <param name="sUserName"></param>
        protected void LoadLogin(string sUserName)
        {
            RepObject r  = new RepObject();
            DataSet   ds = r.PhoneAccessData(sUserName);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];

                Session["FullName"]      = dr["FullName"].ToString();
                Session["Password"]      = dr["Password"].ToString();
                Session["Email"]         = dr["Email"].ToString();
                Session["Phone"]         = dr["Phone"].ToString();
                Session["PhoneProgress"] = dr["PhoneProgressCode"].ToString();
                Session["PhoneType"]     = dr["PhoneType"].ToString();
            }

            txtFullName.Text   = Session["FullName"].ToString();
            txtPassword.Text   = Session["Password"].ToString();
            txtEmail.Text      = Session["Email"].ToString();
            txtPhone.Text      = Session["Phone"].ToString();
            chkNewUser.Checked = false;

            ShowControls();
        }
コード例 #2
0
        public UseItemAction(GameObject _repObject)
            : base("Use Item", "Utilize a selected item.", _repObject, null)
        {
            //TODO: Move this shit into EnviromentAction as methods to modify PushedFrames.

            //  --- [ Select an Item ] ---  //
            EnviromentSelect_FrameMeta getItem =
                new EnviromentSelect_FrameMeta(
                    SelectionType.FromGiven,
                    RepObject.GetGameObjects <GameObject>()
                    );  //TODO: Make an ItemObject GameObject

            getItem.SelectionMade += () =>
            {
                SelectedObject = getItem.GetSelectedAs <GameObject>(); //TODO: Above ^
            };

            //  --- [ Get Action ] ---  //
            EnviromentSelect_FrameMeta getAction = new EnviromentSelect_FrameMeta(
                SelectionType.FromGiven,
                RepObject.GetActions <GameAction>()
                );  //TODO: Make an PossessibleAction GameAction

            getAction.SelectionMade += () =>
            {
                SelectedAction = getAction.GetSelectedAs <GameAction>(); //TODO: Above ^
            };

            PushedFrames = new FrameMeta[]
            {
                getItem,
                getAction
            };
        }
コード例 #3
0
        public AttackWithAction(GameObject _repObject)
            : base("Attack", "Attack with a selected means at a selected target.", _repObject, null)
        {
            //  --- [ Select Attack Method ] ---  //

            EnviromentSelect_FrameMeta getAttackMethod =
                new EnviromentSelect_FrameMeta(
                    SelectionType.FromGiven,
                    RepObject.GetActions <GameAction>()
                    ); //TODO: Make AttackAction action.

            getAttackMethod.SelectionMade += () =>
            {
                AttackMethod = getAttackMethod.GetSelectedAs <GameAction>();
            };

            //  --- [ Select a Target ] --- //

            EnviromentSelect_FrameMeta getTarget =
                new EnviromentSelect_FrameMeta(SelectionType.FromEnviroment);

            getTarget.SelectionMade += () => { Victim = getTarget.GetSelectedAs <GameObject>(); };

            //  --- [ Finish Init ] --- //

            PushedFrames = new FrameMeta[]
            {
                getAttackMethod,
                getTarget
            };
        }
コード例 #4
0
        public void InvokeAction(DamageEventArgument args)
        {
            base.InvokeAction(args);

            //TODO: Test for immunities... armor... etc.

            RepObject.ModifyAttribute <HealthAttribute>(args.DamageAttribute.Amount);
        }
コード例 #5
0
        /// <summary>
        /// Load a list of Reps for the Gift Card Program.
        /// </summary>
        protected void LoadReps()
        {
            ddlReps.Items.Clear();

            RepObject r = new RepObject();

            DataSet ds = r.List();

            ddlReps.DataTextField  = "Full_Name";
            ddlReps.DataValueField = "RepID";

            DataRow dr = ds.Tables[0].NewRow();

            dr["RepID"]     = "0";
            dr["Full_Name"] = "";
            ds.Tables[0].Rows.InsertAt(dr, 0);

            ddlReps.DataSource = ds.Tables[0];
            ddlReps.DataBind();
            ddlReps.Items[0].Selected = true;
        }
コード例 #6
0
        protected void btnRequestAccess_Click(object sender, EventArgs e)
        {
            // Require the fields.
            lblStatus.Text    = "";
            lblStatus.Visible = false;
            string sErrors = "";

            string sPhoneType = Session["PhoneType"].ToString();

            if (String.IsNullOrEmpty(sPhoneType) == true)
            {
                sErrors = sErrors + "Phone Type";
            }
            if (String.IsNullOrEmpty(txtUserName.Text.ToString()) == true)
            {
                if (sErrors != "")
                {
                    sErrors = sErrors + ", ";
                }
                sErrors = sErrors + "Login ID";
            }
            if (String.IsNullOrEmpty(txtFullName.Text.ToString()) == true)
            {
                if (sErrors != "")
                {
                    sErrors = sErrors + ", ";
                }
                sErrors = sErrors + "Full Name";
            }
            if (String.IsNullOrEmpty(txtPassword.Text.ToString()) == true)
            {
                if (sErrors != "")
                {
                    sErrors = sErrors + ", ";
                }
                sErrors = sErrors + "Password";
            }
            if (String.IsNullOrEmpty(txtEmail.Text.ToString()) == true)
            {
                if (sErrors != "")
                {
                    sErrors = sErrors + ", ";
                }
                sErrors = sErrors + "Email";
            }
            if (String.IsNullOrEmpty(txtPhone.Text.ToString()) == true)
            {
                if (sErrors != "")
                {
                    sErrors = sErrors + ", ";
                }
                sErrors = sErrors + "Phone";
            }

            if (sErrors != "")
            {
                sErrors = sErrors + " missing. Please correct.";

                lblStatus.Text    = sErrors;
                lblStatus.Visible = true;
                return;
            }

            // Assert:  We have all the fields we need.

            RepObject r = new RepObject();

            string sUserName = txtUserName.Text;
            string sFullName = txtFullName.Text;
            int    iRepID    = Convert.ToInt32(Session["RepID"]);
            int    iIsNew    = chkNewUser.Checked ? 1 : 0;
            string sPassword = txtPassword.Text.ToString();
            string sEmail    = txtEmail.Text.ToString();
            string sPhone    = txtPhone.Text.ToString();

            // Request phone access.
            if (r.PhoneAccessRequest(sUserName, sFullName, iRepID, iIsNew, sPassword, sEmail, sPhoneType, sPhone) == -1)
            {
                lblStatus.Text = "Request for mobile phone access submitted.";
            }
            else
            {
                lblStatus.Text = "There was an ERROR in your request for mobile phone access.  Please contact MGM.";
            }
            lblStatus.Visible = true;
        }