Exemplo n.º 1
0
 /// <summary>
 /// 获取GameId的配置参数
 /// </summary>
 /// <param name="GameId">游戏Id</param>
 /// <returns></returns>
 public GameConfig GetGameConfig(int GameId)
 {
     GameConfig gc = null;
     try
     {
         string sql = "select * from gameconfig where gameid=@GameId";
         SqlParameter[] sp = new SqlParameter[]
        {
            new SqlParameter("@GameId",GameId)
        };
         using (SqlDataReader reder = db.GetReader(sql, sp))
         {
             while (reder.Read())
             {
                 gc = new GameConfig((int)reder["id"], (int)reder["gameid"], reder["logincom"].ToString(), reder["paycom"].ToString(),
                     reder["existcom"].ToString(), reder["loginticket"].ToString(), reder["payticket"].ToString(),
                     reder["selectticket"].ToString(), reder["fcmticket"].ToString(), reder["agentid"].ToString());
             }
         }
     }
     catch (SqlException ex)
     {
         throw new Exception("数据库异常!原因:" + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("未知异常!原因:" + ex.Message);
     }
     return gc;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加游戏配置
 /// </summary>
 /// <param name="GameId">游戏Id</param>
 /// <returns>返回是否添加成功</returns>
 public Boolean AddGameConfig(GameConfig gc)
 {
     try
     {
         string sql = "insert into GameConfig (logincom,paycom,existcom,loginticket,payticket,selectticket,fcmticket,agentid,gameid) values(@LoginCom,@PayCom,@ExistCom,@LoginTicket,@PayTicket,@SelectTicket,@FcmTicket,@AgentId,@GameId)";
         SqlParameter[] sp = new SqlParameter[]
         {
             new SqlParameter("@LoginCom",gc.LoginCom),
             new SqlParameter("@PayCom",gc.PayCom),
             new SqlParameter("@ExistCom",gc.ExistCom),
             new SqlParameter("@LoginTicket",gc.LoginTicket),
             new SqlParameter("@PayTicket",gc.PayTicket),
             new SqlParameter("@SelectTicket",gc.SelectTicket),
             new SqlParameter("@FcmTicket",gc.FcmTicket),
             new SqlParameter("@AgentId",gc.AgentId),
             new SqlParameter("@GameId",gc.GameId)
         };
         return db.ExecuteNonQuery(sql, sp);
     }
     catch (SqlException ex)
     {
         throw new Exception("数据库异常!原因:" + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("未知异常!原因:" + ex.Message);
     }
 }
Exemplo n.º 3
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 初始化接口参数
        /// </summary>
        public Game_Sjsg()
        {
            game = games.GetGame("sjsg");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 4
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Dpqk()
        {
            game = games.GetGame("dpqk");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 5
0
 /// <summary>
 /// 更新游戏配置
 /// </summary>
 /// <param name="GameId">游戏Id</param>
 /// <returns>返回是否更新成功</returns>
 public Boolean UpdateGameConfig(GameConfig gc)
 {
     return gcs.UpdateGameConfig(gc);
 }
Exemplo n.º 6
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Mxqy()
        {
            game = games.GetGame("mxqy");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 7
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Chcq()
        {
            game = games.GetGame("chcq");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 8
0
        public ActionResult EditGame(int GameId)
        {
            if (Session[Keys.SESSION_ADMIN_INFO] == null)
            {
                return RedirectToAction("Login", "Admin");
            }
            else
            {
                Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
                if (rcm.GetRoleCompetence(master.RoleId, 11231))
                {
                    Games g = new Games();
                    g = gm.GetGame(GameId);
                    ViewData["GameId"] = GameId;
                    ViewData["GameNo"] = g.GameNo;
                    ViewData["GameName"] = g.Name;
                    ViewData["tjqf"] = g.tjqf;
                    string[] Str = g.GameProperty.Split('|');
                    ViewData["GameLx"] = Str[0];
                    ViewData["GameTz"] = Str[1];
                    ViewData["GameCzlx"] = Str[2];
                    ViewData["GameHm"] = Str[3];
                    ViewData["GameSfms"] = Str[4];
                    ViewData["IsRed"] = g.Is_Red == 1 ? true : false;
                    ViewData["IsHot"] = g.Is_Hot == 1 ? true : false;
                    ViewData["IsLock"] = g.Is_Lock == 1 ? true : false;
                    ViewData["SortId"] = g.Sort_Id;
                    ViewData["GameMoneyScale"] = g.GameMoneyScale;
                    ViewData["GameMoneyName"] = g.GameMoneyName;
                    ViewData["GameCom"] = g.GameCom;
                    ViewData["GameBBS"] = g.GameBBS;
                    ViewData["NewHand"] = g.NewHand;
                    ViewData["Pic1"] = g.Pic1;
                    ViewData["Pic2"] = g.Pic2;
                    ViewData["Pic3"] = g.Pic3;
                    ViewData["Pic4"] = g.Pic4;
                    ViewData["GameListImg"] = g.GameListImg;
                    ViewData["IndexTjImg"] = g.IndexTjImg;
                    ViewData["IndexHbImg"] = g.IndexHbImg;
                    ViewData["IndexHdImg"] = g.IndexHdImg;
                    ViewData["game_url_hd"] = g.game_url_hd;
                    ViewData["NewHand"] = g.NewHand;
                    ViewData["game_url_xzq"] = g.game_url_xzq;
                    ViewData["GameDesc"] = g.GameDesc;

                    GameConfig gc = new GameConfig();
                    gc = gcm.GetGameConfig(GameId);
                    if (gc != null)
                    {
                        ViewData["AgentId"] = gc.AgentId;
                        ViewData["LoginCom"] = gc.LoginCom;
                        ViewData["PayCom"] = gc.PayCom;
                        ViewData["ExistCom"] = gc.ExistCom;
                        ViewData["LoginTicket"] = gc.LoginTicket;
                        ViewData["PayTicket"] = gc.PayTicket;
                        ViewData["SelectTicket"] = gc.SelectTicket;
                        ViewData["FcmTicket"] = gc.FcmTicket;
                    }
                    ViewData["Function"] = "UpdateData('/Game/UpdateGame')";
                    return View("Game");
                }
                else
                {
                    return RedirectToAction("Login", "Admin");
                }
            }
        }
Exemplo n.º 9
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化参数
        /// </summary>
        public Game_Qh()
        {
            game = games.GetGame("qh");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 10
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Djj()
        {
            game = games.GetGame("djj");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 11
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Sbcs()
        {
            game = games.GetGame("sbcs");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 12
0
 /// <summary>
 /// 更新游戏配置
 /// </summary>
 /// <param name="GameId">游戏Id</param>
 /// <returns>返回是否更新成功</returns>
 public Boolean UpdateGameConfig(GameConfig gc)
 {
     try
     {
         string sql = "update GameConfig set logincom=@LoginCom,paycom=@PayCom,existcom=@ExistCom,loginticket=@LoginTicket," +
                     "payticket=@PayTicket,selectticket=@SelectTicket,fcmticket=@FcmTicket,agentid=@AgentId"
                      + " where gameid=@GameId ";
         SqlParameter[] sp = new SqlParameter[]
         {
             new SqlParameter("@LoginCom",gc.LoginCom),
             new SqlParameter("@PayCom",gc.PayCom),
             new SqlParameter("@ExistCom",gc.ExistCom),
             new SqlParameter("@LoginTicket",gc.LoginTicket),
             new SqlParameter("@PayTicket",gc.PayTicket),
             new SqlParameter("@SelectTicket",gc.SelectTicket),
             new SqlParameter("@FcmTicket",gc.FcmTicket),
             new SqlParameter("@AgentId",gc.AgentId),
             new SqlParameter("@GameId",gc.GameId)
         };
         return db.ExecuteNonQuery(sql, sp);
     }
     catch (SqlException ex)
     {
         throw new Exception("数据库异常!原因:" + ex.Message);
     }
     catch (Exception ex)
     {
         throw new Exception("未知异常!原因:" + ex.Message);
     }
 }
Exemplo n.º 13
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 初始化参数
        /// </summary>
        public Game_Nslm()
        {
            game = games.GetGame("nslm");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 14
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Jlc()
        {
            game = games.GetGame("Jlc");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 15
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        public Game_Jhwj()
        {
            game = games.GetGame("jhwj");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 16
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 参数实例化
        /// </summary>
        public Game_Gjqx()
        {
            game = games.GetGame("gjqx");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 17
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Xyb()
        {
            game = games.GetGame("xyb");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 18
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 初始化接口参数
        /// </summary>
        public Game_Rxhzw()
        {
            game = games.GetGame("rxhzw");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 19
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 初始化接口参数
        /// </summary>
        public Game_Dxz()
        {
            game = games.GetGame("dxz");                                     //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 20
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Tgzt()
        {
            game = games.GetGame("tgzt");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 21
0
        public Boolean UpdateGame()
        {
            if (Session[Keys.SESSION_ADMIN_INFO] == null)
            {
                return false;
            }
            else
            {
                Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
                if (rcm.GetRoleCompetence(master.RoleId, 11231))
                {
                    Games g = new Games();
                    g.Id = int.Parse(Request["GameId"]);
                    g.GameNo = Request["GameNo"];
                    g.Name = Request["GameName"];
                    g.tjqf = int.Parse(Request["tjqf"]);
                    g.GameProperty = Request["GameLx"] + "|" + Request["GameTz"] + "|" + Request["GameCzlx"] + "|" + Request["GameHm"] + "|" + Request["GameSfms"];
                    g.Is_Red = Request["IsRed"] == "on" ? 1 : 0;
                    g.Is_Hot = Request["IsHot"] == "on" ? 1 : 0;
                    g.Is_Lock = Request["IsLock"] == "on" ? 1 : 0;
                    g.Sort_Id = int.Parse(Request["SortId"]);
                    g.GameMoneyScale = int.Parse(Request["GameMoneyScale"]);
                    g.GameMoneyName = Request["GameMoneyName"];
                    g.GameCom = Request["GameCom"];
                    g.GameBBS = Request["GameBBS"];
                    g.NewHand = Request["NewHand"];
                    g.Pic1 = Request["Pic1"];
                    g.Pic2 = Request["Pic2"];
                    g.Pic3 = Request["Pic3"];
                    g.Pic4 = Request["Pic4"];
                    g.GameListImg = Request["GameListImg"];
                    g.IndexTjImg = Request["IndexTjImg"];
                    g.IndexHbImg = Request["IndexHbImg"];
                    g.IndexHdImg = Request["IndexHdImg"];
                    g.game_url_hd = Request["game_url_hd"];
                    g.game_url_xzq = Request["game_url_xzq"];
                    g.GameDesc = Request["GameDesc"];

                    GameConfig gc = new GameConfig();
                    gc.AgentId = Request["AgentId"];
                    gc.LoginCom = Request["LoginCom"];
                    gc.PayCom = Request["PayCom"];
                    gc.ExistCom = Request["ExistCom"];
                    gc.LoginTicket = Request["LoginTicket"];
                    gc.PayTicket = Request["PayTicket"];
                    gc.SelectTicket = Request["SelectTicket"];
                    gc.FcmTicket = Request["FcmTicket"];
                    gc.GameId = int.Parse(Request["GameId"]);
                    if (gcm.GetGameConfig(g.Id) == null)
                    {
                        return (gcm.AddGameConfig(gc) && gm.UpdateGame(g));
                    }
                    else
                    {
                        return (gcm.UpdateGameConfig(gc) && gm.UpdateGame(g));
                    }
                }
                else
                {
                    return false;
                }
            }
        }
Exemplo n.º 22
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        public Game_Yxy()
        {
            game = games.GetGame("yxy");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 23
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Ftz()
        {
            game = games.GetGame("ftz");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 24
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Txj()
        {
            game = games.GetGame("txj");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 25
0
        string tstamp; //定义时间戳

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 实例化接口参数
        /// </summary>
        public Game_Xxas()
        {
            game = games.GetGame("xxas");                                   //获取游戏
            gc = gcs.GetGameConfig(game.Id);                                //获取游戏参数
        }
Exemplo n.º 26
0
 /// <summary>
 /// 添加游戏配置
 /// </summary>
 /// <param name="GameId">游戏Id</param>
 /// <returns>返回是否添加成功</returns>
 public Boolean AddGameConfig(GameConfig gc)
 {
     return gcs.AddGameConfig(gc);
 }