<%@ WebHandler Language="C#" Class="TG_GetEggsGift" %> using System; using System.Web; using MainBase.BaseFunciont; using MainBase.APPFunciont; using System.Data.OracleClient; using System.Data; using System.Collections; using System.Text.RegularExpressions; using System.Web.Script.Serialization; /// /// 蛋咖极速版-获取金蛋礼包 /// public class TG_GetEggsGift : APPBase.APPBase { //需校验值,生成keycode的值 protected string CheckList = ""; #region 返回Json 基础参数 /// /// 返回状态 0 正常 其他不正常 /// protected int R_Status = 1; /// /// 返回其他信息 /// protected string R_OtherMsg = ""; /// /// 返回信息 /// protected string R_Msg = ""; /// /// 返回json 信息 /// protected string R_JsonMsg = ""; #endregion protected override void DoMain() { ///* //如果请求校验不过,说明请求存在问题,需要直接退出登录 */ BaseCheck(CheckList); if (!appfunciont.CheckToken(Userid, Token, "Entertain_EggsGift.ashx")) { R_Status = 1000; R_Msg = "登录失效,请重新登录!"; } else { PQ_GetUserInfo(); PQ_EggsGift(); } R_JsonMsg = basefunciont.BackJson(R_Status, R_OtherMsg, R_Msg); Response.Write(R_JsonMsg); } protected void PQ_GetUserInfo() { Utility.Oracle oracle = new Utility.Oracle(); DataSet ds = null; OracleParameter I_USERID, O_OUTCURSOR, O_RESULT, O_MESSAGE; OracleParameter[] Parameters; I_USERID = new OracleParameter("I_USERID", Userid); O_OUTCURSOR = new OracleParameter("O_OUTCURSOR", OracleType.Cursor); O_OUTCURSOR.Direction = ParameterDirection.Output; O_RESULT = new OracleParameter("O_RESULT", OracleType.Number); O_RESULT.Direction = ParameterDirection.Output; O_MESSAGE = new OracleParameter("O_MESSAGE", OracleType.VarChar, 500); O_MESSAGE.Direction = ParameterDirection.Output; Parameters = new OracleParameter[] { I_USERID, O_OUTCURSOR, O_RESULT, O_MESSAGE }; try { ds = oracle.ExecuteDataSet("P_A_GOLDEGGSGIFT.PQ_GetUserINFO", Parameters); R_Status = Convert.ToInt32(O_RESULT.Value); R_Msg = Convert.ToString(O_MESSAGE.Value); if (ds != null && R_Status == 0) { DataTable dTable = ds.Tables[0]; if (dTable.Rows.Count > 0) { R_OtherMsg += "\"goldmoney\":" + dTable.Rows[0]["GOLDMONEY"] + ",\"voucher\":\"" + dTable.Rows[0]["VOUCHER"] + "\",\"newgoldmoney\":\"" + Math.Floor(Convert.ToDouble(dTable.Rows[0]["GOLDMONEY"]) / 120000 * 100) / 100.00 + "\","; } } } catch { R_Status = -9; R_Msg = "系统繁忙,请稍后再试!"; } } /// /// 获取金蛋礼包列表 /// protected void PQ_EggsGift() { Utility.Oracle oracle = new Utility.Oracle(); DataSet ds = null; OracleParameter I_USERID, I_DEVICEID, I_PTYPE, O_OUTCURSOR, O_RESULT, O_MESSAGE; OracleParameter[] Parameters; I_USERID = new OracleParameter("I_USERID", Userid); I_DEVICEID = new OracleParameter("I_DEVICEID", P_Deviceid); I_PTYPE = new OracleParameter("I_PTYPE", P_Ptype); O_OUTCURSOR = new OracleParameter("O_OUTCURSOR", OracleType.Cursor); O_OUTCURSOR.Direction = ParameterDirection.Output; O_RESULT = new OracleParameter("O_RESULT", OracleType.Number); O_RESULT.Direction = ParameterDirection.Output; O_MESSAGE = new OracleParameter("O_MESSAGE", OracleType.VarChar, 500); O_MESSAGE.Direction = ParameterDirection.Output; Parameters = new OracleParameter[] { I_USERID, I_DEVICEID, I_PTYPE, O_OUTCURSOR, O_RESULT, O_MESSAGE }; try { ds = oracle.ExecuteDataSet("p_a_goldeggsgift.pq_tg_goldeggsgift", Parameters); R_Status = Convert.ToInt32(O_RESULT.Value); R_Msg = Convert.ToString(O_MESSAGE.Value); if (ds != null && R_Status == 0) { DataTable dTable = ds.Tables[0]; R_OtherMsg += basefunciont.ConvertDataTableToJson("userinfo", dTable); } } catch { R_Status = -9; R_Msg = "系统繁忙,请稍后再试!"; } } }