Example #1
0
        /// <summary>
        /// 获取用户帐号
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        protected string GetAccounts(int userID)
        {
            AccountsInfo accounts = aideAccountsFacade.GetAccountInfoByUserID(userID);

            if (accounts == null)
            {
                return("");
            }
            return(TextUtility.CutString(accounts.Accounts, 0, 10));
        }
Example #2
0
        /// <summary>
        /// 获得昵称
        /// </summary>
        /// <param name="userID">用户UserID</param>
        /// <returns></returns>
        public string GetNickNameByUserID(int userID)
        {
            AccountsInfo model = aideAccountsFacade.GetAccountInfoByUserID(userID);

            if (model != null)
            {
                return(TextUtility.CutString(model.NickName, 0, 10));
            }
            else
            {
                return("");
            }
        }
Example #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            //验证任务类型
            int taskType = -1;

            taskType = Convert.ToInt32(ddlTaskType.SelectedValue);
            if (taskType == -1)
            {
                ShowError("请选择任务类型");
                return;
            }

            //验证可领取任务玩家类型
            int userType = 0;

            for (int i = 1; i <= cblUserType.Items.Count; i++)
            {
                if (cblUserType.Items[i - 1].Selected)
                {
                    userType = userType | i;
                }
            }
            if (userType == 0)
            {
                ShowError("请选择可领取任务玩家类型");
                return;
            }

            //验证游戏
            int kindID = -1;

            kindID = Convert.ToInt32(ddlGameKind.SelectedValue);
            if (kindID == -1)
            {
                ShowError("请选择任务所属游戏");
                return;
            }

            //验证局数
            int innings = CtrlHelper.GetInt(txtInnings, 0);

            if (innings == 0)
            {
                ShowError("请输入比赛局数");
                return;
            }

            //验证比赛
            int matchID = 0;

            //if( taskType == (int)EnumerationList.TaskType.比赛任务 )
            //{
            //    matchID = Convert.ToInt32( ddlMatchID.SelectedValue );
            //    if( matchID == 0 )
            //    {
            //        ShowError( "请选择任务所属比赛" );
            //        return;
            //    }
            //}

            Game.Entity.Platform.TaskInfo taskInfo = new Game.Entity.Platform.TaskInfo();
            if (IntParam > 0)
            {
                AuthUserOperationPermission(Permission.Edit);
                taskInfo = FacadeManage.aidePlatformFacade.GetTaskInfoByID(IntParam);
            }
            else
            {
                AuthUserOperationPermission(Permission.Add);
                taskInfo.InputDate = DateTime.Now;
            }

            taskInfo.TaskName           = CtrlHelper.GetText(txtTaskName);
            taskInfo.TaskType           = taskType;
            taskInfo.UserType           = Convert.ToByte(userType);
            taskInfo.KindID             = kindID;
            taskInfo.StandardAwardGold  = CtrlHelper.GetInt(txtStandardAwardGold, 0);
            taskInfo.StandardAwardMedal = CtrlHelper.GetInt(txtStandardAwardMedal, 0);
            taskInfo.MemberAwardGold    = CtrlHelper.GetInt(txtMemberAwardGold, 0);
            taskInfo.MemberAwardMedal   = CtrlHelper.GetInt(txtMemberAwardMedal, 0);
            taskInfo.TimeLimit          = CtrlHelper.GetInt(txtTimeLimit, 0);
            taskInfo.TaskDescription    = TextUtility.CutString(CtrlHelper.GetText(txtTaskDescription), 0, 500);
            taskInfo.Innings            = innings;
            taskInfo.MatchID            = matchID;

            bool isSuccess;

            if (IntParam > 0)
            {
                isSuccess = FacadeManage.aidePlatformFacade.UpdateTaskInfo(taskInfo);
            }
            else
            {
                isSuccess = FacadeManage.aidePlatformFacade.InsertTaskInfo(taskInfo);
            }

            if (isSuccess)
            {
                ShowInfo("保存任务信息成功", "TaskList.aspx", 1000);
            }
            else
            {
                ShowError("保存任务信息失败");
            }
        }