コード例 #1
0
ファイル: api.ashx.cs プロジェクト: ZhouWenhua907/Lottery
        /// <summary>
        /// 回复咨询信息
        /// </summary>
        /// <returns></returns>
        private Hashtable UpdateQues(HttpContext context)
        {
            Hashtable htRet = new Hashtable();

            try
            {
                FastReadServer.admin.UserInfo user = (FastReadServer.admin.UserInfo)context.Session[FastReadServer.admin.CConst.CSession.C_UserInfoKey];
                if (user == null || user.UserId == "")
                {
                    htRet["msg"] = "用户信息超时,请重新登录!";
                    htRet["ok"]  = false;
                    return(htRet);
                }

                string sQuesId    = CConvert.ToString(context.Request["qid"]);
                string sQuesTitle = CConvert.ToString(context.Request["title"]);
                string sQuesOpt1  = CConvert.ToString(context.Request["op1"]);
                string sQuesOpt2  = CConvert.ToString(context.Request["op2"]);
                string sQuesOpt3  = CConvert.ToString(context.Request["op3"]);
                string sQuesOpt4  = CConvert.ToString(context.Request["op4"]);
                string sQuesRight = CConvert.ToString(context.Request["right"]);

                DBIndex dbm  = new DBIndex();
                int     iRet = dbm.UpdateQuestion(sQuesId, sQuesTitle, sQuesOpt1, sQuesOpt2, sQuesOpt3, sQuesOpt4, sQuesRight);
                if (iRet <= 0)
                {
                    htRet["msg"] = "服务器异常,请联系管理员!";
                    htRet["ok"]  = false;
                }
                else
                {
                    htRet["ok"] = true;
                }
            }
            catch (Exception ex)
            {
                htRet["ok"]  = false;
                htRet["msg"] = "处理失败!" + ex.Message;
            }
            return(htRet);
        }