示例#1
0
        public void Reset(Object sender, EventArgs e)
        {
            Database locDB = new Database();

            locDB.Exec("Reset('" + AgentState.GetInstance((string)Session["UserName"]).Name + "')");
            DataBind();
        }
示例#2
0
        public void NextStep(Object sender, EventArgs e)
        {
            Database locDB = new Database();

            locDB.Exec("CalcStep('" + AgentState.GetInstance((string)Session["UserName"]).Name + "', true)");
            DataBind();
        }
示例#3
0
        public void SetUser(string argName)
        {
            AgentState locAgent = new AgentState(argName);

            AgentState.GetInstance(argName).Name = argName;
            DataBind();
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Context.User.Identity.Name != "")
            {
                Session["UserName"] = Context.User.Identity.Name;

                AgentState locState = AgentState.GetInstance((string)Session["UserName"]);

                // Это случай когда регистрация уже произошла
                if (locState.Name != Context.User.Identity.Name)
                {
                    locState.Name = Context.User.Identity.Name;
                    DataBind();
                }
                if (locState.BonusStepCountInt > 0)
                {
                    RptArt.Items[0].FindControl("BonusButton").Visible = true;
                }
                else
                {
                    RptArt.Items[0].FindControl("BonusButton").Visible = false;
                }
                if (locState.Dead == "1")
                {
                    RptArt.Items[0].FindControl("Dead").Visible = true;
                }
            }
            else
            {
            }


            //if (PreviousPage != null)
            //{
            //    Button button = (Button)PreviousPage.FindControl("Button1");
            //    Label1.Text = "Вызов выполнен кнопкой: " + button.Text;
            //    TextBox textBox = (TextBox)PreviousPage.FindControl("TextBox1");
            //    TextBox1.Text = textBox.Text;
            //}
        }