public ActionResult GameLog(Dictionary <string, string> queryvalues) { int _id = queryvalues.ContainsKey("UserID") ? string.IsNullOrWhiteSpace(queryvalues["UserID"]) ? 0 : Convert.ToInt32(queryvalues["UserID"]) : 0; ViewData["UserId"] = _id; int _page = queryvalues.ContainsKey("page") ? Convert.ToInt32(queryvalues["page"]) : 1; int _seachtype = queryvalues.ContainsKey("seachtype") ? Convert.ToInt32(queryvalues["seachtype"]) : 0; string _StartDate = queryvalues.ContainsKey("StartDate") ? queryvalues["StartDate"] : DateTime.Now.ToString("yyyy-MM-dd 00:00:00"); string _ExpirationDate = queryvalues.ContainsKey("ExpirationDate") ? queryvalues["ExpirationDate"] : DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 00:00:00"); string _SearchExt = queryvalues.ContainsKey("SearchExt") ? queryvalues["SearchExt"] : ""; string _Gametype = queryvalues.ContainsKey("Gametype") ? queryvalues["Gametype"] : "0"; object _data = queryvalues.ContainsKey("Data") ? string.IsNullOrWhiteSpace(queryvalues["Data"]) ? 0 : Convert.ToInt64(queryvalues["Data"]) : 0; int _roundID = queryvalues.ContainsKey("RoundID") ? string.IsNullOrWhiteSpace(queryvalues["RoundID"]) ? 0 : Convert.ToInt32(queryvalues["RoundID"]) : 0; int _roundID2 = queryvalues.ContainsKey("RoundID2") ? string.IsNullOrWhiteSpace(queryvalues["RoundID2"]) ? 0 : Convert.ToInt32(queryvalues["RoundID2"]) : 0; int _RoundID3 = queryvalues.ContainsKey("RoundID3") ? string.IsNullOrWhiteSpace(queryvalues["RoundID3"]) ? 0 : Convert.ToInt32(queryvalues["RoundID3"]) : 0; GameRecordView grv = new GameRecordView { Gametype = Convert.ToInt32(_Gametype), Data = _data, UserID = _id, SearchExt = _SearchExt, StartDate = _StartDate, ExpirationDate = _ExpirationDate, Page = _page, SeachType = (seachType)_seachtype, RoundID = _roundID, RoundID2 = _roundID2 }; string pageList = ""; switch (_Gametype) { case "1": //德州扑克 grv.DataList = MemberCenterBLL.GetListByPageForTexas(grv); pageList = "TexasGameLog_PageList"; break; case "2": //中发白 grv.DataList = MemberCenterBLL.GetListByPageForScale(grv); pageList = "ScaleGameLog_PageList"; break; case "3": //十二生肖 grv.DataList = GameDataBLL.GetListByPageForZodiac(grv); pageList = "ZodiacGameLog_PageList"; break; case "5": //奔驰宝马 grv.DataList = GameDataBLL.GetListByPageForCar(grv); pageList = "CarGameLog_PageList"; break; case "6": //百人德州 grv.DataList = GameDataBLL.GetListByPageForTexPro(grv); pageList = "TexProGameLog_PageList"; break; case "9": //百家乐 ShuihuGameRecord BaccaratGameRecord grv.DataList = GameDataBLL.GetListByRoundForBaiJiaLe(grv); pageList = "BaijialeGameLog_PageList"; break; } grv.PageList = pageList; if (Request.IsAjaxRequest()) { return(PartialView(pageList, grv.DataList)); } return(View(grv)); }
private static void TexasGameLog(string startTime, string endTime) { //查询开始时间 GameRecordView grv = new GameRecordView { Gametype = 1, Data = 0, UserID = 0, SearchExt = "Analyse_Texas", StartDate = startTime.ToString(), ExpirationDate = endTime.ToString(), Page = 1, SeachType = (seachType)0 }; IEnumerable <TexasGameRecord> data = GameDataBLL.GetListForTexas(grv); List <CommonGameData> resdata = new List <CommonGameData>(); foreach (TexasGameRecord m in data) { var userList = m.UserData.Split('_').ToList(); userList.RemoveAt(userList.Count - 1); var j = userList.Count; for (int i = 0; i < j; i++) { CommonGameData com = new CommonGameData(); var userData = userList[i].Split(',').ToList(); int tem = 0; DateTime t = m.CreateTime; com.CountDate = new DateTime(t.Year, t.Month, t.Day); //int 房间ID = m.RoomID; //decimal 牌局号 = m.Round; string 盲注 = m.BaseScore; string[] s = m.BaseScore.Split('/'); int v = int.Parse(s[0]); tem = v; //int 服务费 = m.Service; var wj = userData[2]; com.UserID = int.Parse(wj); decimal d = Convert.ToDecimal(userData[4]); if (tem <= 100) { com.Initial = d; com.InitialCount = 1; } else if (tem >= 5000) { com.HighRank = d; com.HighRankCount = 1; } else { com.Secondary = d; com.SecondaryCount = 1; } com.Key = com.UserID + com.CountDate.ToString(); resdata.Add(com); } } IEnumerable <IGrouping <string, CommonGameData> > query = resdata.GroupBy(m => m.Key); List <CommonGameData> sumData = new List <CommonGameData>(); foreach (IGrouping <string, CommonGameData> info in query) { List <CommonGameData> sl = info.ToList <CommonGameData>();//分组后的集合 CommonGameData co = new CommonGameData(); co.UserID = sl[0].UserID; co.CountDate = sl[0].CountDate; co.InitialL = sl.Where(m => m.Initial < 0).Sum(m => m.Initial); co.InitialW = sl.Where(m => m.Initial > 0).Sum(m => m.Initial); co.InitialCount = sl.Sum(m => m.InitialCount); co.HighRankL = sl.Where(m => m.HighRank < 0).Sum(m => m.HighRank); co.HighRankW = sl.Where(m => m.HighRank > 0).Sum(m => m.HighRank); co.HighRankCount = sl.Sum(m => m.HighRankCount); co.SecondaryL = sl.Where(m => m.Secondary < 0).Sum(m => m.Secondary); co.SecondaryW = sl.Where(m => m.Secondary > 0).Sum(m => m.Secondary); co.SecondaryCount = sl.Sum(m => m.SecondaryCount); sumData.Add(co); } foreach (CommonGameData comdata in sumData) { string sql = @" replace into Clearing_Game(UserID ,CountDate ,Texas_LCount ,Texas_LAward_L ,Texas_LAward_W ,Texas_MCount ,Texas_MAward_L ,Texas_MAward_W ,Texas_HCount ,Texas_HAward_L ,Texas_HAward_W) select " + comdata.UserID + " ,'" + comdata.CountDate + "' ,ifnull(b.Texas_LCount,0) + " + comdata.InitialCount + " ,ifnull(b.Texas_LAward_L,0) + " + comdata.InitialL + " ,ifnull(b.Texas_LAward_W,0) + " + comdata.InitialW + @" ,ifnull(b.Texas_MCount,0) + " + comdata.SecondaryCount + @" ,ifnull(b.Texas_MAward_L,0) + " + comdata.SecondaryL + @" ,ifnull(b.Texas_MAward_W,0) + " + comdata.SecondaryW + @" ,ifnull(b.Texas_HCount,0) + " + comdata.HighRankCount + @" ,ifnull(b.Texas_HAward_L,0) + " + comdata.HighRankL + @" ,ifnull(b.Texas_HAward_W,0) + " + comdata.HighRankW + @" from (select " + comdata.UserID + @" userid ) a left join ( select * from Clearing_Game where UserID = " + comdata.UserID + @" and CountDate = '" + comdata.CountDate + @"') b on 1 = 1; "; GameDataBLL.Add(sql); } GameDataBLL.UpdateBeginTimeForGame(grv); //修改时间 }
public ActionResult RegisterSwitch(Dictionary <string, string> queryvalues) { int res = GameDataBLL.GetSwitchIsOpen(2); return(Json(new { result = res }, JsonRequestBehavior.AllowGet)); }