public void GetUserLoginListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("Log_UserLogin"); string sql0 = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,*", "Log_UserLogin", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSONNOHTML(dataTable, 0, "recordcount", "table", true) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public void GetNewsListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("Sys_News"); string sql0 = SqlHelp.GetSql0("row_number() over (order by STime desc) as rowid,Convert(varchar(10),STime,120) as shortTime,substring(title,0,18)+'...' as shortTitle,Substring(Convert(varchar(10),STime,120),6,2) as tmonth,Substring(Convert(varchar(10),STime,120),9,2) as tday,*", "Sys_News", "STime", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSONNOHTML(dataTable, 0, "recordcount", "table", true) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public void GetUserListJSON(string CurUserId, int _thispage, int _pagesize, string _wherestr1, string orderby, string order, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("V_User"); string sql0 = SqlHelp.GetSql0(CurUserId + " as CurUserId,*", "V_User", order, _pagesize, _thispage, orderby, _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public void GetTranAccListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("N_UserChargeLog"); string sql0 = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,*,dbo.f_GetUserName(UserId) as UserName,dbo.f_GetUserName(ToUserId) as ToUserName", "N_UserChargeLog", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public SiteModel CreateEntity() { SiteModel siteModel = new SiteModel(); using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT * FROM [Sys_Info] where Id=1"; DataTable dataTable = dbOperHandler.GetDataTable(); DataRow dataRow = dataTable.Rows[0]; siteModel.Name = "时时彩"; siteModel.Dir = App.Path; siteModel.WebIsOpen = Convert.ToInt32(dataRow["WebIsOpen"].ToString()); siteModel.WebCloseSeason = dataRow["WebCloseSeason"].ToString(); siteModel.ZHIsOpen = Convert.ToInt32(dataRow["ZHIsOpen"].ToString()); siteModel.RegIsOpen = Convert.ToInt32(dataRow["RegIsOpen"].ToString()); siteModel.BetIsOpen = Convert.ToInt32(dataRow["BetIsOpen"].ToString()); siteModel.CSUrl = dataRow["CSUrl"].ToString(); siteModel.SignMinTotal = Convert.ToInt32(dataRow["SignMinTotal"].ToString()); siteModel.SignMaxTotal = Convert.ToInt32(dataRow["SignMaxTotal"].ToString()); siteModel.SignNum = Convert.ToInt32(dataRow["SignNum"].ToString()); siteModel.WarnTotal = Convert.ToDecimal(dataRow["WarnTotal"].ToString()); siteModel.MaxBet = Convert.ToDecimal(dataRow["MaxBet"].ToString()); siteModel.MaxWin = Convert.ToDecimal(dataRow["MaxWin"].ToString()); siteModel.MaxWinFK = Convert.ToDecimal(dataRow["MaxWinFK"].ToString()); siteModel.MaxLevel = Convert.ToDecimal(dataRow["MaxLevel"].ToString()); siteModel.MinCharge = Convert.ToDecimal(dataRow["MinCharge"].ToString()); siteModel.Points = Convert.ToInt32(dataRow["Points"].ToString()); siteModel.PriceOutCheck = Convert.ToDecimal(dataRow["PriceOutCheck"].ToString()); siteModel.PriceOut = Convert.ToDecimal(dataRow["PriceOut"].ToString()); siteModel.PriceOut2 = Convert.ToDecimal(dataRow["PriceOut2"].ToString()); siteModel.PriceNum = Convert.ToInt32(dataRow["PriceNum"].ToString()); siteModel.PriceOutPerson = Convert.ToInt32(dataRow["PriceOutPerson"].ToString()); siteModel.AutoLottery = Convert.ToInt32(dataRow["AutoLottery"].ToString()); siteModel.ProfitModel = Convert.ToInt32(dataRow["ProfitModel"].ToString()); siteModel.ProfitMargin = Convert.ToInt32(dataRow["ProfitMargin"].ToString()); siteModel.AutoRanking = Convert.ToInt32(dataRow["AutoRanking"].ToString()); siteModel.PriceTime1 = dataRow["PriceTime1"].ToString(); siteModel.PriceTime2 = dataRow["PriceTime2"].ToString(); siteModel.BankTime = Convert.ToDecimal(dataRow["BankTime"].ToString()); siteModel.ClientVersion = dataRow["ClientVersion"].ToString(); siteModel.UpdateTime = Convert.ToDateTime(dataRow["UpdateTime"].ToString()); siteModel.NewsUpdateTime = Convert.ToDateTime(dataRow["NewsUpdateTime"].ToString()); siteModel.Version = dataRow["ClientVersion"].ToString(); } return(siteModel); }
public void Test(string _userid) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = string.Format("select UserId,isnull(sum(inmoney),0) money from Act_ActiveRecord where CONVERT(varchar(10), STime, 120) = '{0}' group by UserId", (object)_userid); DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count <= 0) { return; } for (int index = 0; index < dataTable.Rows.Count; ++index) { dbOperHandler.Reset(); } } }
public bool UpdateAllBetNumber(int type) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 1 Type,Title,Number from Sys_LotteryData where Type=" + (object)type + " order by Title desc"; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { for (int index = 0; index < dataTable.Rows.Count; ++index) { LotteryCheck.AdminRunOper(Convert.ToInt32(dataTable.Rows[index]["Type"].ToString()), dataTable.Rows[index]["Title"].ToString(), dataTable.Rows[index]["Number"].ToString()); } } } return(true); }
public int GetTsIssueNumToPet(int lotteryId, int curIssueNum) { int num = 0; using (DbOperHandler dbOperHandler = new ComData().Doh()) { switch (lotteryId) { case 1010: case 3004: dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable1 = dbOperHandler.GetDataTable(); num = curIssueNum - 1658122 - Convert.ToInt32(dataTable1.Rows[0]["d"]) * 880; break; case 1012: dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-23',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable2 = dbOperHandler.GetDataTable(); num = curIssueNum - 2588087 - Convert.ToInt32(dataTable2.Rows[0]["d"]) * 660; break; case 1013: dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2017-01-01',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable3 = dbOperHandler.GetDataTable(); num = curIssueNum - 106000000 - Convert.ToInt32(dataTable3.Rows[0]["d"]) * 203; break; case 1017: dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable4 = dbOperHandler.GetDataTable(); num = curIssueNum - 1658117 - Convert.ToInt32(dataTable4.Rows[0]["d"]) * 880; break; case 4001: dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2017-01-01',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable5 = dbOperHandler.GetDataTable(); num = curIssueNum - 106000000 - Convert.ToInt32(dataTable5.Rows[0]["d"]) * 203; dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2017-02-10',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable6 = dbOperHandler.GetDataTable(); num = DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00") && DateTime.Now <Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:07:01") || DateTime.Now> Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 23:57:01") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59") ? curIssueNum - 601048 - (Convert.ToInt32(dataTable6.Rows[0]["d"]) - 1) * 179 : curIssueNum - 601048 - Convert.ToInt32(dataTable6.Rows[0]["d"]) * 179; break; } } return(num); }
public void AutoActive2Money() { if (!new ActiveAutoDAL().Exists("Active2")) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select Id from N_User with(nolock) where IsDel=0"; DataTable dataTable = dbOperHandler.GetDataTable(); for (int i = 0; i < dataTable.Rows.Count; i++) { dbOperHandler.ExecuteProcAuto("proc_AutoChargeMoney", dataTable.Rows[i]["Id"].ToString()); } } this.Add("Active2"); new LogSysDAL().Save("系统自动", "自动派发三级充值佣金"); } }
public void AutoActive1ToMoney() { if (new ActiveAutoDAL().Exists("Active1")) { return; } using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select Id,UserCode from N_User with(nolock) where IsDel=0 and len(UserCode)=16"; DataTable dataTable = dbOperHandler.GetDataTable(); for (int index = 0; index < dataTable.Rows.Count; ++index) { dbOperHandler.ExecuteProcAuto("proc_AutoConsumeMoney", dataTable.Rows[index]["Id"].ToString()); } } this.Add("Active1"); new LogSysDAL().Save("系统自动", "自动派发三级消费佣金"); }
public void GetListJSON(ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 100 UserId,Msg from N_UserMessage with(nolock) where IsRead=0 order by Id desc"; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}"; } else { _jsonstr = ""; } dataTable.Clear(); dataTable.Dispose(); } }
public void Create() { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT * FROM Sys_PlaySmallType where IsOpen=0"; DataTable dataTable = dbOperHandler.GetDataTable(); for (int index = 0; index < dataTable.Rows.Count; ++index) { DataRow row = dataTable.Rows[index]; string str = "ssc"; if (Convert.ToInt32(row["LotteryId"]) == 1) { str = "ssc"; } if (Convert.ToInt32(row["LotteryId"]) == 2) { str = "11x5"; } if (Convert.ToInt32(row["LotteryId"]) == 3) { str = "dpc"; } if (Convert.ToInt32(row["LotteryId"]) == 4) { str = "pk10"; } XmlControl xmlControl = new XmlControl(HttpContext.Current.Server.MapPath("~/WEB-INF/" + str + "/" + row["Title2"] + ".xml")); xmlControl.Update("play/id", row["Id"].ToString()); xmlControl.Update("play/type", row["type"].ToString()); xmlControl.Update("play/typename", row["title0"].ToString()); xmlControl.Update("play/name", row["Title"].ToString()); xmlControl.Update("play/minbonus", row["Minbonus"].ToString()); xmlControl.Update("play/posbonus", row["Posbonus"].ToString()); xmlControl.Update("play/maxbonus", row["Maxbonus"].ToString()); xmlControl.Update("play/remark", row["remark"].ToString()); xmlControl.Update("play/example", row["example"].ToString()); xmlControl.Update("play/help", row["help"].ToString()); xmlControl.Save(); xmlControl.Dispose(); } } }
public void Create(int loid) { string str1 = ConfigurationManager.AppSettings["DataUrl"].ToString(); using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT top 1 [Title],[Number] FROM [Sys_LotteryData] where Type=" + (object)loid + " order by Title desc"; DataTable dataTable = dbOperHandler.GetDataTable(); string str2 = "{\"title\": \"期号\",\"number\": \"号码\"}"; string str3 = dataTable.Rows.Count <= 0 ? str2.Replace("期号", "").Replace("号码", "") : str2.Replace("期号", dataTable.Rows[0]["Title"].ToString()).Replace("号码", dataTable.Rows[0]["Number"].ToString()); dataTable.Clear(); dataTable.Dispose(); string str4 = str1 + "EMindexData" + (object)loid + ".json"; DirFile.CreateFolder(DirFile.GetFolderPath(false, str4)); StreamWriter streamWriter = new StreamWriter(str4, false, Encoding.UTF8); streamWriter.Write(str3); streamWriter.Close(); } }
public DataTable GetListDataTable(int lotteryId, int top) { DataTable result; using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = string.Concat(new object[] { "select * from (select top ", top, " * from Sys_LotteryData where Type=", lotteryId, " order by Title Desc) A order by Title asc" }); DataTable dataTable = dbOperHandler.GetDataTable(); result = dataTable; } return(result); }
public string GetUserName(string _id) { string result; using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT [UserName] FROM [N_User] WHERE [Id]=" + _id; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { result = dataTable.Rows[0]["UserName"].ToString(); } else { result = string.Empty; } } return(result); }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, string _userId, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "Id=@Id"; dbOperHandler.AddConditionParameter("@Id", (object)_userId); string str = string.Concat(dbOperHandler.GetField("N_User", "ParentId")); dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("N_UserEmail"); string sql0 = SqlHelp.GetSql0("row_number() over (order by STime desc) as rowid," + str + " as parentid,dbo.f_GetUserName(SendId) as SendName,dbo.f_GetUserName(ReceiveId) as ReceiveName,*", "N_UserEmail", "STime", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"" + PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);") + "\"," + dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public string ChkAutoLoginWebApp(string _Id, string _sessionId) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = string.Format("select top 1 UserName,Point,sessionId from N_User with(nolock) where Id={0}", _Id); DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { if (!string.IsNullOrEmpty(string.Concat(dataTable.Rows[0]["sessionId"]))) { NameValueCollection nameValueCollection = new NameValueCollection(); nameValueCollection.Add("id", _Id); nameValueCollection.Add("name", dataTable.Rows[0]["UserName"].ToString()); nameValueCollection.Add("cookiess", dataTable.Rows[0]["sessionId"].ToString()); nameValueCollection.Add("point", dataTable.Rows[0]["Point"].ToString()); Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, nameValueCollection, this.site.CookieDomain, this.site.CookiePath); } else { string text = Guid.NewGuid().ToString().Replace("-", ""); dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "Id=@Id"; dbOperHandler.AddConditionParameter("@Id", _Id); dbOperHandler.AddFieldItem("sessionId", text); dbOperHandler.Update("N_User"); dbOperHandler.Dispose(); NameValueCollection nameValueCollection2 = new NameValueCollection(); nameValueCollection2.Add("id", _Id); nameValueCollection2.Add("name", dataTable.Rows[0]["UserName"].ToString()); nameValueCollection2.Add("cookiess", text); nameValueCollection2.Add("point", dataTable.Rows[0]["Point"].ToString()); Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, nameValueCollection2, this.site.CookieDomain, this.site.CookiePath); } } } return(_Id); }
public string GetHisNumber(string ltype) { string text = ""; using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT TOP 1000 [Number]\r\n FROM [Sys_LotteryData] where '" + ltype + "'=substring(Convert(varchar(10),type),1,1) order by STime asc"; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 1) { Random random = new Random(); string text2 = dataTable.Rows[random.Next(0, dataTable.Rows.Count - 1)]["Number"].ToString(); int num = random.Next(0, 4); string[] array = text2.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (i == num) { text = text + random.Next(0, 9) + ","; } else { text = text + array[i] + ","; } } text = text.Substring(0, text.Length - 1); } else { text = NumberCode.CreateCode(5); } } return(text); }
public string GetUserNav(string pid, string uid) { string text = "<span><a href='javascript:void(0);' onclick='ajaxSearchPid(" + uid + ")'>本级</a></span><span>></span>"; if (pid != "0") { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "SELECT UserCode FROM [N_User] WHERE [Id]=" + pid; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { string[] array = dataTable.Rows[0]["UserCode"].ToString().Replace(",,", ",").Substring(1, dataTable.Rows[0]["UserCode"].ToString().Replace(",,", ",").Length - 2).Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (Convert.ToInt32(array[i]) > Convert.ToInt32(uid)) { string text2 = text; text = string.Concat(new string[] { text2, "<span><a href='javascript:void(0);' onclick='ajaxSearchPid(", array[i], ")'>", this.GetUserName(array[i]), "</a></span><span>></span>" }); } } } } } return(text); }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("Log_UserLogin"); string sql = SqlHelp.GetSql0("*", "Log_UserLogin", "LoginTime", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)), "}" }); dataTable.Clear(); dataTable.Dispose(); } }
public Decimal GetMaxMoney(int userId) { Decimal num = new Decimal(0); using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 1 ISNULL(MoneyAfter,0) as MoneyAfter from N_UserMoneyLog with(nolock) where userId=" + (object)userId + " order by Id desc"; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { num = Convert.ToDecimal(dataTable.Rows[0]["MoneyAfter"].ToString()); } else { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "id=@id"; dbOperHandler.AddConditionParameter("@id", (object)userId); num = Convert.ToDecimal(dbOperHandler.GetField("N_User", "Money")); } } return(num); }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("V_ChargeRecord"); string sql = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,dbo.f_GetUserName(UserId) as UserName,*", "V_ChargeRecord", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)), "}" }); dataTable.Clear(); dataTable.Dispose(); } }
public void GetListJSON_ZHDetail(int _thispage, int _pagesize, string _wherestr1, string _wherestr2, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("V_UserBetZhDetail"); string sql = SqlHelp.GetSql0("row_number() over (order by IssueNum asc) as rowid,*,substring(Convert(varchar(20),STime2,120),6,11) as ShortTime", "V_UserBetZhDetail", "IssueNum", _pagesize, _thispage, "asc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(6, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxZhList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)), "}" }); dataTable.Clear(); dataTable.Dispose(); } }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, string _wherestr2, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("Flex_UserBet"); string sql = SqlHelp.GetSql0(_wherestr2 + "as isme,row_number() over (order by Id desc) as rowid,Id,SsId,UserId,UserName,UserMoney,PlayId,PlayName,PlayCode,LotteryId,LotteryName,IssueNum,SingleMoney,moshi,Times,Num,DX,DS,cast(Times*Total as decimal(15,4)) as Total,Point,PointMoney,Bonus,Bonus2,WinNum,WinBonus,RealGet,Pos,STime,STime2,substring(Convert(varchar(20),STime2,120),6,11) as ShortTime,IsOpen,State,IsWin,number,poslen", "Flex_UserBet", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = string.Concat(new string[] { "{\"result\" :\"1\",\"returnval\" :\"操作成功\",\"pagebar\" :\"", PageBar.GetPageBar(80, "js", 2, totalCount, _pagesize, _thispage, "javascript:ajaxList(<#page#>);"), "\",", dtHelp.DT2JSON(dataTable, _pagesize * (_thispage - 1)), "}" }); dataTable.Clear(); dataTable.Dispose(); } }
/// <summary> /// 获取彩票系统配置 /// </summary> /// <returns>彩票详细</returns> public IList <SysLotteryModel> GetSysLotteries() { IList <SysLotteryModel> lotteries = (IList <SysLotteryModel>)RTCache.Get(Const.CACHE_KEY_SYS_LOTTERY); if (lotteries == null || lotteries.Count <= 0) { lotteries = new List <SysLotteryModel>(); using (DbOperHandler db = new ComData().Doh()) { db.Reset(); db.SqlCmd = "select * from Sys_Lottery order by id"; DataTable dataTable = db.GetDataTable(); if (dataTable != null && dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { SysLotteryModel lot = new SysLotteryModel() { Id = Convert.ToInt32(dataTable.Rows[i]["id"]), Title = Convert.ToString(dataTable.Rows[i]["Title"]), Code = Convert.ToString(dataTable.Rows[i]["Code"]), CloseTime = Convert.ToInt32(dataTable.Rows[i]["CloseTime"]), IsOpen = Convert.ToBoolean(dataTable.Rows[i]["CloseTime"]), ApiUrl = Convert.ToString(dataTable.Rows[i]["ApiUrl"]) }; lotteries.Add(lot); } } } RTCache.Insert(Const.CACHE_KEY_SYS_LOTTERY, lotteries); } return(lotteries); }
/// <summary> /// 获取下一期开奖信息 /// </summary> /// <param name="lotteryId"></param> /// <returns></returns> public string[] GetIssueTimeAndSN(int lotteryId) { string[] strArray = new string[2]; DateTime now = DateTime.Now; switch (lotteryId) { case 3002: case 3003: using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,Convert(varchar(4),getdate(),120)+'-01-01 20:30:00',Convert(varchar(20),getdate(),120)) as d"; int num = Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) - 7 + 1; strArray[1] = now.ToString("yyyy-MM-dd") + " 20:30:00"; if (now > Convert.ToDateTime(now.ToString(" 20:30:00"))) { strArray[1] = now.AddDays(1.0).ToString("yyyy-MM-dd") + " 20:30:00"; } else { --num; } strArray[0] = now.Year.ToString() + this.AddZero(num + 1, 3); break; } default: using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 1 Id, Sn,Time,LotteryId from Sys_LotteryTime where Time > Convert(varchar(10),getdate(),108) and LotteryId=" + (object)lotteryId + " order by Time asc"; DataTable dataTable1 = dbOperHandler.GetDataTable(); if (dataTable1.Rows.Count > 0) { DataRow row = dataTable1.Rows[0]; strArray[1] = now.ToString("yyyy-MM-dd") + " " + row["Time"].ToString(); int int32 = Convert.ToInt32(row["Sn"].ToString()); strArray[0] = now.ToString("yyyyMMdd") + "-" + row["Sn"].ToString(); if (lotteryId == 1003 && int32 >= 85) { strArray[0] = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + this.AddZero(int32, 2); } if (lotteryId == 1010 || lotteryId == 1017 || (lotteryId == 3004 || lotteryId == 1012) || lotteryId == 1013) { strArray[0] = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum(lotteryId.ToString()) + Convert.ToInt32(row["Sn"].ToString()))); } if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 23:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 23:59:59") && (lotteryId == 1014 || lotteryId == 1016)) { strArray[0] = now.AddDays(1.0).ToString("yyyyMMdd") + "-" + row["Sn"].ToString(); strArray[1] = now.ToString("yyyy-MM-dd") + " " + row["Time"].ToString(); } if (lotteryId == 1014 || lotteryId == 1015 || lotteryId == 1016) { strArray[0] = strArray[0].Replace("-", ""); } if (lotteryId == 4001) { strArray[0] = !(DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00")) || !(DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:07:01")) ? string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("4001") + Convert.ToInt32(row["Sn"].ToString()))) : string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("4001") + 179 + Convert.ToInt32(row["Sn"].ToString()))); break; } break; } dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 1 Id, Sn,Time,LotteryId from Sys_LotteryTime where LotteryId=" + (object)lotteryId + " order by Time asc"; DataTable dataTable2 = dbOperHandler.GetDataTable(); strArray[0] = now.AddDays(1.0).ToString("yyyyMMdd") + "-" + dataTable2.Rows[0]["Sn"].ToString(); strArray[1] = now.AddDays(1.0).ToString("yyyy-MM-dd") + " " + dataTable2.Rows[0]["Time"].ToString(); if (lotteryId == 1010 || lotteryId == 1017 || lotteryId == 3004) { strArray[0] = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1010") + 880 + Convert.ToInt32(dataTable2.Rows[0]["Sn"].ToString()))); } if (lotteryId == 1012) { strArray[0] = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1012") + 660 + Convert.ToInt32(dataTable2.Rows[0]["Sn"].ToString()))); } if (lotteryId == 1013) { strArray[0] = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1013") + 203 + Convert.ToInt32(dataTable2.Rows[0]["Sn"].ToString()))); } if (lotteryId == 1014 || lotteryId == 1015 || lotteryId == 1016) { strArray[0] = strArray[0].Replace("-", ""); } if (lotteryId == 4001) { strArray[0] = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("4001") + 179 + Convert.ToInt32(dataTable2.Rows[0]["Sn"].ToString()))); break; } break; } } return(strArray); }
public int GetTsIssueNum(string lotteryId) { DateTime now = DateTime.Now; int result = 0; using (DbOperHandler dbOperHandler = new ComData().Doh()) { if (lotteryId != null) { if (!(lotteryId == "1010") && !(lotteryId == "3004")) { if (!(lotteryId == "1017")) { if (!(lotteryId == "1012")) { if (!(lotteryId == "1013")) { if (lotteryId == "4001") { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2017-02-10',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable = dbOperHandler.GetDataTable(); if (DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:07:01")) { result = 601048 + (Convert.ToInt32(dataTable.Rows[0]["d"]) - 1) * 179; } else { result = 601048 + Convert.ToInt32(dataTable.Rows[0]["d"]) * 179; } } } else { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2017-01-01',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable = dbOperHandler.GetDataTable(); if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 06:50:00")) { result = 106000000 + (Convert.ToInt32(dataTable.Rows[0]["d"]) - 1) * 203; } else { result = 106000000 + Convert.ToInt32(dataTable.Rows[0]["d"]) * 203; } } } else { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-23',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable = dbOperHandler.GetDataTable(); if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:01:45")) { result = 2588087 + (Convert.ToInt32(dataTable.Rows[0]["d"]) - 1) * 660; } else { result = 2588087 + Convert.ToInt32(dataTable.Rows[0]["d"]) * 660; } } } else { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable = dbOperHandler.GetDataTable(); result = 1658117 + Convert.ToInt32(dataTable.Rows[0]["d"]) * 880; } } else { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'2016-10-08',Convert(varchar(10),getdate(),120)) as d"; DataTable dataTable = dbOperHandler.GetDataTable(); result = 1658122 + Convert.ToInt32(dataTable.Rows[0]["d"]) * 880; } } } return(result); }
public void GetLotteryTime(string Lid, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { string str1 = "[{\"name\": \"名称\",\"lotteryid\": \"彩种类别\",\"ordertime\": \"倒计时\",\"closetime\": \"封单时间\",\"nestsn\": \"下期期号\",\"cursn\": \"当前期号\"}]".Replace("名称", LotteryUtils.LotteryTitle(int.Parse(Lid))).Replace("彩种类别", Lid); DateTime dateTime1 = DateTime.Now; DateTime now = DateTime.Now; string str2 = now.ToString("yyyyMMdd"); string str3 = now.ToString("HH:mm:ss"); now.ToString("yyyy-MM-dd"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select dbo.f_GetCloseTime(" + Lid + ") as closetime"; DataTable dataTable1 = dbOperHandler.GetDataTable(); string str4 = str1.Replace("封单时间", dataTable1.Rows[0]["closetime"].ToString()); string newValue1; string newValue2; TimeSpan timeSpan; if (Lid == "3002" || Lid == "3003") { DateTime dateTime2 = Convert.ToDateTime(now.Year.ToString() + "-01-01 20:30:00"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'" + dateTime2.ToString("yyyy-MM-dd HH:mm:ss") + "','" + now.ToString("yyyy-MM-dd HH:mm:ss") + "') as d"; int Num = Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) - 7 + 1; string str5 = now.AddDays(-1.0).ToString("yyyy-MM-dd") + " 20:30:00"; string str6 = now.ToString("yyyy-MM-dd") + " 20:30:00"; if (now > Convert.ToDateTime(now.ToString(" 20:30:00"))) { str6 = now.AddDays(1.0).ToString("yyyy-MM-dd") + " 20:30:00"; } else { --Num; } newValue1 = now.Year.ToString() + Func.AddZero(Num, 3); newValue2 = now.Year.ToString() + Func.AddZero(Num + 1, 3); timeSpan = Convert.ToDateTime(str6) - Convert.ToDateTime(str3); } else { if (ComData.LotteryTime == null) { ComData.LotteryTime = new LotteryTimeDAL().GetTable(); } DataRow[] dataRowArray1 = ComData.LotteryTime.Select("Time >'" + str3 + "' and LotteryId=" + Lid, "Time asc"); if (dataRowArray1.Length == 0) { dataRowArray1 = ComData.LotteryTime.Select("Time <='" + str3 + "' and LotteryId=" + Lid, "Time asc"); newValue2 = now.AddDays(1.0).ToString("yyyyMMdd") + "-" + dataRowArray1[0]["Sn"].ToString(); } else { newValue2 = str2 + "-" + dataRowArray1[0]["Sn"].ToString(); dateTime1 = Convert.ToDateTime(dataRowArray1[0]["Time"].ToString()); if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 10:00:01") && Lid == "1003") { newValue2 = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + dataRowArray1[0]["Sn"].ToString(); } } if (Convert.ToDateTime(dataRowArray1[0]["Time"].ToString()) < Convert.ToDateTime(str3)) { dateTime1 = Convert.ToDateTime(now.AddDays(1.0).ToString("yyyy-MM-dd") + " " + dataRowArray1[0]["Time"].ToString()); } timeSpan = dateTime1 - Convert.ToDateTime(str3); DataRow[] dataRowArray2 = ComData.LotteryTime.Select("Time <'" + str3 + "' and LotteryId=" + Lid, "Time desc"); if (dataRowArray2.Length == 0) { dataRowArray2 = ComData.LotteryTime.Select("LotteryId=" + Lid, "Time desc"); newValue1 = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + dataRowArray2[0]["Sn"].ToString(); } else { newValue1 = str2 + "-" + dataRowArray2[0]["Sn"].ToString(); if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 10:00:01") && Lid == "1003") { newValue1 = now.AddDays(-1.0).ToString("yyyyMMdd") + "-" + dataRowArray2[0]["Sn"].ToString(); } } if (Lid == "4001") { DateTime dateTime2 = Convert.ToDateTime("2016-01-01 00:00:00"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'" + dateTime2.ToString("yyyy-MM-dd HH:mm:ss") + "','" + now.ToString("yyyy-MM-dd HH:mm:ss") + "') as d"; DataTable dataTable2 = dbOperHandler.GetDataTable(); if (now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 00:00:00") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 09:07:01") || now > Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 23:57:01") && now < Convert.ToDateTime(now.ToString("yyyy-MM-dd") + " 23:59:59")) { newValue1 = string.Concat((object)(530900 + (Convert.ToInt32(dataTable2.Rows[0]["d"]) - 8) * 179 + Convert.ToInt32(dataRowArray2[0]["Sn"]))); newValue2 = string.Concat((object)(530900 + (Convert.ToInt32(dataTable2.Rows[0]["d"]) - 8) * 179 + Convert.ToInt32(dataRowArray2[0]["Sn"]) + 1)); } else { newValue1 = string.Concat((object)(530900 + (Convert.ToInt32(dataTable2.Rows[0]["d"]) - 7) * 179 + Convert.ToInt32(dataRowArray2[0]["Sn"]))); newValue2 = string.Concat((object)(530900 + (Convert.ToInt32(dataTable2.Rows[0]["d"]) - 7) * 179 + Convert.ToInt32(dataRowArray2[0]["Sn"]) + 1)); } } if (Lid == "1010" || Lid == "1017" || Lid == "3004") { newValue1 = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1010") + Convert.ToInt32(dataRowArray2[0]["Sn"].ToString()))); newValue2 = string.Concat((object)(Convert.ToInt32(newValue1) + 1)); } if (Lid == "1012") { newValue1 = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1012") + Convert.ToInt32(dataRowArray2[0]["Sn"].ToString()))); newValue2 = string.Concat((object)(Convert.ToInt32(newValue1) + 1)); } if (Lid == "1013") { newValue1 = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum("1013") + Convert.ToInt32(dataRowArray2[0]["Sn"].ToString()))); newValue2 = string.Concat((object)(Convert.ToInt32(newValue1) + 1)); } } string newValue3 = string.Concat((object)(timeSpan.Days * 24 * 60 * 60 + timeSpan.Hours * 60 * 60 + timeSpan.Minutes * 60 + timeSpan.Seconds)); string str7 = str4.Replace("下期期号", newValue2).Replace("当前期号", newValue1).Replace("倒计时", newValue3); _jsonstr = str7; } }
public void GetLotteryZhList(string Lid, ref string _jsonstr) { DateTime now = DateTime.Now; string str1 = now.ToString("yyyyMMdd"); string str2 = now.ToString("HH:mm:ss"); now.ToString("yyyy-MM-dd"); using (DbOperHandler dbOperHandler = new ComData().Doh()) { if (Lid == "3002" || Lid == "3003") { DateTime dateTime = Convert.ToDateTime(now.Year.ToString() + "-01-01 20:30:00"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select datediff(d,'" + dateTime.ToString("yyyy-MM-dd HH:mm:ss") + "','" + now.ToString("yyyy-MM-dd HH:mm:ss") + "') as d"; int num = Convert.ToInt32(dbOperHandler.GetDataTable().Rows[0]["d"]) - 7 + 1; string str3 = now.AddDays(-1.0).ToString("yyyy-MM-dd") + " 20:30:00"; string str4 = now.ToString("yyyy-MM-dd") + " 20:30:00"; if (now > Convert.ToDateTime(now.ToString(" 20:30:00"))) { string str5 = now.AddDays(1.0).ToString("yyyy-MM-dd") + " 20:30:00"; } else { --num; } StringBuilder stringBuilder = new StringBuilder(); for (int index = 0; index <= 9; ++index) { string str6 = "{\"no\": \"编号\",\"sn\": \"期号\",\"count\": \"倍数\",\"price\": \"金额\",\"stime\": \"时间\"},".Replace("编号", (index + 1).ToString()).Replace("期号", now.Year.ToString() + Func.AddZero(num + (index + 1), 3)).Replace("倍数", "0").Replace("金额", "0.00").Replace("时间", now.AddDays((double)index).ToString("yyyy-MM-dd") + " 20:30:00"); stringBuilder.Append(str6); } _jsonstr = "[" + stringBuilder.ToString().Substring(0, stringBuilder.ToString().Length - 1) + "]"; } else { if (ComData.LotteryTime == null) { ComData.LotteryTime = new LotteryTimeDAL().GetTable(); } DataRow[] dataRowArray = ComData.LotteryTime.Select("Time >'" + str2 + "' and LotteryId=" + Lid, "Time asc"); if (dataRowArray.Length == 0) { dataRowArray = ComData.LotteryTime.Select("Time <='" + str2 + "' and LotteryId=" + Lid, "Time asc"); str1 = now.AddDays(1.0).ToString("yyyyMMdd"); } int num = ComData.LotteryTime.Select("LotteryId=" + Lid, "Time asc").Length; if (num > 120) { num = 120; } StringBuilder stringBuilder = new StringBuilder(); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top " + (object)num + " * from Sys_LotteryTime where lotteryid=" + Lid + " and sn>=" + dataRowArray[0]["Sn"].ToString() + "order by sn asc"; DataTable dataTable1 = dbOperHandler.GetDataTable(); for (int index = 0; index < dataTable1.Rows.Count; ++index) { string str3 = "{\"no\": \"编号\",\"sn\": \"期号\",\"count\": \"倍数\",\"price\": \"金额\",\"stime\": \"时间\"},"; string newValue = str1 + "-" + dataTable1.Rows[index]["sn"].ToString(); if (Lid == "1010" || Lid == "1017" || (Lid == "3004" || Lid == "1012") || Lid == "1013") { newValue = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum(Lid) + Convert.ToInt32(dataTable1.Rows[index]["sn"].ToString()))); } string str4 = str3.Replace("编号", (index + 1).ToString()).Replace("期号", newValue).Replace("倍数", "0").Replace("金额", "0.00").Replace("时间", now.ToString("yyyy-MM-dd") + " " + dataTable1.Rows[index]["time"]); stringBuilder.Append(str4); } dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top " + (object)(num - dataTable1.Rows.Count) + " * from Sys_LotteryTime where lotteryid=" + Lid + " order by sn asc"; DataTable dataTable2 = dbOperHandler.GetDataTable(); for (int index = 0; index < dataTable2.Rows.Count; ++index) { string str3 = "{\"no\": \"编号\",\"sn\": \"期号\",\"count\": \"倍数\",\"price\": \"金额\",\"stime\": \"时间\"},"; string newValue = now.AddDays(1.0).ToString("yyyyMMdd") + "-" + dataTable2.Rows[index]["sn"].ToString(); if (Lid == "1010" || Lid == "1017" || (Lid == "3004" || Lid == "1012") || Lid == "1013") { newValue = string.Concat((object)(new LotteryTimeDAL().GetTsIssueNum(Lid) + Convert.ToInt32(dataTable2.Rows[index]["sn"].ToString()))); } string str4 = str3.Replace("编号", (index + 1 + dataTable1.Rows.Count).ToString()).Replace("期号", newValue).Replace("倍数", "0").Replace("金额", "0.00").Replace("时间", now.AddDays(1.0).ToString("yyyy-MM-dd") + " " + dataTable2.Rows[index]["time"]); stringBuilder.Append(str4); } _jsonstr = "[" + stringBuilder.ToString().Substring(0, stringBuilder.ToString().Length - 1) + "]"; } } }
public string ChkAutoLoginWebApp(string _Id, string _sessionId, int iExpires) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = string.Format("select top 1 UserName,Point,sessionId from N_User with(nolock) where Id={0}", (object)_Id); DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { if (!string.IsNullOrEmpty(string.Concat(dataTable.Rows[0]["sessionId"]))) { Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, new NameValueCollection() { { "id", _Id }, { "name", dataTable.Rows[0]["UserName"].ToString() }, { "cookiess", dataTable.Rows[0]["sessionId"].ToString() }, { "point", dataTable.Rows[0]["Point"].ToString() } }, "www.youle1288.com;youle1288.com;www.youle2888.com;youle2888.com,feifan1188.com,www.feifan1188.com", this.site.CookiePath); } else { string str = Guid.NewGuid().ToString().Replace("-", ""); dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "Id=@Id"; dbOperHandler.AddConditionParameter("@Id", (object)_Id); dbOperHandler.AddFieldItem("sessionId", (object)str); dbOperHandler.Update("N_User"); dbOperHandler.Dispose(); Cookie.SetObj(this.site.CookiePrev + "WebApp", 1, new NameValueCollection() { { "id", _Id }, { "name", dataTable.Rows[0]["UserName"].ToString() }, { "cookiess", str }, { "point", dataTable.Rows[0]["Point"].ToString() } }, "www.youle1288.com;youle1288.com;www.youle2888.com;youle2888.com,feifan1188.com,www.feifan1188.com", this.site.CookiePath); } } return(_Id); } }