Ejemplo n.º 1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     string loginname = this.txtLoginName.Text.Trim();
     string loginpwd = this.txtLoginPwd.Text.Trim();
     string name = this.txtName.Text.Trim();
     //            bool viewreport = this.ddlViewReport.SelectedValue.Equals("yes") ? true : false;
     //            bool changepartnerpwd = this.ddlChangePartnerPwd.SelectedValue.Equals("yes") ? true : false;
     //            bool createpartneraccount = this.ddlCreatePartnerAccount.SelectedValue.Equals("yes") ? true : false;
     UserInfo userInfo = new UserInfo();
     if (!String.IsNullOrEmpty(hdUId.Value))
     {
         userInfo.Id = Convert.ToInt32(hdUId.Value);
     }
     userInfo.LoginName = loginname;
     userInfo.LoginPwd = loginpwd;
     userInfo.Name = name;
     userInfo.ViewReport = false;
     userInfo.ChangePartnerPwd = true;
     userInfo.IsPublicGroup = false;
     userInfo.CreditAvailable = Convert.ToInt32(txtCredit.Text);
     userInfo.CreatePartnerAccount = true;
     userInfo.CreateSourceUser = cbSource.Checked;
     userInfo.CreatePublicUser = cbPublic.Checked;
     userInfo.ParentId = (Session["currentUser"] as AutoBwsModel.UserInfo).Id;
     UserCredit creditInfo = new UserCredit();
     //info.ExpiredTime = DateTime.Now.AddDays(Convert.ToDouble(AutoBwsBLL.Config.CreditConfig.GetInstance().Getperiod()));
     creditInfo.TrueUserId = 0;
     AutoBwsBLL.AdminBLL adminBll = new AutoBwsBLL.AdminBLL();
     if (this.lblAddOrDetail2.Text.ToLower().Contains("add"))
     {
         if (adminBll.AddNewAdmin_checkLoginName(loginname))
         {
             Common.yvonYmPrompt.AlertError("This admin account already exists!", this.Page, "cleanyvon");
         }
         else
         {
             if (adminBll.AddNewAdminWithCredits(userInfo, creditInfo, Convert.ToInt32(txtCredit.Text)))
             {
                 Common.yvonYmPrompt.AlertSuccess("Admin account created!", this.Page, "cleanyvon");
             }
             else
             {
                 Common.yvonYmPrompt.AlertError("Failed to create admin account!", this.Page);
             }
         }
     }
     else
     {
         if (adminBll.UpdateAdmin(userInfo))
         {
             Common.yvonYmPrompt.AlertSuccess("Admin account updated!", this.Page, "cleanyvon");
             HttpContext.Current.Response.Redirect("~/files/AdminList.aspx");
         }
         else
         {
             Common.yvonYmPrompt.AlertError("Failed to update admin account!", this.Page);
         }
     }
 }
Ejemplo n.º 2
0
 public void bindGridView()
 {
     DataTable dt = new AutoBwsBLL.AdminBLL().getList("admin");
     if (dt != null && dt.Rows.Count > 0)
     {
         this.GridView1.DataSource = dt;
         this.GridView1.DataBind();
     }
     else
     {
         this.GridView1.DataSource = null;
         this.GridView1.DataBind();
     }
 }
