예제 #1
0
        private void SaveGameStep2()
        {
            string str  = this.txt_grades.Text.Trim();
            string val  = this.txt_uPoint.Text.Trim();
            string str3 = this.txt_gPoint.Text.Trim();
            int    i    = 0;
            int    num2 = 0;

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("请选择适用会员等级!", false);
            }
            else if (!val.bInt(ref i))
            {
                this.ShowMsg("请输入正确的消耗积分!", false);
            }
            else
            {
                if (string.IsNullOrEmpty(str3))
                {
                    str3 = "0";
                }
                if (!str3.bInt(ref num2))
                {
                    this.ShowMsg("请输入正确的赠送积分!", false);
                }
                else
                {
                    GameActInfo game = GameActHelper.Get(_gameId);
                    game.MemberGrades   = str;
                    game.usePoint       = i;
                    game.GivePoint      = num2;
                    game.bOnlyNotWinner = this.onlyChk.Checked;
                    if (this.rd1.Checked)
                    {
                        game.attendTimes = 0;
                    }
                    else if (this.rd2.Checked)
                    {
                        game.attendTimes = 1;
                    }
                    else if (this.rd3.Checked)
                    {
                        game.attendTimes = 2;
                    }
                    else if (this.rd4.Checked)
                    {
                        game.attendTimes = 3;
                    }
                    game.CreateStep = 3;
                    string msg = "";
                    GameActHelper.Update(game, ref msg);
                    base.Response.Redirect("AddGameAct.aspx?id=" + _gameId + "&step=3");
                }
            }
        }
예제 #2
0
        private void SaveGameStep2()
        {
            string text      = this.txt_grades.Text.Trim();
            string val       = this.txt_uPoint.Text.Trim();
            string text2     = this.txt_gPoint.Text.Trim();
            int    usePoint  = 0;
            int    givePoint = 0;

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请选择适用会员等级!", false);
                return;
            }
            if (!val.bInt(ref usePoint))
            {
                this.ShowMsg("请输入正确的消耗积分!", false);
                return;
            }
            if (string.IsNullOrEmpty(text2))
            {
                text2 = "0";
            }
            if (!text2.bInt(ref givePoint))
            {
                this.ShowMsg("请输入正确的赠送积分!", false);
                return;
            }
            GameActInfo gameActInfo = GameActHelper.Get(AddGameAct._gameId);

            gameActInfo.MemberGrades   = text;
            gameActInfo.usePoint       = usePoint;
            gameActInfo.GivePoint      = givePoint;
            gameActInfo.bOnlyNotWinner = this.onlyChk.Checked;
            if (this.rd1.Checked)
            {
                gameActInfo.attendTimes = 0;
            }
            else if (this.rd2.Checked)
            {
                gameActInfo.attendTimes = 1;
            }
            else if (this.rd3.Checked)
            {
                gameActInfo.attendTimes = 2;
            }
            else if (this.rd4.Checked)
            {
                gameActInfo.attendTimes = 3;
            }
            gameActInfo.CreateStep = 3;
            string text3 = "";

            GameActHelper.Update(gameActInfo, ref text3);
            base.Response.Redirect("AddGameAct.aspx?id=" + AddGameAct._gameId + "&step=3");
        }
예제 #3
0
        private int AddGame()
        {
            string text  = this.txt_name.Text.Trim();
            string text2 = this.txt_decrip.Text.Trim();

            System.DateTime date     = this.calendarStartDate.SelectedDate.Value.Date;
            System.DateTime dateTime = this.calendarEndDate.SelectedDate.Value.Date.AddDays(1.0).AddSeconds(-1.0);
            if (string.IsNullOrEmpty(text) || text.Length > 30)
            {
                this.ShowMsg("请输入正确的游戏名,不超过30个字符!", false);
                return(0);
            }
            if (text2.Length > 600)
            {
                this.ShowMsg("游戏说明不能超过600个字符!", false);
                return(0);
            }
            if (dateTime < date)
            {
                this.ShowMsg("结束时间不能早于开始时间!", false);
                return(0);
            }
            GameActInfo gameActInfo = new GameActInfo();

            if (AddGameAct._gameId != 0)
            {
                gameActInfo = GameActHelper.Get(AddGameAct._gameId);
            }
            gameActInfo.GameName   = text;
            gameActInfo.Decription = text2;
            gameActInfo.BeginDate  = date;
            gameActInfo.EndDate    = dateTime;
            gameActInfo.CreateStep = 2;
            string text3 = "";
            int    result;

            if (AddGameAct._gameId != 0)
            {
                GameActHelper.Update(gameActInfo, ref text3);
                result = gameActInfo.GameId;
            }
            else
            {
                result = GameActHelper.Create(gameActInfo, ref text3);
            }
            return(result);
        }
예제 #4
0
        private int AddGame()
        {
            string   str   = this.txt_name.Text.Trim();
            string   str2  = this.txt_decrip.Text.Trim();
            DateTime date  = this.calendarStartDate.SelectedDate.Value.Date;
            DateTime time2 = this.calendarEndDate.SelectedDate.Value.Date.AddDays(1.0).AddSeconds(-1.0);

            if (string.IsNullOrEmpty(str) || (str.Length > 30))
            {
                this.ShowMsg("请输入正确的游戏名,不超过30个字符!", false);
                return(0);
            }
            if (str2.Length > 600)
            {
                this.ShowMsg("游戏说明不能超过600个字符!", false);
                return(0);
            }
            if (time2 < date)
            {
                this.ShowMsg("结束时间不能早于开始时间!", false);
                return(0);
            }
            GameActInfo game = new GameActInfo();

            if (_gameId != 0)
            {
                game = GameActHelper.Get(_gameId);
            }
            game.GameName   = str;
            game.Decription = str2;
            game.BeginDate  = date;
            game.EndDate    = time2;
            game.CreateStep = 2;
            string msg = "";

            if (_gameId != 0)
            {
                GameActHelper.Update(game, ref msg);
                return(game.GameId);
            }
            return(GameActHelper.Create(game, ref msg));
        }