コード例 #1
0
ファイル: AdminBasePage.cs プロジェクト: kimch2/Arsenalcn
        protected override void OnInitComplete(EventArgs e)
        {
            AdminPage         = true;
            AnonymousRedirect = true;

            base.OnInitComplete(e);

            if (!ConfigAdmin.IsPluginAdmin(userid))
            {
                Response.Redirect("CasinoPortal.aspx");
            }
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: kimch2/Arsenalcn
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ConfigGlobal.PluginActive)
            {
                Response.Redirect("CasinoPortal.aspx");
            }
            else
            {
                ltrlPluginName.Text = $"<strong>欢迎进入{ConfigGlobal.PluginDisplayName}</strong>";

                pnlAdmin.Visible = ConfigAdmin.IsPluginAdmin(userid);
            }
        }
コード例 #3
0
ファイル: FieldTooBar.ascx.cs プロジェクト: kimch2/Arsenalcn
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserId == -1)
            {
                ltrlToolBarTip.Text = "<strong>欢迎进入,请在<a href=\"/login.aspx\" target=\"_self\">登录</a>后使用全部功能</strong>";
            }
            else
            {
                ltrlToolBarTip.Text = $"<strong>提醒:您可投注即将于<em>{ConfigGlobal.CasinoValidDays}</em>天内开始的比赛</strong>";
            }

            pnlFuncLink.Visible = ConfigAdmin.IsPluginAdmin(UserId);
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!ConfigAdmin.IsPluginAdmin(this.UID))
     {
         Response.Redirect("default.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             InitForm();
         }
     }
 }
コード例 #5
0
        protected void LoadPageData()
        {
            // Administrators could enter this page
            if (ConfigAdmin.IsPluginAdmin(userid))
            {
                pnlInaccessible.Visible = false;
                phContent.Visible       = true;

                //init gridview
                BindMemberList();
            }
            else
            {
                var userClub = ClubLogic.GetActiveUserClub(userid, ClubID);

                if (userClub != null && userClub.Responsibility.HasValue)
                {
                    if (userClub.Responsibility.Value.Equals((int)Responsibility.Executor) ||
                        userClub.Responsibility.Value.Equals((int)Responsibility.Manager))
                    {
                        pnlInaccessible.Visible = false;
                        phContent.Visible       = true;

                        //init gridview
                        BindMemberList();
                    }
                    else
                    {
                        pnlInaccessible.Visible = true;
                        phContent.Visible       = false;
                    }
                }
                else
                {
                    pnlInaccessible.Visible = true;
                    phContent.Visible       = false;
                }
            }
        }
