public void GetListJSON(int page, int PSize, string whereStr, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = whereStr; string sql0 = SqlHelp.GetSql0(dbOperHandler.Count("Flex_User").ToString() + " as totalcount,row_number() over (order by Id asc) as rowid,*", "Flex_User", "Id", PSize, page, "asc", whereStr); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = this.ConverTableToJSON(dataTable); dataTable.Clear(); dataTable.Dispose(); } }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; string sql0 = SqlHelp.GetSql0(dbOperHandler.Count("Flex_ChargeRecord").ToString() + " as totalcount,row_number() over (order by Id desc) as rowid,UserName,*", "Flex_ChargeRecord", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = this.ConverTableToJSON(dataTable); dataTable.Clear(); dataTable.Dispose(); } }
public void GetIphoneListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int totalCount = dbOperHandler.Count("Flex_ChargeRecord"); string sql0 = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,UserName,*", "Flex_ChargeRecord", "Id", _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 void GetIphoneBankInfoJSON(string UserId, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "UserId=" + UserId; dbOperHandler.Count("N_UserBank"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select top 3 * from V_UserBankInfo where UserId=" + UserId; dbOperHandler.SqlCmd += "order by Id desc"; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}"; dataTable.Clear(); dataTable.Dispose(); } }
public void GetListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; dbOperHandler.Count("Flex_UserGetCash"); string sql = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,0.0000 as sxf,*", "Flex_UserGetCash", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = base.ConverTableToJSON(dataTable); dataTable.Clear(); dataTable.Dispose(); } }
public void GetMessageListJSON(int _thispage, int _pagesize, string _wherestr1, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = _wherestr1; int num = dbOperHandler.Count("N_UserMessage"); string sql = SqlHelp.GetSql0(num + " as totalcount,row_number() over (order by Id desc) as rowid,dbo.f_GetUserName(UserId) as UserName,*", "N_UserMessage", "Id", _pagesize, _thispage, "desc", _wherestr1); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); _jsonstr = base.ConverTableToJSON2(dataTable); dataTable.Clear(); dataTable.Dispose(); } }
public void GetListOnlineJSON(int page, int PSize, string whereStr, string UserId, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = whereStr + " and UserCode like '%," + UserId + ",%'"; int num = dbOperHandler.Count("N_User"); string sql0 = SqlHelp.GetSql0(num.ToString() + " as totalcount,ID,UserName,UserCode,Money,LastTime", "N_User", "Id", PSize, page, "asc", whereStr + " and UserCode like '%," + UserId + ",%'"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql0; DataTable dataTable = dbOperHandler.GetDataTable(); string str1 = ""; if (dataTable.Rows.Count > 0) { for (int index1 = 0; index1 < dataTable.Rows.Count; ++index1) { string str2 = string.Empty; string str3 = dataTable.Rows[index1]["UserCode"].ToString().Replace(",,", "_").Replace(",", ""); string[] strArray = str3.Substring(str3.IndexOf(UserId)).Split('_'); if (strArray.Length > 0) { for (int index2 = 0; index2 < strArray.Length; ++index2) { if (!string.IsNullOrEmpty(strArray[index2])) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "Id=" + strArray[index2]; str2 = str2 + dbOperHandler.GetField("N_User", "UserName") + ">"; } } string str4 = str2.Substring(0, str2.Length - 1); if (index1 != 0) { str1 += " union all "; } str1 = str1 + " select " + (object)num + " as totalcount,row_number() over (order by Id asc) as rowid,ID,UserName,UserCode,Money,'" + str4 + "' as CodeName,LastTime from N_User where Id=" + dataTable.Rows[index1]["Id"]; } } dbOperHandler.Reset(); dbOperHandler.SqlCmd = str1; dataTable = dbOperHandler.GetDataTable(); } _jsonstr = this.ConverTableToJSON(dataTable); dataTable.Clear(); dataTable.Dispose(); } }
public void ajaxGetProListSub(string AdminId, int page, int PSize, string whereStr, string UserName, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { bool flag = true; if (!string.IsNullOrEmpty(UserName)) { dbOperHandler.Reset(); dbOperHandler.SqlCmd = "select Id from N_User where UserName='******' and UserCode like (select UserCode from N_User where Id=" + AdminId + ")+'%'"; DataTable dataTable = dbOperHandler.GetDataTable(); if (dataTable.Rows.Count > 0) { AdminId = dataTable.Rows[0]["Id"].ToString(); } else { flag = false; _jsonstr = "[]"; } } if (!flag) { return; } dbOperHandler.Reset(); dbOperHandler.ConditionExpress = " ParentId = " + AdminId + " or Id=" + AdminId; int num = dbOperHandler.Count("N_User"); string str1 = string.Format("select {1} as totalcount, {0} as UserID,\r\n (select Convert(varchar(10),cast(round([Point]/10.0,2) as numeric(5,2))) from N_User with(nolock) where Id={0} ) as userpoint,\r\n dbo.f_GetUserName({0}) as userName,\r\n (select isnull(sum(money),0) from N_User with(nolock) where Id = {0}) as money,\r\n isnull(sum(b.Charge),0) Charge,isnull(sum(b.GetCash),0) GetCash,isnull(sum(b.Bet),0)-isnull(sum(b.Cancellation),0) Bet,isnull(sum(b.Point),0) Point,isnull(sum(b.Win),0) Win,isnull(sum(b.Cancellation),0) Cancellation,isnull(sum(b.TranAccIn),0) TranAccIn,isnull(sum(b.TranAccOut),0) TranAccOut,isnull(sum(b.Give),0) Give,isnull(sum(b.Other),0) Other,isnull(sum(b.Change),0) Change,\r\n (isnull(sum(Win),0)+isnull(sum(Point),0)+isnull(sum(Change),0)+isnull(sum(Give),0)+isnull(sum(Cancellation),0))-isnull(sum(Bet),0) as total,\r\n (isnull(sum(Charge),0)-isnull(sum(getcash),0)) as moneytotal\r\n from Flex_UserMoneyStatAll b with(nolock)\r\n where {2} and UserId={0}", (object)AdminId, (object)num, (object)whereStr) + " union all "; dbOperHandler.Reset(); dbOperHandler.SqlCmd = SqlHelp.GetSql0("Id,UserName,Money,Point", "N_User", "ID", PSize, page, "asc", " ParentId = " + AdminId); DataTable dataTable1 = dbOperHandler.GetDataTable(); for (int index = 0; index < dataTable1.Rows.Count; ++index) { string str2 = whereStr + " and UserCode like '%" + Strings.PadLeft(dataTable1.Rows[index]["Id"].ToString()) + "%'"; str1 = str1 + string.Format("select {0} as totalcount, {1} as UserID,\r\n Convert(varchar(10),cast(round({2}/10.0,2) as numeric(5,2))) as userpoint,\r\n '{3}' as userName,\r\n isnull(sum({4}),0) as money,\r\n isnull(sum(b.Charge),0) Charge,isnull(sum(b.GetCash),0) GetCash,isnull(sum(b.Bet),0)-isnull(sum(b.Cancellation),0) Bet,isnull(sum(b.Point),0) Point,isnull(sum(b.Win),0) Win,isnull(sum(b.Cancellation),0) Cancellation,isnull(sum(b.TranAccIn),0) TranAccIn,isnull(sum(b.TranAccOut),0) TranAccOut,isnull(sum(b.Give),0) Give,isnull(sum(b.Other),0) Other,isnull(sum(b.Change),0) Change,\r\n (isnull(sum(Win),0)+isnull(sum(Point),0)+isnull(sum(Change),0)+isnull(sum(Give),0)+isnull(sum(Cancellation),0))-isnull(sum(Bet),0) as total,\r\n (isnull(sum(Charge),0)-isnull(sum(getcash),0)) as moneytotal\r\n from Flex_UserMoneyStatAll b with(nolock)\r\n where {5}", (object)num, (object)dataTable1.Rows[index]["Id"].ToString(), (object)dataTable1.Rows[index]["Point"].ToString(), (object)dataTable1.Rows[index][nameof(UserName)].ToString(), (object)dataTable1.Rows[index]["Money"].ToString(), (object)str2) + " union all "; } string str3 = str1 + string.Format("select {2} as totalcount, '-1' as UserID,'合计' as userpoint,'' as userName,\r\n (select isnull(sum(money),0) from N_User with(nolock) where UserCode like '%,{0},%') as money,\r\n isnull(sum(b.Charge),0) Charge,isnull(sum(b.GetCash),0) GetCash,isnull(sum(b.Bet),0)-isnull(sum(b.Cancellation),0) Bet,isnull(sum(b.Point),0) Point,isnull(sum(b.Win),0) Win,isnull(sum(b.Cancellation),0) Cancellation,isnull(sum(b.TranAccIn),0) TranAccIn,isnull(sum(b.TranAccOut),0) TranAccOut,isnull(sum(b.Give),0) Give,isnull(sum(b.Other),0) Other,isnull(sum(b.Change),0) Change,\r\n (isnull(sum(Win),0)+isnull(sum(Point),0)+isnull(sum(Change),0)+isnull(sum(Give),0)+isnull(sum(Cancellation),0))-isnull(sum(Bet),0) as total,\r\n (isnull(sum(Charge),0)-isnull(sum(getcash),0)) as moneytotal\r\n FROM Flex_UserMoneyStatAll b with(nolock) where {1}", (object)AdminId, (object)(whereStr + " and UserCode like '%" + Strings.PadLeft(AdminId) + "%'"), (object)num); dbOperHandler.Reset(); dbOperHandler.SqlCmd = str3; DataTable dataTable2 = dbOperHandler.GetDataTable(); _jsonstr = this.ConverTableToJSON(dataTable2); dataTable2.Clear(); dataTable2.Dispose(); } }
public void GetAdminListJSON(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_UserGetCash"); string sql = SqlHelp.GetSql0("row_number() over (order by Id desc) as rowid,*", "V_UserGetCash", "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 GetListOnlineJSON(int page, int PSize, string whereStr, string UserId, ref string _jsonstr) { using (DbOperHandler dbOperHandler = new ComData().Doh()) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = whereStr + " and UserCode like '%," + UserId + ",%'"; int num = dbOperHandler.Count("N_User"); string sql = SqlHelp.GetSql0(num + " as totalcount,ID,UserName,UserCode,Money,LastTime", "N_User", "Id", PSize, page, "asc", whereStr + " and UserCode like '%," + UserId + ",%'"); dbOperHandler.Reset(); dbOperHandler.SqlCmd = sql; DataTable dataTable = dbOperHandler.GetDataTable(); string text = ""; if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { string text2 = string.Empty; string text3 = dataTable.Rows[i]["UserCode"].ToString().Replace(",,", "_").Replace(",", ""); text3 = text3.Substring(text3.IndexOf(UserId)); string[] array = text3.Split(new char[] { '_' }); if (array.Length > 0) { for (int j = 0; j < array.Length; j++) { if (!string.IsNullOrEmpty(array[j])) { dbOperHandler.Reset(); dbOperHandler.ConditionExpress = "Id=" + array[j]; text2 = text2 + dbOperHandler.GetField("N_User", "UserName") + ">"; } } text2 = text2.Substring(0, text2.Length - 1); if (i != 0) { text += " union all "; } object obj = text; text = string.Concat(new object[] { obj, " select ", num, " as totalcount,row_number() over (order by Id asc) as rowid,ID,UserName,UserCode,Money,'", text2, "' as CodeName,LastTime from N_User where Id=", dataTable.Rows[i]["Id"] }); } } dbOperHandler.Reset(); dbOperHandler.SqlCmd = text; dataTable = dbOperHandler.GetDataTable(); } _jsonstr = base.ConverTableToJSON(dataTable); dataTable.Clear(); dataTable.Dispose(); } }