Ejemplo n.º 3
0
        public void adminDetail()
        {
            UserInfo ui = new AutoBwsBLL.AdminBLL().getAdminDetail(Request.QueryString["uid"]);
            if (ui != null && !string.IsNullOrEmpty(ui.Name))
            {
                txtName.Text = ui.Name;
                txtLoginName.Text = ui.LoginName;
                txtLoginPwd.Attributes.Add("value", ui.LoginPwd);
                txtVerifyPassword.Attributes.Add("value", ui.LoginPwd);
                cbSource.Checked = ui.CreateSourceUser;
                cbPublic.Checked = ui.CreatePublicUser;
                hdUId.Value = ui.Id.ToString();
            //                if (ui.ViewReport == true) this.ddlViewReport.Items.Insert(0, "yes");
                if (ui.ChangePartnerPwd)
                {
            //                    this.ddlChangePartnerPwd.Items.Insert(0, "yes");
                }
                if (ui.CreatePartnerAccount)
                {
            //                    this.ddlCreatePartnerAccount.Items.Insert(0, "yes");
                }
                //AutoBwsBLL.Credit.CreditManager cm = new AutoBwsBLL.Credit.CreditManager();
                //ui.CreditList = cm.GetCreditByAdmin(ui.Id);
                //this.Label1.Text = ui.CreditList.Where(x => x.State == 0 && x.UserId < 1).Count().ToString();

                this.txtLoginName.ReadOnly = true;
                this.txtLoginName.Attributes["class"] = "";
                if (!this.IsWritable())
                {
                    btnSubmit.Visible = false;
                    //tr1.Visible = false;
                    txtName.ReadOnly = true;
                    txtName.Attributes["class"] = "";
                    txtLoginPwd.ReadOnly = true;
                    txtLoginPwd.Attributes["class"] = "";
                    txtVerifyPassword.ReadOnly = true;
                    txtVerifyPassword.Attributes["class"] = "";
                    cbSource.Enabled = false;
                    cbPublic.Enabled = false;
            //                    this.ddlViewReport.Enabled = false;
            //                    this.ddlChangePartnerPwd.Enabled = false;
            //                    this.ddlCreatePartnerAccount.Enabled = false;
                }
            }
        }
Ejemplo n.º 4
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     string status = this.ddlStatus.SelectedValue;
     string adminName = string.IsNullOrEmpty(this.txtloginName.Text.Trim()) == true
                        	? "noName"
                        	: this.txtloginName.Text.Trim();
     DataTable dt = new AutoBwsBLL.AdminBLL().getListByConditions(adminName, status, "admin");
     if (dt != null && dt.Rows.Count > 0)
     {
         this.GridView1.DataSource = dt;
         this.GridView1.DataBind();
     }
     else
     {
         this.GridView1.DataSource = null;
         this.GridView1.DataBind();
     }
 }
Ejemplo n.º 5
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.AdminBLL().getList("admin");
             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]["loginName"]));
                 }
             }
         }
     }
     Response.Write(getPlayerList_PlayerName(str));
 }
Ejemplo n.º 6
0
        private DataTable GetTopTenByWeek(string week)
        {
            String loginName = string.Empty;
            if (HttpContext.Current.Session["currentUser"] == null)
                HttpContext.Current.Response.Redirect("~/Default.aspx");
            else
                loginName = ((UserInfo)Session["currentUser"]).LoginName;
            String jurisdiction = AutoBwsWeb.Common.BasePage.getUserType(this.Page);
            DataTable dt = rBLL.getTop10Reverse(week);
            if (null == dt || null == dt.Rows || jurisdiction.EndsWith("S"))
            {
                return dt;
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                String ghost = Convert.ToString(dt.Rows[i]["Ghost"]);
                // 判定ghost所属User是否属于Admin账户
                if (jurisdiction.EndsWith("A"))
                {
                    // todo need to use a real "company"
                    DataTable ghostDt = new AutoBwsBLL.GhostBLL().GetGhostByGhostName(ghost, "IBCBet");
                    int agentId = Convert.ToInt32(ghostDt.Rows[0]["belong2Agent"]);
                    AutoBwsModel.Agent agent = new AutoBwsBLL._EngineBLL().getEngineAgentByID(agentId);
                    int userId = agent.Partner.Id;
                    int id = Convert.ToInt32(new AutoBwsBLL.AdminBLL().GetAdminById(userId).Rows[0]["parentId"]);
                    string name = new AutoBwsBLL.AdminBLL().GetAdminById(id).Rows[0]["loginName"].ToString();
                    if (name == loginName)
                    {
                        continue;
                    }
                }
                bool flag = rBLL.CheckGhostBelong2Partner(ghost, loginName);
                if (!flag)
                {
                    dt.Rows[i]["Ghost"] = "Ghost" + (i + 1);
                }
            }

            return dt;
        }