private void BindData() { DateTime fromDate = DateTime.Now; DateTime toDate = DateTime.Now; if (!DateTime.TryParse(tbBeginTime.Text, out fromDate) || !DateTime.TryParse(tbEndTime.Text, out toDate)) { Shove._Web.JavaScript.Alert(this.Page, "请输入正确的日期范围!"); return; } string sql = @"SELECT a.ID,a.SiteID,a.UserID,a.[DateTime], a.PayType,a.[Money],a.FormalitiesFees,a.Result, b.Name, b.RealityName, b.Sex, b.IDCardNumber, b.[Address], b.Email, b.QQ, b.Telephone, b.Mobile FROM dbo.T_UserPayDetails a INNER JOIN dbo.T_Users b ON a.UserID = b.ID where a.[DateTime]>=@fromDate and a.[DateTime]<=@toDate and Result = 0"; Shove.Database.MSSQL.Parameter[] paras = new Shove.Database.MSSQL.Parameter[3]; paras[0] = new Shove.Database.MSSQL.Parameter("@fromDate", SqlDbType.DateTime, 8, ParameterDirection.Input, fromDate); paras[1] = new Shove.Database.MSSQL.Parameter("@toDate", SqlDbType.DateTime, 8, ParameterDirection.Input, toDate); DataTable dt = null; if (!string.IsNullOrEmpty(tbName.Text.Trim())) { sql += " and Name like '%" + Shove._Web.Utility.FilteSqlInfusion(tbName.Text.Trim()) + "%'"; dt = Shove.Database.MSSQL.Select(sql, paras); } else { dt = Shove.Database.MSSQL.Select(sql, paras); } if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_UserForInitiateFollowSchemeTrys"); return; } PF.DataGridBindData(g, dt, gPager); }
public long Update(string ConnectionString, string Condition) { if (this.Fields.Count < 1) { return -101L; } Condition = Condition.Trim(); string commandText = "update [" + this.TableName + "] set "; MSSQL.Parameter[] paras = new MSSQL.Parameter[this.Fields.Count]; for (int i = 0; i < this.Fields.Count; i++) { if (i > 0) { commandText = commandText + ", "; } string str2 = commandText; commandText = str2 + "[" + this.Fields[i].Name + "] = @" + this.Fields[i].CanonicalIdentifierName; paras[i] = new MSSQL.Parameter(this.Fields[i].CanonicalIdentifierName, this.Fields[i].DbType, 0, ParameterDirection.Input, this.Fields[i].Value); } if (!string.IsNullOrEmpty(Condition)) { commandText = commandText + " where " + Condition; } commandText = commandText + "; select isnull(cast(rowcount_big() as bigint), -99999999)"; object obj2 = MSSQL.ExecuteScalar(ConnectionString, commandText, paras); if (obj2 == null) { return -102L; } this.Fields.Clear(); long num2 = (long) obj2; if (num2 == -99999999L) { return 0L; } return num2; }
public long Insert(string ConnectionString) { if (this.Fields.Count < 1) { return -101L; } string str = ""; string str2 = ""; MSSQL.Parameter[] paras = new MSSQL.Parameter[this.Fields.Count]; for (int i = 0; i < this.Fields.Count; i++) { if (i > 0) { str = str + ", "; str2 = str2 + ", "; } str = str + "[" + this.Fields[i].Name + "]"; str2 = str2 + "@" + this.Fields[i].CanonicalIdentifierName; paras[i] = new MSSQL.Parameter(this.Fields[i].CanonicalIdentifierName, this.Fields[i].DbType, 0, ParameterDirection.Input, this.Fields[i].Value); } string commandText = "insert into [" + this.TableName + "] (" + str + ") values (" + str2 + "); select isnull(cast(scope_identity() as bigint), -99999999)"; object obj2 = MSSQL.ExecuteScalar(ConnectionString, commandText, paras); if (obj2 == null) { return -102L; } this.Fields.Clear(); long num2 = (long) obj2; if (num2 == -99999999L) { return 0L; } return num2; }
public long Update(string ConnectionString, string Condition) { if (Fields.Count < 1) { return -101; } Condition = Condition.Trim(); string CommandText = "update [" + TableName + "] set "; MSSQL.Parameter[] Parameters = new MSSQL.Parameter[Fields.Count]; for (int i = 0; i < Fields.Count; i++) { if (i > 0) { CommandText += ", "; } CommandText += "[" + Fields[i].Name + "] = @" + Fields[i].CanonicalIdentifierName; Parameters[i] = new MSSQL.Parameter(Fields[i].CanonicalIdentifierName, Fields[i].DbType, 0, ParameterDirection.Input, Fields[i].Value); } if (!String.IsNullOrEmpty(Condition)) { CommandText += " where " + Condition; } CommandText += "; select isnull(cast(rowcount_big() as bigint), -99999999)"; object objResult = MSSQL.ExecuteScalar(ConnectionString, CommandText, Parameters); if (objResult == null) { return -102; } Fields.Clear(); long Result = (long)objResult; if (Result == -99999999) { return 0; } return Result; }
public long Insert(string ConnectionString) { if (Fields.Count < 1) { return -101; } string InsertFieldsList = ""; string InsertValuesList = ""; MSSQL.Parameter[] Parameters = new MSSQL.Parameter[Fields.Count]; for (int i = 0; i < Fields.Count; i++) { if (i > 0) { InsertFieldsList += ", "; InsertValuesList += ", "; } InsertFieldsList += "[" + Fields[i].Name + "]"; InsertValuesList += "@" + Fields[i].CanonicalIdentifierName; Parameters[i] = new MSSQL.Parameter(Fields[i].CanonicalIdentifierName, Fields[i].DbType, 0, ParameterDirection.Input, Fields[i].Value); } string CommandText = "insert into [" + TableName + "] (" + InsertFieldsList + ") values (" + InsertValuesList + "); select isnull(cast(scope_identity() as bigint), -99999999)"; object objResult = MSSQL.ExecuteScalar(ConnectionString, CommandText, Parameters); if (objResult == null) { return -102; } Fields.Clear(); long Result = (long)objResult; if (Result == -99999999) { return 0; } return Result; }
public static int P_UserAdd(ref DataSet ds, long SiteID, string Name, string RealityName, string Password, string PasswordAdv, int CityID, string Sex, DateTime BirthDay, string IDCardNumber, string Address, string Email, bool isEmailValided, string QQ, bool isQQValided, string Telephone, string Mobile, bool isMobileValided, bool isPrivacy, short UserType, short BankType, string BankName, string BankCardNumber, long CommenderID, long CpsID, string AlipayName, string Memo, string VisitSource, ref long UserID, ref string ReturnDescription) { MSSQL.OutputParameter outputs = new MSSQL.OutputParameter(); MSSQL.Parameter[] paras = new MSSQL.Parameter[] { new MSSQL.Parameter("SiteID", SqlDbType.BigInt, 0, ParameterDirection.Input, SiteID), new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name), new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName), new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password), new MSSQL.Parameter("PasswordAdv", SqlDbType.VarChar, 0, ParameterDirection.Input, PasswordAdv), new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID), new MSSQL.Parameter("Sex", SqlDbType.VarChar, 0, ParameterDirection.Input, Sex), new MSSQL.Parameter("BirthDay", SqlDbType.DateTime, 0, ParameterDirection.Input, BirthDay), new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber), new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address), new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email), new MSSQL.Parameter("isEmailValided", SqlDbType.Bit, 0, ParameterDirection.Input, isEmailValided), new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ), new MSSQL.Parameter("isQQValided", SqlDbType.Bit, 0, ParameterDirection.Input, isQQValided), new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone), new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile), new MSSQL.Parameter("isMobileValided", SqlDbType.Bit, 0, ParameterDirection.Input, isMobileValided), new MSSQL.Parameter("isPrivacy", SqlDbType.Bit, 0, ParameterDirection.Input, isPrivacy), new MSSQL.Parameter("UserType", SqlDbType.SmallInt, 0, ParameterDirection.Input, UserType), new MSSQL.Parameter("BankType", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankType), new MSSQL.Parameter("BankName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankName), new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber), new MSSQL.Parameter("CommenderID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommenderID), new MSSQL.Parameter("CpsID", SqlDbType.BigInt, 0, ParameterDirection.Input, CpsID), new MSSQL.Parameter("AlipayName", SqlDbType.VarChar, 0, ParameterDirection.Input, AlipayName), new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo), new MSSQL.Parameter("VisitSource", SqlDbType.VarChar, 0, ParameterDirection.Input, VisitSource), new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, (long) UserID), new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription) }; int num = MSSQL.ExecuteStoredProcedureWithQuery("P_UserAdd", ref ds, ref outputs, paras); try { UserID = Convert.ToInt64(outputs["UserID"]); } catch(Exception ex) { Console.WriteLine(ex.Message); } try { ReturnDescription = Convert.ToString(outputs["ReturnDescription"]); } catch(Exception ex) { Console.WriteLine(ex.Message); } return num; }
public static int P_Login(ref DataSet ds, long SiteID, string Name, string InputPassword, string LoginIP, ref long UserID, ref string PasswordAdv, ref string RealityName, ref int CityID, ref string Sex, ref DateTime BirthDay, ref string IDCardNumber, ref string Address, ref string Email, ref bool isEmailValided, ref string QQ, ref bool isQQValided, ref string Telephone, ref string Mobile, ref bool isMobileValided, ref bool isPrivacy, ref bool isCanLogin, ref DateTime RegisterTime, ref DateTime LastLoginTime, ref string LastLoginIP, ref int LoginCount, ref short UserType, ref short BankType, ref string BankName, ref string BankCardNumber, ref double Balance, ref double CardPasswordM,ref double Freeze, ref double ScoringOfSelfBuy, ref double ScoringOfCommendBuy, ref double Scoring, ref short Level, ref long CommenderID, ref long CpsID, ref string AlipayID, ref string AlipayName, ref bool isAlipayNameValided, ref double Bonus, ref double Reward, ref string Memo, ref double BonusThisMonth, ref double BonusAllow, ref double BonusUse, ref double PromotionMemberBonusScale, ref double PromotionSiteBonusScale, ref int ReturnValue, ref string ReturnDescription) { MSSQL.OutputParameter outputs = new MSSQL.OutputParameter(); MSSQL.Parameter[] paras=new MSSQL.Parameter[] { new MSSQL.Parameter("SiteID", SqlDbType.BigInt, 0, ParameterDirection.Input, SiteID), new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name), new MSSQL.Parameter("InputPassword", SqlDbType.VarChar, 0, ParameterDirection.Input, InputPassword), new MSSQL.Parameter("LoginIP", SqlDbType.VarChar, 0, ParameterDirection.Input, LoginIP), new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, (long) UserID), new MSSQL.Parameter("PasswordAdv", SqlDbType.VarChar, 0x20, ParameterDirection.Output, PasswordAdv), new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 50, ParameterDirection.Output, RealityName), new MSSQL.Parameter("CityID", SqlDbType.Int, 4, ParameterDirection.Output, (int) CityID), new MSSQL.Parameter("Sex", SqlDbType.VarChar, 2, ParameterDirection.Output, Sex), new MSSQL.Parameter("BirthDay", SqlDbType.DateTime, 8, ParameterDirection.Output, (DateTime) BirthDay), new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, IDCardNumber), new MSSQL.Parameter("Address", SqlDbType.VarChar, 50, ParameterDirection.Output, Address), new MSSQL.Parameter("Email", SqlDbType.VarChar, 50, ParameterDirection.Output, Email), new MSSQL.Parameter("isEmailValided", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isEmailValided), new MSSQL.Parameter("QQ", SqlDbType.VarChar, 50, ParameterDirection.Output, QQ), new MSSQL.Parameter("isQQValided", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isQQValided), new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 50, ParameterDirection.Output, Telephone), new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 50, ParameterDirection.Output, Mobile), new MSSQL.Parameter("isMobileValided", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isMobileValided), new MSSQL.Parameter("isPrivacy", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isPrivacy), new MSSQL.Parameter("isCanLogin", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isCanLogin), new MSSQL.Parameter("RegisterTime", SqlDbType.DateTime, 8, ParameterDirection.Output, (DateTime) RegisterTime), new MSSQL.Parameter("LastLoginTime", SqlDbType.DateTime, 8, ParameterDirection.Output, (DateTime) LastLoginTime), new MSSQL.Parameter("LastLoginIP", SqlDbType.VarChar, 50, ParameterDirection.Output, LastLoginIP), new MSSQL.Parameter("LoginCount", SqlDbType.Int, 4, ParameterDirection.Output, (int) LoginCount), new MSSQL.Parameter("UserType", SqlDbType.SmallInt, 2, ParameterDirection.Output, (short) UserType), new MSSQL.Parameter("BankType", SqlDbType.SmallInt, 2, ParameterDirection.Output, (short) BankType), new MSSQL.Parameter("BankName", SqlDbType.VarChar, 50, ParameterDirection.Output, BankName), new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, BankCardNumber), new MSSQL.Parameter("Balance", SqlDbType.Money, 8, ParameterDirection.Output, (double) Balance),new MSSQL.Parameter("CardPassword", SqlDbType.Money, 8, ParameterDirection.Output, (double)CardPasswordM), new MSSQL.Parameter("Freeze", SqlDbType.Money, 8, ParameterDirection.Output, (double) Freeze), new MSSQL.Parameter("ScoringOfSelfBuy", SqlDbType.Float, 8, ParameterDirection.Output, (double) ScoringOfSelfBuy), new MSSQL.Parameter("ScoringOfCommendBuy", SqlDbType.Float, 8, ParameterDirection.Output, (double) ScoringOfCommendBuy), new MSSQL.Parameter("Scoring", SqlDbType.Float, 8, ParameterDirection.Output, (double) Scoring), new MSSQL.Parameter("Level", SqlDbType.SmallInt, 2, ParameterDirection.Output, (short) Level), new MSSQL.Parameter("CommenderID", SqlDbType.BigInt, 8, ParameterDirection.Output, (long) CommenderID), new MSSQL.Parameter("CpsID", SqlDbType.BigInt, 8, ParameterDirection.Output, (long) CpsID), new MSSQL.Parameter("AlipayID", SqlDbType.VarChar, 0x20, ParameterDirection.Output, AlipayID), new MSSQL.Parameter("AlipayName", SqlDbType.VarChar, 50, ParameterDirection.Output, AlipayName), new MSSQL.Parameter("isAlipayNameValided", SqlDbType.Bit, 1, ParameterDirection.Output, (bool) isAlipayNameValided), new MSSQL.Parameter("Bonus", SqlDbType.Money, 8, ParameterDirection.Output, (double) Bonus), new MSSQL.Parameter("Reward", SqlDbType.Money, 8, ParameterDirection.Output, (double) Reward), new MSSQL.Parameter("Memo", SqlDbType.VarChar, 50, ParameterDirection.Output, Memo), new MSSQL.Parameter("BonusThisMonth", SqlDbType.Money, 8, ParameterDirection.Output, (double) BonusThisMonth), new MSSQL.Parameter("BonusAllow", SqlDbType.Money, 8, ParameterDirection.Output, (double) BonusAllow), new MSSQL.Parameter("BonusUse", SqlDbType.Money, 8, ParameterDirection.Output, (double) BonusUse), new MSSQL.Parameter("PromotionMemberBonusScale", SqlDbType.Float, 8, ParameterDirection.Output, (double) PromotionMemberBonusScale), new MSSQL.Parameter("PromotionSiteBonusScale", SqlDbType.Float, 8, ParameterDirection.Output, (double) PromotionSiteBonusScale), new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, (int) ReturnValue), new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription) }; int num = MSSQL.ExecuteStoredProcedureWithQuery("P_Login", ref ds, ref outputs,paras ); try { UserID = Convert.ToInt64(outputs["UserID"]); } catch { } try { PasswordAdv = Convert.ToString(outputs["PasswordAdv"]); } catch { } try { RealityName = Convert.ToString(outputs["RealityName"]); } catch { } try { CityID = Convert.ToInt32(outputs["CityID"]); } catch { } try { Sex = Convert.ToString(outputs["Sex"]); } catch { } try { BirthDay = Convert.ToDateTime(outputs["BirthDay"]); } catch { } try { IDCardNumber = Convert.ToString(outputs["IDCardNumber"]); } catch { } try { Address = Convert.ToString(outputs["Address"]); } catch { } try { Email = Convert.ToString(outputs["Email"]); } catch { } try { isEmailValided = Convert.ToBoolean(outputs["isEmailValided"]); } catch { } try { QQ = Convert.ToString(outputs["QQ"]); } catch { } try { isQQValided = Convert.ToBoolean(outputs["isQQValided"]); } catch { } try { Telephone = Convert.ToString(outputs["Telephone"]); } catch { } try { Mobile = Convert.ToString(outputs["Mobile"]); } catch { } try { isMobileValided = Convert.ToBoolean(outputs["isMobileValided"]); } catch { } try { isPrivacy = Convert.ToBoolean(outputs["isPrivacy"]); } catch { } try { isCanLogin = Convert.ToBoolean(outputs["isCanLogin"]); } catch { } try { RegisterTime = Convert.ToDateTime(outputs["RegisterTime"]); } catch { } try { LastLoginTime = Convert.ToDateTime(outputs["LastLoginTime"]); } catch { } try { LastLoginIP = Convert.ToString(outputs["LastLoginIP"]); } catch { } try { LoginCount = Convert.ToInt32(outputs["LoginCount"]); } catch { } try { UserType = Convert.ToInt16(outputs["UserType"]); } catch { } try { BankType = Convert.ToInt16(outputs["BankType"]); } catch { } try { BankName = Convert.ToString(outputs["BankName"]); } catch { } try { BankCardNumber = Convert.ToString(outputs["BankCardNumber"]); } catch { } try { Balance = Convert.ToDouble(outputs["Balance"]); } catch { } try { Freeze = Convert.ToDouble(outputs["Freeze"]); } catch { } try { ScoringOfSelfBuy = Convert.ToDouble(outputs["ScoringOfSelfBuy"]); } catch { } try { ScoringOfCommendBuy = Convert.ToDouble(outputs["ScoringOfCommendBuy"]); } catch { } try { Scoring = Convert.ToDouble(outputs["Scoring"]); } catch { } try { Level = Convert.ToInt16(outputs["Level"]); } catch { } try { CommenderID = Convert.ToInt64(outputs["CommenderID"]); } catch { } try { CpsID = Convert.ToInt64(outputs["CpsID"]); } catch { } try { AlipayID = Convert.ToString(outputs["AlipayID"]); } catch { } try { AlipayName = Convert.ToString(outputs["AlipayName"]); } catch { } try { isAlipayNameValided = Convert.ToBoolean(outputs["isAlipayNameValided"]); } catch { } try { Bonus = Convert.ToDouble(outputs["Bonus"]); } catch { } try { Reward = Convert.ToDouble(outputs["Reward"]); } catch { } try { Memo = Convert.ToString(outputs["Memo"]); } catch { } try { BonusThisMonth = Convert.ToDouble(outputs["BonusThisMonth"]); } catch { } try { BonusAllow = Convert.ToDouble(outputs["BonusAllow"]); } catch { } try { BonusUse = Convert.ToDouble(outputs["BonusUse"]); } catch { } try { PromotionMemberBonusScale = Convert.ToDouble(outputs["PromotionMemberBonusScale"]); } catch { } try { PromotionSiteBonusScale = Convert.ToDouble(outputs["PromotionSiteBonusScale"]); } catch { } try { ReturnValue = Convert.ToInt32(outputs["ReturnValue"]); } catch { } try { ReturnDescription = Convert.ToString(outputs["ReturnDescription"]); } catch { } return num; }