Ejemplo n.º 1
0
        /// <summary>
        /// Excel数据导入数据库
        /// </summary>
        /// <param name="path"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static bool ExcelToData(string path, string filename, DateTime uptime, ref int isexistcount)
        {
            DataTable excelData = InputExcel(path, filename);

            foreach (DataRow row in excelData.Rows)
            {
                Model.PTgame info = new Model.PTgame();
                info.Login         = row[0].ToString().ToLower();
                info.Gamecode      = "801";
                info.Gameid        = "801";
                info.Status        = 1;
                info.Startdate     = uptime;
                info.Enddate       = uptime;
                info.Hold          = -Convert.ToDecimal(row[5]);
                info.Bet_amount    = Convert.ToDecimal(row[3]);
                info.Payout_amount = Convert.ToDecimal(row[4]);

                if (info.Login.IndexOf("total cny") == -1)
                {
                    //判断数据是否重复插入
                    if (!DAL.PTgame.IsExistData(info.Login, uptime, info.Hold, info.Bet_amount))
                    {
                        //插入数据
                        DAL.PTgame.InsertData(info);
                    }
                    else
                    {
                        isexistcount++;
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        public static bool UpdateGameinfoReport_ea(Model.PTgame info)
        {
            string sql = "update gameinforeport_ea set hold=hold+@hold,handle=handle+@handle,bet_amount=bet_amount+@bet_amount,payout_amount=payout_amount+@payout_amount where login=@login and enddate=@enddate";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("@login", info.Login),
                new MySqlParameter("@enddate", info.Enddate),
                new MySqlParameter("@hold", info.Hold),
                new MySqlParameter("@handle", info.Handle),
                new MySqlParameter("@bet_amount", info.Bet_amount),
                new MySqlParameter("@payout_amount", info.Payout_amount)
            };
            return(MySqlHelper.ExecuteNonQuery(sql, param) > 0);
        }
Ejemplo n.º 3
0
        public static bool AddGameinfoReport_ea(Model.PTgame info)
        {
            string sql = "insert into gameinforeport_ea(login,status,enddate,hold,handle,bet_amount,payout_amount) values(@login,@status,@enddate,@hold,@handle,@bet_amount,@payout_amount)";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("@login", info.Login),
                new MySqlParameter("@status", "1"),
                new MySqlParameter("@enddate", info.Enddate),
                new MySqlParameter("@hold", info.Hold),
                new MySqlParameter("@handle", info.Handle),
                new MySqlParameter("@bet_amount", info.Bet_amount),
                new MySqlParameter("@payout_amount", info.Payout_amount)
            };
            return(MySqlHelper.ExecuteNonQuery(sql, param) > 0);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="gameinfo"></param>
        /// <returns></returns>
        public static bool InsertData(Model.PTgame gameinfo)
        {
            string sql = "insert into pt_gameinfo(gameid,login,gamecode,status,startdate,enddate,hold,handle,bet_amount,payout_amount) values(@gameid,@login,@gamecode,@status,@startdate,@enddate,@hold,@handle,@bet_amount,@payout_amount)";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("@gameid", gameinfo.Gameid),
                new MySqlParameter("@login", gameinfo.Login),
                new MySqlParameter("@gamecode", gameinfo.Gamecode),
                new MySqlParameter("@status", gameinfo.Status),
                new MySqlParameter("@startdate", gameinfo.Startdate),
                new MySqlParameter("@enddate", gameinfo.Enddate),
                new MySqlParameter("@hold", gameinfo.Hold),
                new MySqlParameter("@handle", gameinfo.Handle),
                new MySqlParameter("@bet_amount", gameinfo.Bet_amount),
                new MySqlParameter("@payout_amount", gameinfo.Payout_amount)
            };
            return(MySqlHelper.ExecuteNonQuery(sql, param) > 0);
        }