コード例 #6
0
ファイル: ManageClub.aspx.cs プロジェクト: kimch2/Arsenalcn
        protected void LoadPageData()
        {
            var club = ClubLogic.GetClubInfo(ClubID);

            if (club != null)
            {
                // Current User must be the manager of this club or Administrator
                if (club.ManagerUid.Value.Equals(userid) || ConfigAdmin.IsPluginAdmin(userid))
                {
                    pnlInaccessible.Visible = false;
                    phContent.Visible       = true;

                    //Init Form
                    ltrlClubName.Text        = club.FullName;
                    ltrlClubManagerName.Text = club.ManagerUserName;
                    ltrlFullName.Text        = club.FullName;
                    ltrlShortName.Text       = club.ShortName;

                    if (club.IsAppliable.Value)
                    {
                        rblAppliable.SelectedValue = "true";
                    }
                    else
                    {
                        rblAppliable.SelectedValue = "false";
                    }

                    tbManager.Text = club.ManagerUserName;

                    if (club.RankLevel == 0)
                    {
                        phExecutor.Visible = false;
                    }
                    else
                    {
                        phExecutor.Visible = true;

                        var users = ClubLogic.GetClubLeads(ClubID);
                        var sbEx  = new StringBuilder();
                        foreach (var user in users)
                        {
                            if (user.Responsibility.Value == (int)Responsibility.Executor)
                            {
                                sbEx.AppendFormat("{0}|", user.UserName);
                            }
                        }

                        if (sbEx.Length != 0)
                        {
                            sbEx.Remove(sbEx.Length - 1, 1);
                        }

                        tbExecutor.Text = sbEx.ToString();
                    }

                    tbSlogan.Text = club.Slogan;
                    tbDesc.Text   = club.Description;

                    if (club.LogoName != string.Empty)
                    {
                        ltrlLogo.Visible = true;
                        ltrlLogo.Text    =
                            string.Format(
                                "<a href=\"{0}\" target=\"_blank\" title=\"点击放大\"><img src=\"{0}\" width=\"24\" height=\"24\" alt=\"点击放大\" /></a>",
                                "UploadFiles/" + club.LogoName);
                    }
                    else
                    {
                        ltrlLogo.Visible = false;
                    }
                }
                else
                {
                    pnlInaccessible.Visible = true;
                    phContent.Visible       = false;
                }
            }
            else
            {
                pnlInaccessible.Visible = true;
                phContent.Visible       = false;
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (userid == -1)
            {
                pnlFuncLink.Visible = false;

                ltrlToolBarTip.Text = "<strong>欢迎进入,请在<a href=\"/login.aspx\" target=\"_self\">登录</a>后使用全部功能</strong>";
            }
            else
            {
                pnlFuncLink.Visible = true;

                var myClubs = ClubLogic.GetActiveUserClubs(userid);

                var leftCount = ConfigGlobal.SingleUserMaxClubCount - myClubs.Count;

                if (leftCount < 0)
                {
                    leftCount = 0;
                }

                ltrlToolBarTip.Text = $"<strong>提醒:您还可以加入<em>{leftCount}</em>个球会</strong>";

                if (ConfigAdmin.IsPluginAdmin(userid))
                {
                    phAdministrator.Visible = true;
                }
                else
                {
                    phAdministrator.Visible = false;
                }
            }

            //lucky player

            if (ConfigGlobal.LuckyPlayerActive)
            {
                phLuckPlayer.Visible = true;

                ltrlBonus.Text = LuckyPlayer.CalcTotalBonus().ToString();

                var luckyPlayerID = ConfigGlobal.LuckyPlayerID;

                var player = PlayerStrip.GetPlayerInfoByPlayerID(luckyPlayerID);
                var clubs  = ClubLogic.GetActiveUserClubs(player.UserID);
                var IsLuckyPlayerLeader =
                    clubs.Exists(
                        delegate(Club club)
                {
                    return
                    (ClubLogic.GetClubLeads(club.ID.Value)
                     .Exists(delegate(UserClub uc) { return uc.Userid == this.userid; }));
                });

                if (DateTime.Now.Hour < ConfigGlobal.LuckyPlayerDeadline)
                {
                    IsLuckyPlayerLeader = false;
                }

                if (player != null)
                {
                    ltrlLuckyPlayerName.Text = player.UserName;

                    if ((player.UserID != userid && !IsLuckyPlayerLeader) || (userid == -1))
                    {
                        if (ConfigGlobal.LuckyPlayerBonusGot)
                        {
                            btnGetBonus.Visible = true;
                            btnGetBonus.Enabled = false;
                            btnGetBonus.Text    = "已领取";
                        }
                        else
                        {
                            btnGetBonus.Visible = false;
                        }
                    }
                    else if (!ConfigGlobal.LuckyPlayerBonusGot)
                    {
                        btnGetBonus.Visible = true;
                        if ((player.UserID != userid) && IsLuckyPlayerLeader)
                        {
                            btnGetBonus.Text = "请代领";
                        }
                    }
                    else
                    {
                        btnGetBonus.Visible = true;
                        btnGetBonus.Enabled = false;
                        btnGetBonus.Text    = "已领取";
                    }
                }
                else
                {
                    btnGetBonus.Visible = false;
                }
            }
            else
            {
                phLuckPlayer.Visible = false;
            }
        }
コード例 #8
0
ファイル: ManageMember.aspx.cs プロジェクト: kimch2/Arsenalcn
        protected void Page_Load(object sender, EventArgs e)
        {
            var club = ClubLogic.GetClubInfo(ClubID);

            if (club != null && Title.IndexOf("{0}") >= 0)
            {
                Title = string.Format(Title, club.FullName);
            }

            #region SetControlProperty

            ctrlLeftPanel.UserID   = userid;
            ctrlLeftPanel.UserName = username;
            ctrlLeftPanel.UserKey  = userkey;

            ctrlFieldToolBar.UserID   = userid;
            ctrlFieldToolBar.UserName = username;

            ctrlManageMenuTabBar.CurrentMenu = ManageClubMenuItem.ManageMember;
            ctrlManageMenuTabBar.UserID      = userid;

            #endregion

            if (!IsPostBack)
            {
                #region Bind ddlGroup

                var list = ClubLogic.GetActiveClubs();
                if (list != null && list.Count > 0)
                {
                    ddlClub.DataSource     = list;
                    ddlClub.DataTextField  = "FullName";
                    ddlClub.DataValueField = "ID";
                    ddlClub.DataBind();

                    var item = new ListItem("--请选择球会--", string.Empty);
                    ddlClub.Items.Insert(0, item);
                }
                else
                {
                    ddlClub.Visible = false;
                }

                #endregion

                // Administrators could enter this page
                if (ConfigAdmin.IsPluginAdmin(userid))
                {
                    pnlInaccessible.Visible = false;
                    phContent.Visible       = true;

                    //init gridview
                    BindData();
                }
                else
                {
                    var userClub = ClubLogic.GetActiveUserClub(userid, ClubID);

                    if (userClub != null && userClub.Responsibility.HasValue)
                    {
                        if (userClub.Responsibility.Value.Equals((int)Responsibility.Executor) ||
                            userClub.Responsibility.Value.Equals((int)Responsibility.Manager))
                        {
                            pnlInaccessible.Visible = false;
                            phContent.Visible       = true;

                            //init gridview
                            BindData();
                        }
                        else
                        {
                            pnlInaccessible.Visible = true;
                            phContent.Visible       = false;
                        }
                    }
                    else
                    {
                        pnlInaccessible.Visible = true;
                        phContent.Visible       = false;
                    }
                }
            }
        }