private void GetDate()
        {
            if (this._gameInfo == null)
            {
                this._gameInfo = new Hidistro.Entities.Promotions.GameInfo();
            }
            try
            {
                this._gameInfo.GameId = int.Parse(this.hfGameId.Value);
            }
            catch (Exception)
            {
                this._gameInfo.GameId   = 0;
                this._gameInfo.GameType = this.GameType;
            }
            this._gameInfo.GameTitle = this.txtGameTitle.Text;
            try
            {
                this._gameInfo.BeginTime = this.dateBeginTime.SelectedDate.Value;
            }
            catch (InvalidOperationException)
            {
                throw new Exception("活动时间期的开始日期不能为空!");
            }
            try
            {
                this._gameInfo.EndTime = this.dateEndTime.SelectedDate.Value;
            }
            catch (InvalidOperationException)
            {
                throw new Exception("活动时间的结束日期不能为空!");
            }
            try
            {
                this._gameInfo.NeedPoint = int.Parse(this.txtNeedPoint.Text);
            }
            catch (FormatException)
            {
                throw new Exception("活动消耗积分格式不对!");
            }
            try
            {
                this._gameInfo.GivePoint = int.Parse(this.txtGivePoint.Text);
            }
            catch (FormatException)
            {
                throw new Exception("活动参与送积分格式不对!");
            }
            try
            {
                this._gameInfo.LimitEveryDay = int.Parse(this.txtLimitEveryDay.Text);
            }
            catch (FormatException)
            {
                throw new Exception("每人最多限次格式不对!");
            }
            try
            {
                this._gameInfo.MaximumDailyLimit = int.Parse(this.txtMaximumDailyLimit.Text);
            }
            catch (FormatException)
            {
                throw new Exception("每人每天限次不对!");
            }
            this._gameInfo.Description            = this.txtDescription.Text.Replace("\n", "<br/>");
            this._gameInfo.OnlyGiveNotPrizeMember = this.cbOnlyGiveNotPrizeMember.Checked;
            this._gameInfo.ApplyMembers           = base.Request["allmember"];
            HiddenField field  = this.memberRange.FindControl("txt_Grades") as HiddenField;
            HiddenField field2 = this.memberRange.FindControl("txt_DefualtGroup") as HiddenField;
            HiddenField field3 = this.memberRange.FindControl("txt_CustomGroup") as HiddenField;

            if (string.IsNullOrEmpty(this._gameInfo.ApplyMembers))
            {
                this._gameInfo.ApplyMembers = field.Value;
            }
            this._gameInfo.CustomGroup  = field3.Value;
            this._gameInfo.DefualtGroup = field2.Value;
            this._gameInfo.MemberCheck  = (base.Request["MemberCheck"] == "on") ? 1 : 0;
            this._gameInfo.GameUrl      = this.txtGameUrl.Text.Trim();
            this._gameInfo.KeyWork      = this.hfKeyWord.Value;
        }
Example #2
0
 private void GetDate()
 {
     if (this._gameInfo == null)
     {
         this._gameInfo = new Hidistro.Entities.Promotions.GameInfo();
     }
     try
     {
         this._gameInfo.GameId = int.Parse(this.hfGameId.Value);
     }
     catch (Exception)
     {
         this._gameInfo.GameId   = 0;
         this._gameInfo.GameType = this.GameType;
     }
     this._gameInfo.GameTitle = this.txtGameTitle.Text;
     try
     {
         this._gameInfo.BeginTime = this.dateBeginTime.SelectedDate.Value;
     }
     catch (InvalidOperationException)
     {
         throw new Exception("活动时间期的开始日期不能为空!");
     }
     try
     {
         this._gameInfo.EndTime = this.dateEndTime.SelectedDate.Value;
     }
     catch (InvalidOperationException)
     {
         throw new Exception("活动时间的结束日期不能为空!");
     }
     try
     {
         this._gameInfo.NeedPoint = int.Parse(this.txtNeedPoint.Text);
     }
     catch (FormatException)
     {
         throw new Exception("活动消耗积分格式不对!");
     }
     try
     {
         this._gameInfo.GivePoint = int.Parse(this.txtGivePoint.Text);
     }
     catch (FormatException)
     {
         throw new Exception("活动参与送积分格式不对!");
     }
     this._gameInfo.Description = this.txtDescription.Text.Replace("\n", "<br/>");
     if (this.rbdPlayType0.Checked)
     {
         this._gameInfo.PlayType = PlayType.一天一次;
     }
     if (this.rbdPlayType1.Checked)
     {
         this._gameInfo.PlayType = PlayType.一次;
     }
     if (this.rbdPlayType2.Checked)
     {
         this._gameInfo.PlayType = PlayType.一天两次;
     }
     if (this.rbdPlayType3.Checked)
     {
         this._gameInfo.PlayType = PlayType.两次;
     }
     this._gameInfo.OnlyGiveNotPrizeMember = this.cbOnlyGiveNotPrizeMember.Checked;
     this._gameInfo.ApplyMembers           = base.Request["allApplyMembers"];
     if (string.IsNullOrEmpty(this._gameInfo.ApplyMembers))
     {
         this._gameInfo.ApplyMembers = base.Request["applyMembers"];
     }
     this._gameInfo.GameUrl = this.txtGameUrl.Text.Trim();
     this._gameInfo.KeyWork = this.hfKeyWord.Value;
 }