Ejemplo n.º 1
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     DropDownList dop = (DropDownList) sender;
     GridViewRow gvr = (GridViewRow) dop.NamingContainer;
     string userName = GridView1.DataKeys[gvr.RowIndex][0].ToString();
     string newStatus = dop.SelectedValue;
     Agent agent = new AutoBwsBLL.AgentBLL().getAgentDetail(userName);
     if (newStatus == agent.State) // 状态没有改变
     {
         return;
     }
     if (new AutoBwsBLL.AgentBLL().ChangeStutesByAgentName(userName, newStatus))
     {
         bindGridView();
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "",
                                             "<script>alert('Changed successfully');func();</script>", false);
         //关闭agent_引擎
         if ("closed" == newStatus || "suspended" == newStatus)
         {
             betEngine.LogoutAgent(agent);
         }
         else if ("active" == newStatus) // 重置状态
         {
             betEngine.LoginAgents(new List<Agent>() { agent});
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "<script>alert('failed!');func();</script>",
                                             false);
     }
     //DropDownList dop = (sender as DropDownList);
     //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "<script>alert('" + dop.SelectedValue + "');func();</script>", false);
 }
Ejemplo n.º 2
0
        public void bindGridView()
        {
            DataTable dt = null;
            switch (GetAccountType())
            {
                case "S":
                    dt = new AutoBwsBLL.AgentBLL().getList();
                    break;
                case "A":
                    dt = new AutoBwsBLL.AgentBLL().getAgentListByAdminId_Status((Session["currentUser"] as UserInfo).Id, "%");
                    break;
                case "SU":
                    dt = new AutoBwsBLL.AgentBLL().getAgentListByUserLogin_Status((Session["currentUser"] as UserInfo).LoginName, "All");
                    break;
                case "P":
                    break;
            }

            if (dt != null && dt.Rows.Count > 0)
            {
                GridView1.DataSource = dt;
            }
            else
            {
                GridView1.DataSource = null;
            }
            DataBind();
        }
Ejemplo n.º 3
0
        public void AgentDetail()
        {
            Agent agent = new AutoBwsBLL.AgentBLL().getAgentDetail(Request.QueryString["uid"]);

            bindddlURL(agent.UrlType);
            txtloginName.ReadOnly = true;
            txtloginName.Text = agent.LoginName;
            txtloginPwd.Attributes.Add("value", agent.LoginPwd);
            ddlURL.Items.Insert(0, agent.Url);
            if (!IsWritable())
            {
                ddlURL.Enabled = false;
            }
            //			this.ddlIP.Items.Insert(0, agent.Ip);
            DataTable dt = new AutoBwsBLL.GhostBLL().getGhostsByAgentLoginName(agent.Id + "");

            this.GridView1.DataSource = dt;
            this.GridView1.DataBind();

            if (!this.IsWritable())
            {
            //				this.GridView1.Visible = false;
                this.btnSubmit.Visible = false;
                this.txtloginName.ReadOnly = true;
                this.txtloginName.Attributes["class"] = "";
                this.txtloginPwd.ReadOnly = true;
                this.txtloginPwd.Attributes["class"] = "";
                this.ddlURL.Enabled = false;
            //				this.ddlIP.Enabled = false;
                this.needHidden.Visible = false;

                this.txtghost1.Enabled = false;
                this.txtRealBet1.Enabled = false;
                this.ckReverse1.Enabled = false;

                this.txtghost2.Enabled = false;
                this.txtRealBet2.Enabled = false;
                this.ckReverse3.Enabled = false;

                this.txtghost4.Enabled = false;
                this.txtRealBet4.Enabled = false;
                this.ckReverse4.Enabled = false;

                this.txtghost5.Enabled = false;
                this.txtRealBet5.Enabled = false;
                this.ckReverse5.Enabled = false;
            }
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string str = Request.QueryString["q"];
     returnStrs = str;
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(str))
         {
             DataTable dt = new AutoBwsBLL.AgentBLL().getList();
             if (dt != null && dt.Rows.Count > 0)
             {
                 list = new List<string>();
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     list.Add(Convert.ToString(dt.Rows[i]["Partner"]));
                 }
             }
         }
     }
     Response.Write(getPlayerList_PlayerName(str));
 }