Files
g.hnyhua.cn/Mtxfw.DAL/user_info.cs
2026-02-07 15:48:27 +08:00

2305 lines
115 KiB
C#

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
namespace Mtxfw.DAL
{
/// <summary>
/// 数据访问类:user_info
/// </summary>
public partial class user_info : Mtxfw.Utility.Myabstract
{
public user_info()
: base("user_info")
{ }
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(Mtxfw.Model.user_info model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into user_info(");
strSql.Append("MemberCard,UserName,Password,Password2,RealName,NCName,UserPic,Sex,SFZ,Mobile,Phone,Email,Province,City,County,MailingAddress,PostalCode,QQ,ProductName,CompanyName,CompanyTel,CompanyNumber,CompanyCert,CompanyPic,CompanyProvince,CompanyCity,CompanyCounty,Companyaddress,Companylatitude,Companylongitude,Companycontent,UserState,RegTime,RegTime2,SuperiorsID,SuperiorsIDS,ContactID,ContactIDS,RememberID,RememberIDS,DLRememberID,DLRememberIDS,SJRememberID,SJRememberIDS,umoney20,umoney21,uLevel,uLevel0,uLevel1,uLevel3,uLevel5,utype,uutype,openid,openid0,openid1,opentype,opentype2,session_key,unionid,refresh_token,refresh_token_time,IFUpUserName,IP,gtype)");
strSql.Append(" values (");
strSql.Append("@MemberCard,@UserName,@Password,@Password2,@RealName,@NCName,@UserPic,@Sex,@SFZ,@Mobile,@Phone,@Email,@Province,@City,@County,@MailingAddress,@PostalCode,@QQ,@ProductName,@CompanyName,@CompanyTel,@CompanyNumber,@CompanyCert,@CompanyPic,@CompanyProvince,@CompanyCity,@CompanyCounty,@Companyaddress,@Companylatitude,@Companylongitude,@Companycontent,@UserState,@RegTime,@RegTime2,@SuperiorsID,@SuperiorsIDS,@ContactID,@ContactIDS,@RememberID,@RememberIDS,@DLRememberID,@DLRememberIDS,@SJRememberID,@SJRememberIDS,@umoney20,@umoney21,@uLevel,@uLevel0,@uLevel1,@uLevel3,@uLevel5,@utype,@uutype,@openid,@openid0,@openid1,@opentype,@opentype2,@session_key,@unionid,@refresh_token,@refresh_token_time,@IFUpUserName,@IP,@gtype)");
strSql.Append(";select SCOPE_IDENTITY()");
SqlParameter[] parameters = {
new SqlParameter("@MemberCard", SqlDbType.VarChar,50),
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@Password", SqlDbType.VarChar,50),
new SqlParameter("@Password2", SqlDbType.VarChar,50),
new SqlParameter("@RealName", SqlDbType.VarChar,50),
new SqlParameter("@NCName", SqlDbType.VarChar,50),
new SqlParameter("@UserPic", SqlDbType.VarChar,250),
new SqlParameter("@Sex", SqlDbType.VarChar,50),
new SqlParameter("@SFZ", SqlDbType.VarChar,50),
new SqlParameter("@Mobile", SqlDbType.VarChar,50),
new SqlParameter("@Phone", SqlDbType.VarChar,50),
new SqlParameter("@Email", SqlDbType.VarChar,100),
new SqlParameter("@Province", SqlDbType.VarChar,50),
new SqlParameter("@City", SqlDbType.VarChar,50),
new SqlParameter("@County", SqlDbType.VarChar,50),
new SqlParameter("@MailingAddress", SqlDbType.VarChar,100),
new SqlParameter("@PostalCode", SqlDbType.VarChar,50),
new SqlParameter("@QQ", SqlDbType.VarChar,50),
new SqlParameter("@ProductName", SqlDbType.VarChar,2000),
new SqlParameter("@CompanyName", SqlDbType.VarChar,250),
new SqlParameter("@CompanyTel", SqlDbType.VarChar,20),
new SqlParameter("@CompanyNumber", SqlDbType.VarChar,250),
new SqlParameter("@CompanyCert", SqlDbType.VarChar,250),
new SqlParameter("@CompanyPic", SqlDbType.VarChar,8000),
new SqlParameter("@CompanyProvince", SqlDbType.VarChar,50),
new SqlParameter("@CompanyCity", SqlDbType.VarChar,50),
new SqlParameter("@CompanyCounty", SqlDbType.VarChar,50),
new SqlParameter("@Companyaddress", SqlDbType.VarChar,100),
new SqlParameter("@Companylatitude", SqlDbType.Decimal),
new SqlParameter("@Companylongitude", SqlDbType.Decimal),
new SqlParameter("@Companycontent", SqlDbType.VarChar,8000),
new SqlParameter("@UserState", SqlDbType.VarChar,50),
new SqlParameter("@RegTime", SqlDbType.DateTime),
new SqlParameter("@RegTime2", SqlDbType.DateTime),
new SqlParameter("@SuperiorsID", SqlDbType.Int),
new SqlParameter("@SuperiorsIDS", SqlDbType.VarChar,8000),
new SqlParameter("@ContactID", SqlDbType.Int),
new SqlParameter("@ContactIDS", SqlDbType.VarChar,8000),
new SqlParameter("@RememberID", SqlDbType.Int),
new SqlParameter("@RememberIDS", SqlDbType.VarChar,8000),
new SqlParameter("@DLRememberID", SqlDbType.Int),
new SqlParameter("@DLRememberIDS", SqlDbType.VarChar,8000),
new SqlParameter("@SJRememberID", SqlDbType.Int),
new SqlParameter("@SJRememberIDS", SqlDbType.VarChar,8000),
new SqlParameter("@umoney20", SqlDbType.Money),
new SqlParameter("@umoney21", SqlDbType.Money),
new SqlParameter("@uLevel", SqlDbType.Int),
new SqlParameter("@uLevel0", SqlDbType.Int),
new SqlParameter("@uLevel1", SqlDbType.Int),
new SqlParameter("@uLevel3", SqlDbType.Int),
new SqlParameter("@uLevel5", SqlDbType.Int),
new SqlParameter("@utype", SqlDbType.NVarChar,50),
new SqlParameter("@uutype", SqlDbType.NVarChar,50),
new SqlParameter("@openid", SqlDbType.VarChar,250),
new SqlParameter("@openid0", SqlDbType.VarChar,250),
new SqlParameter("@openid1", SqlDbType.VarChar,250),
new SqlParameter("@opentype", SqlDbType.Int),
new SqlParameter("@opentype2", SqlDbType.Int),
new SqlParameter("@session_key", SqlDbType.VarChar,250),
new SqlParameter("@unionid", SqlDbType.VarChar,250),
new SqlParameter("@refresh_token", SqlDbType.VarChar,250),
new SqlParameter("@refresh_token_time", SqlDbType.VarChar,50),
new SqlParameter("@IFUpUserName", SqlDbType.Int),
new SqlParameter("@IP", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)};
parameters[0].Value = model.MemberCard;
parameters[1].Value = model.UserName;
parameters[2].Value = model.Password;
parameters[3].Value = model.Password2;
parameters[4].Value = model.RealName;
parameters[5].Value = model.NCName;
parameters[6].Value = model.UserPic;
parameters[7].Value = model.Sex;
parameters[8].Value = model.SFZ;
parameters[9].Value = model.Mobile;
parameters[10].Value = model.Phone;
parameters[11].Value = model.Email;
parameters[12].Value = model.Province;
parameters[13].Value = model.City;
parameters[14].Value = model.County;
parameters[15].Value = model.MailingAddress;
parameters[16].Value = model.PostalCode;
parameters[17].Value = model.QQ;
parameters[18].Value = model.ProductName;
parameters[19].Value = model.CompanyName;
parameters[20].Value = model.CompanyTel;
parameters[21].Value = model.CompanyNumber;
parameters[22].Value = model.CompanyCert;
parameters[23].Value = model.CompanyPic;
parameters[24].Value = model.CompanyProvince;
parameters[25].Value = model.CompanyCity;
parameters[26].Value = model.CompanyCounty;
parameters[27].Value = model.Companyaddress;
parameters[28].Value = model.Companylatitude;
parameters[29].Value = model.Companylongitude;
parameters[30].Value = model.Companycontent;
parameters[31].Value = model.UserState;
parameters[32].Value = model.RegTime;
parameters[33].Value = model.RegTime2;
parameters[34].Value = model.SuperiorsID;
parameters[35].Value = model.SuperiorsIDS;
parameters[36].Value = model.ContactID;
parameters[37].Value = model.ContactIDS;
parameters[38].Value = model.RememberID;
parameters[39].Value = model.RememberIDS;
parameters[40].Value = model.DLRememberID;
parameters[41].Value = model.DLRememberIDS;
parameters[42].Value = model.SJRememberID;
parameters[43].Value = model.SJRememberIDS;
parameters[44].Value = model.umoney20;
parameters[45].Value = model.umoney21;
parameters[46].Value = model.uLevel;
parameters[47].Value = model.uLevel0;
parameters[48].Value = model.uLevel1;
parameters[49].Value = model.uLevel3;
parameters[50].Value = model.uLevel5;
parameters[51].Value = model.utype;
parameters[52].Value = model.uutype;
parameters[53].Value = model.openid;
parameters[54].Value = model.openid0;
parameters[55].Value = model.openid1;
parameters[56].Value = model.opentype;
parameters[57].Value = model.opentype2;
parameters[58].Value = model.session_key;
parameters[59].Value = model.unionid;
parameters[60].Value = model.refresh_token;
parameters[61].Value = model.refresh_token_time;
parameters[62].Value = model.IFUpUserName;
parameters[63].Value = model.IP;
parameters[64].Value = model.gtype;
string obj = Mtxfw.Utility.SqlDbHelper_U.GetObject(strSql.ToString(), parameters).ToString();
if (obj == "")
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool Update(Mtxfw.Model.user_info model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append("UserName=@UserName,");
strSql.Append("Password=@Password,");
strSql.Append("Password2=@Password2,");
strSql.Append("SuperiorsID=@SuperiorsID,");
strSql.Append("SuperiorsIDS=@SuperiorsIDS,");
strSql.Append("ContactID=@ContactID,");
strSql.Append("ContactIDS=@ContactIDS,");
strSql.Append("UserPic=@UserPic,");
strSql.Append("NCName=@NCName,");
strSql.Append("SJID=@SJID,");
strSql.Append("RealName=@RealName,");
strSql.Append("RealName2=@RealName2,");
strSql.Append("Sex=@Sex,");
strSql.Append("CSDate=@CSDate,");
strSql.Append("SFZ=@SFZ,");
strSql.Append("Mobile=@Mobile,");
strSql.Append("Phone=@Phone,");
strSql.Append("Phone2=@Phone2,");
strSql.Append("Email=@Email,");
strSql.Append("Province=@Province,");
strSql.Append("City=@City,");
strSql.Append("County=@County,");
strSql.Append("MailingAddress=@MailingAddress,");
strSql.Append("PostalCode=@PostalCode,");
strSql.Append("QQ=@QQ,");
strSql.Append("AliAccount=@AliAccount,");
strSql.Append("AliName=@AliName,");
strSql.Append("aliimage=@aliimage,");
strSql.Append("weixinimage=@weixinimage,");
strSql.Append("qbaddress=@qbaddress,");
strSql.Append("QBTime=@QBTime,");
strSql.Append("yedAccount=@yedAccount,");
strSql.Append("yedName=@yedName,");
strSql.Append("yedimage=@yedimage,");
strSql.Append("MTZNLConent=@MTZNLConent,");
strSql.Append("BBSConent=@BBSConent,");
strSql.Append("ProductName=@ProductName,");
strSql.Append("CompanyCls=@CompanyCls,");
strSql.Append("CompanyName=@CompanyName,");
strSql.Append("CompanyTel=@CompanyTel,");
strSql.Append("CompanyNumber=@CompanyNumber,");
strSql.Append("CompanyCert=@CompanyCert,");
strSql.Append("CompanyPic=@CompanyPic,");
strSql.Append("CompanyProvince=@CompanyProvince,");
strSql.Append("CompanyCity=@CompanyCity,");
strSql.Append("CompanyCounty=@CompanyCounty,");
strSql.Append("Companyaddress=@Companyaddress,");
strSql.Append("Companylatitude=@Companylatitude,");
strSql.Append("Companylongitude=@Companylongitude,");
strSql.Append("Companycontent=@Companycontent,");
strSql.Append("PayEWMPic1=@PayEWMPic1,");
strSql.Append("PayEWMPic2=@PayEWMPic2,");
strSql.Append("PayType=@PayType,");
strSql.Append("PayReason=@PayReason,");
strSql.Append("thumb_media_id=@thumb_media_id,");
strSql.Append("openid=@openid,");
strSql.Append("session_key=@session_key,");
strSql.Append("unionid=@unionid,");
strSql.Append("IFPhone=@IFPhone,");
strSql.Append("uLevel18=@uLevel18");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@Password", SqlDbType.VarChar,50),
new SqlParameter("@Password2", SqlDbType.VarChar,50),
new SqlParameter("@SuperiorsID", SqlDbType.Int),
new SqlParameter("@SuperiorsIDS", SqlDbType.VarChar,8000),
new SqlParameter("@ContactID", SqlDbType.Int),
new SqlParameter("@ContactIDS", SqlDbType.VarChar,8000),
new SqlParameter("@UserPic", SqlDbType.VarChar,250),
new SqlParameter("@NCName", SqlDbType.VarChar,50),
new SqlParameter("@SJID", SqlDbType.Int),
new SqlParameter("@RealName", SqlDbType.VarChar,50),
new SqlParameter("@RealName2", SqlDbType.VarChar,50),
new SqlParameter("@Sex", SqlDbType.VarChar,50),
new SqlParameter("@CSDate", SqlDbType.VarChar,50),
new SqlParameter("@SFZ", SqlDbType.VarChar,50),
new SqlParameter("@Mobile", SqlDbType.VarChar,50),
new SqlParameter("@Phone", SqlDbType.VarChar,50),
new SqlParameter("@Phone2", SqlDbType.VarChar,50),
new SqlParameter("@Email", SqlDbType.VarChar,50),
new SqlParameter("@Province", SqlDbType.VarChar,50),
new SqlParameter("@City", SqlDbType.VarChar,50),
new SqlParameter("@County", SqlDbType.VarChar,50),
new SqlParameter("@MailingAddress", SqlDbType.VarChar,100),
new SqlParameter("@PostalCode", SqlDbType.VarChar,50),
new SqlParameter("@QQ", SqlDbType.VarChar,50),
new SqlParameter("@AliAccount", SqlDbType.VarChar,50),
new SqlParameter("@AliName", SqlDbType.VarChar,50),
new SqlParameter("@aliimage", SqlDbType.VarChar,250),
new SqlParameter("@weixinimage", SqlDbType.VarChar,250),
new SqlParameter("@qbaddress", SqlDbType.VarChar,250),
new SqlParameter("@QBTime", SqlDbType.VarChar,50),
new SqlParameter("@yedAccount", SqlDbType.VarChar,50),
new SqlParameter("@yedName", SqlDbType.VarChar,50),
new SqlParameter("@yedimage", SqlDbType.VarChar,250),
new SqlParameter("@MTZNLConent", SqlDbType.VarChar,50),
new SqlParameter("@BBSConent", SqlDbType.VarChar,50),
new SqlParameter("@ProductName", SqlDbType.VarChar,250),
new SqlParameter("@CompanyCls", SqlDbType.VarChar,50),
new SqlParameter("@CompanyName", SqlDbType.VarChar,250),
new SqlParameter("@CompanyTel", SqlDbType.VarChar,20),
new SqlParameter("@CompanyNumber", SqlDbType.VarChar,250),
new SqlParameter("@CompanyCert", SqlDbType.VarChar,250),
new SqlParameter("@CompanyPic", SqlDbType.VarChar,8000),
new SqlParameter("@CompanyProvince", SqlDbType.VarChar,50),
new SqlParameter("@CompanyCity", SqlDbType.VarChar,50),
new SqlParameter("@CompanyCounty", SqlDbType.VarChar,50),
new SqlParameter("@Companyaddress", SqlDbType.VarChar,100),
new SqlParameter("@Companylatitude", SqlDbType.Decimal),
new SqlParameter("@Companylongitude", SqlDbType.Decimal),
new SqlParameter("@Companycontent", SqlDbType.VarChar,8000),
new SqlParameter("@PayEWMPic1", SqlDbType.VarChar,250),
new SqlParameter("@PayEWMPic2", SqlDbType.VarChar,250),
new SqlParameter("@PayType", SqlDbType.VarChar,250),
new SqlParameter("@PayReason", SqlDbType.VarChar,250),
new SqlParameter("@thumb_media_id", SqlDbType.VarChar,250),
new SqlParameter("@openid", SqlDbType.VarChar,250),
new SqlParameter("@session_key", SqlDbType.VarChar,250),
new SqlParameter("@unionid", SqlDbType.VarChar,250),
new SqlParameter("@IFPhone", SqlDbType.Int),
new SqlParameter("@uLevel18", SqlDbType.Int),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = model.UserName;
parameters[1].Value = model.Password;
parameters[2].Value = model.Password2;
parameters[3].Value = model.SuperiorsID;
parameters[4].Value = model.SuperiorsIDS;
parameters[5].Value = model.ContactID;
parameters[6].Value = model.ContactIDS;
parameters[7].Value = model.UserPic;
parameters[8].Value = model.NCName;
parameters[9].Value = model.SJID;
parameters[10].Value = model.RealName;
parameters[11].Value = model.RealName2;
parameters[12].Value = model.Sex;
parameters[13].Value = model.CSDate;
parameters[14].Value = model.SFZ;
parameters[15].Value = model.Mobile;
parameters[16].Value = model.Phone;
parameters[17].Value = model.Phone2;
parameters[18].Value = model.Email;
parameters[19].Value = model.Province;
parameters[20].Value = model.City;
parameters[21].Value = model.County;
parameters[22].Value = model.MailingAddress;
parameters[23].Value = model.PostalCode;
parameters[24].Value = model.QQ;
parameters[25].Value = model.AliAccount;
parameters[26].Value = model.AliName;
parameters[27].Value = model.aliimage;
parameters[28].Value = model.weixinimage;
parameters[29].Value = model.qbaddress;
parameters[30].Value = model.QBTime;
parameters[31].Value = model.yedAccount;
parameters[32].Value = model.yedName;
parameters[33].Value = model.yedimage;
parameters[34].Value = model.MTZNLConent;
parameters[35].Value = model.BBSConent;
parameters[36].Value = model.ProductName;
parameters[37].Value = model.CompanyCls;
parameters[38].Value = model.CompanyName;
parameters[39].Value = model.CompanyTel;
parameters[40].Value = model.CompanyNumber;
parameters[41].Value = model.CompanyCert;
parameters[42].Value = model.CompanyPic;
parameters[43].Value = model.CompanyProvince;
parameters[44].Value = model.CompanyCity;
parameters[45].Value = model.CompanyCounty;
parameters[46].Value = model.Companyaddress;
parameters[47].Value = model.Companylatitude;
parameters[48].Value = model.Companylongitude;
parameters[49].Value = model.Companycontent;
parameters[50].Value = model.PayEWMPic1;
parameters[51].Value = model.PayEWMPic2;
parameters[52].Value = model.PayType;
parameters[53].Value = model.PayReason;
parameters[54].Value = model.thumb_media_id;
parameters[55].Value = model.openid;
parameters[56].Value = model.session_key;
parameters[57].Value = model.unionid;
parameters[58].Value = model.IFPhone;
parameters[59].Value = model.uLevel18;
parameters[60].Value = model.Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuLevel(string LevelSel,int LevelSelValue,int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(LevelSel + "=@LevelSelValue");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuLevel(string LevelSel, int LevelSelValue, string where)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(LevelSel + "=@LevelSelValue");
strSql.Append(" where " + where);
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuLevel0(string LevelSel, int LevelSelValue, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(LevelSel + "=" + LevelSel + "+@LevelSelValue");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuLevel00(string LevelSel, int LevelSelValue, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(LevelSel + "=@LevelSelValue,regtime=getdate()");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuLevel4(string LevelSel, int LevelSelValue, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set uLevel4=@LevelSelValue," + LevelSel + "=getdate()");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateuDateTime(string DSel, int DSelValue, string DSel2, DateTime DSelValue2, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(DSel + "=@DSelValue");
strSql.Append("," + DSel2 + "=@DSelValue2");
strSql.Append(" where Id=@Id And " + DSel + "<>@DSelValue");
SqlParameter[] parameters = {
new SqlParameter("@DSelValue", SqlDbType.Int),
new SqlParameter("@DSelValue2", SqlDbType.DateTime),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = DSelValue;
parameters[1].Value = DSelValue2;
parameters[2].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool Updategui0()
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set umoney19=0,umoney21=0,uLevel4=0 where IFStores=0");
//strSql.Append("update user_info set uLevel27=uLevel21,videoids='' where IFStores=0");
//strSql.Append(";update user_info set uLevel19=0,uLevel20=0,uLevel21=0,uLevel22=0,uLevel23=0,umoney25=umoney24 where IFStores=0");
//strSql.Append(";update user_info set umoney24=0 where IFStores=0 and umoney24>0");
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 更新一条数据
/// </summary>
public bool UpdateSuperiorsIDSuLevel(string LevelSel, int LevelSelValue, string Sel2, string SelValue2, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(LevelSel + "=@LevelSelValue");
if (Sel2 != "")
{
strSql.Append("," + Sel2 + "=@SelValue2");
}
strSql.Append(" where (SuperiorsIDS Like '%," + Id + ",%' Or Id=@Id)");
SqlParameter[] parameters = {
new SqlParameter("@LevelSelValue", SqlDbType.Int),
new SqlParameter("@SelValue2", SqlDbType.VarChar,250),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = LevelSelValue;
parameters[1].Value = SelValue2;
parameters[2].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改密码
/// </summary>
public bool UpdatePassword(string PSel, string PSelValue, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(PSel + "=@PSelValue ");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@PSelValue", SqlDbType.Text),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = PSelValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改密码
/// </summary>
public bool UpdateTime(string PSel, DateTime dtValue, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(PSel + "=@dtValue ");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@dtValue", SqlDbType.DateTime),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = dtValue;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改uploadimages
/// </summary>
public bool Updateuploadimages(string uploadimages, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append("uploadimages=@uploadimages");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@uploadimages", SqlDbType.VarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = uploadimages;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 找回密码更新密码
/// </summary>
public bool UpdatePassword(string PSel, string PSelValue, string username)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ");
strSql.Append(PSel + "=@PSelValue ");
strSql.Append(" where username=@username");
SqlParameter[] parameters = {
new SqlParameter("@PSelValue", SqlDbType.VarChar,250),
new SqlParameter("@username", SqlDbType.VarChar,50)};
parameters[0].Value = PSelValue;
parameters[1].Value = username;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改LoginId
/// </summary>
public bool UpdateLoginId(string LoginId)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set IsOnline=0,LogoutTime=GetDate()," + LoginId + "='' where IFStores=0 and " + LoginId + "<>''");
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改接点人
/// </summary>
public bool UpdateJDR(int SuperiorsID, string SuperiorsIDS, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set SuperiorsID=@SuperiorsID,SuperiorsIDS=@SuperiorsIDS where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@SuperiorsID", SqlDbType.Int),
new SqlParameter("@SuperiorsIDS", SqlDbType.VarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = SuperiorsID;
parameters[1].Value = SuperiorsIDS;
parameters[2].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改接点人路径
/// </summary>
public bool UpdateSuperiorsIDS(string SuperiorsIDS, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set SuperiorsIDS=@SuperiorsIDS where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@SuperiorsIDS", SqlDbType.NVarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = SuperiorsIDS;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改推荐人
/// </summary>
public bool UpdateTJR(int ContactID, string ContactIDS, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ContactID=@ContactID,ContactIDS=@ContactIDS where Id=@Id");
SqlParameter[] parameters = {
//new SqlParameter("@YContactID", SqlDbType.Int),
new SqlParameter("@ContactID", SqlDbType.Int),
new SqlParameter("@ContactIDS", SqlDbType.VarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
//parameters[0].Value = YContactID;
parameters[0].Value = ContactID;
parameters[1].Value = ContactIDS;
parameters[2].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改接点人和推荐人
/// </summary>
public bool UpdateJDRAndTJR(int uLevel0, int SuperiorsID, string SuperiorsIDS, int uLevel1, int ContactID, string ContactIDS, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set uLevel0=uLevel0,SuperiorsID=@SuperiorsID,SuperiorsIDS=@SuperiorsIDS,uLevel1=uLevel1,ContactID=@ContactID,ContactIDS=@ContactIDS where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@uLevel0", SqlDbType.Int),
new SqlParameter("@SuperiorsID", SqlDbType.Int),
new SqlParameter("@SuperiorsIDS", SqlDbType.VarChar,8000),
new SqlParameter("@uLevel1", SqlDbType.Int),
new SqlParameter("@ContactID", SqlDbType.Int),
new SqlParameter("@ContactIDS", SqlDbType.VarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = uLevel0;
parameters[1].Value = SuperiorsID;
parameters[2].Value = SuperiorsIDS;
parameters[3].Value = uLevel0;
parameters[4].Value = ContactID;
parameters[5].Value = ContactIDS;
parameters[6].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 修改推荐人路径
/// </summary>
public bool UpdateContactIDS(string ContactIDS, int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set ContactIDS=@ContactIDS where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@ContactIDS", SqlDbType.NVarChar,8000),
new SqlParameter("@Id", SqlDbType.Int)};
parameters[0].Value = ContactIDS;
parameters[1].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool Delete(int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("delete from user_info ");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@Id", SqlDbType.Int,4)
};
parameters[0].Value = Id;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool DeleteSYHY(string uutype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("delete from user_info ");
strSql.Append(" where IFStores=0 And uLevel19=1 and uutype=@uutype");
SqlParameter[] parameters = {
new SqlParameter("@uutype", SqlDbType.VarChar,50)
};
parameters[0].Value = uutype;
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 删除一条数据
/// </summary>
public bool DeleteList(int dID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("delete from user_info ");
strSql.Append(" where charindex('," + dID + ",',SuperiorsIDS)>0 or id=" + dID);
int rows = Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString());
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModel(DataSet ds)
{
Mtxfw.Model.user_info model = new Mtxfw.Model.user_info();
if (ds.Tables[0].Rows.Count > 0)
{
model = new Mtxfw.Model.user_info();
if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
{
model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
}
model.MemberCard = ds.Tables[0].Rows[0]["MemberCard"].ToString();
model.UserName = ds.Tables[0].Rows[0]["UserName"].ToString();
model.Password = ds.Tables[0].Rows[0]["Password"].ToString();
model.Password2 = ds.Tables[0].Rows[0]["Password2"].ToString();
model.NCName = ds.Tables[0].Rows[0]["NCName"].ToString();
model.UserPic = ds.Tables[0].Rows[0]["UserPic"].ToString();
model.EWMPic = ds.Tables[0].Rows[0]["EWMPic"].ToString();
model.EWMPic2 = ds.Tables[0].Rows[0]["EWMPic2"].ToString();
model.EWMPic0 = ds.Tables[0].Rows[0]["EWMPic0"].ToString();
model.EWMPic1 = ds.Tables[0].Rows[0]["EWMPic1"].ToString();
model.EWMPic3 = ds.Tables[0].Rows[0]["EWMPic3"].ToString();
model.EWMPic4 = ds.Tables[0].Rows[0]["EWMPic4"].ToString();
model.SJID = Convert.ToInt32(ds.Tables[0].Rows[0]["SJID"].ToString());
model.PayEWMPic1 = ds.Tables[0].Rows[0]["PayEWMPic1"].ToString();
model.PayEWMPic2 = ds.Tables[0].Rows[0]["PayEWMPic2"].ToString();
model.PayType = ds.Tables[0].Rows[0]["PayType"].ToString();
model.PayReason = ds.Tables[0].Rows[0]["PayReason"].ToString();
model.thumb_media_id = ds.Tables[0].Rows[0]["thumb_media_id"].ToString();
model.MTZNLConent = ds.Tables[0].Rows[0]["MTZNLConent"].ToString();
model.BBSConent = ds.Tables[0].Rows[0]["BBSConent"].ToString();
model.RealName = ds.Tables[0].Rows[0]["RealName"].ToString();
model.Sex = ds.Tables[0].Rows[0]["Sex"].ToString();
model.CSDate = ds.Tables[0].Rows[0]["CSDate"].ToString();
model.SFZ = ds.Tables[0].Rows[0]["SFZ"].ToString();
model.Mobile = ds.Tables[0].Rows[0]["Mobile"].ToString();
model.Phone = ds.Tables[0].Rows[0]["Phone"].ToString();
model.RealName2 = ds.Tables[0].Rows[0]["RealName2"].ToString();
model.Phone2 = ds.Tables[0].Rows[0]["Phone2"].ToString();
model.Email = ds.Tables[0].Rows[0]["Email"].ToString();
model.Province = ds.Tables[0].Rows[0]["Province"].ToString();
model.City = ds.Tables[0].Rows[0]["City"].ToString();
model.County = ds.Tables[0].Rows[0]["County"].ToString();
model.MailingAddress = ds.Tables[0].Rows[0]["MailingAddress"].ToString();
model.PostalCode = ds.Tables[0].Rows[0]["PostalCode"].ToString();
model.QQ = ds.Tables[0].Rows[0]["QQ"].ToString();
model.AliAccount = ds.Tables[0].Rows[0]["AliAccount"].ToString();
model.AliName = ds.Tables[0].Rows[0]["AliName"].ToString();
model.aliimage = ds.Tables[0].Rows[0]["aliimage"].ToString();
model.weixinimage = ds.Tables[0].Rows[0]["weixinimage"].ToString();
model.qbaddress = ds.Tables[0].Rows[0]["qbaddress"].ToString();
model.QBTime = ds.Tables[0].Rows[0]["QBTime"].ToString();
model.yedAccount = ds.Tables[0].Rows[0]["yedAccount"].ToString();
model.yedName = ds.Tables[0].Rows[0]["yedName"].ToString();
model.yedimage = ds.Tables[0].Rows[0]["yedimage"].ToString();
model.ProductName = ds.Tables[0].Rows[0]["ProductName"].ToString();
model.CompanyCls = ds.Tables[0].Rows[0]["CompanyCls"].ToString();
model.CompanyName = ds.Tables[0].Rows[0]["CompanyName"].ToString();
model.CompanyTel = ds.Tables[0].Rows[0]["CompanyTel"].ToString();
model.CompanyNumber = ds.Tables[0].Rows[0]["CompanyNumber"].ToString();
model.CompanyCert = ds.Tables[0].Rows[0]["CompanyCert"].ToString();
model.CompanyPic = ds.Tables[0].Rows[0]["CompanyPic"].ToString();
model.CompanyProvince = ds.Tables[0].Rows[0]["CompanyProvince"].ToString();
model.CompanyCity = ds.Tables[0].Rows[0]["CompanyCity"].ToString();
model.CompanyCounty = ds.Tables[0].Rows[0]["CompanyCounty"].ToString();
model.Companyaddress = ds.Tables[0].Rows[0]["Companyaddress"].ToString();
model.Companylatitude = Convert.ToDecimal(ds.Tables[0].Rows[0]["Companylatitude"].ToString());
model.Companylongitude = Convert.ToDecimal(ds.Tables[0].Rows[0]["Companylongitude"].ToString());
model.Companycontent = ds.Tables[0].Rows[0]["Companycontent"].ToString();
model.UserState = ds.Tables[0].Rows[0]["UserState"].ToString();
if (ds.Tables[0].Rows[0]["RegTime"].ToString() != "")
{
model.RegTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["RegTime"].ToString());
}
if (ds.Tables[0].Rows[0]["RegTime1"].ToString() != "")
{
model.RegTime1 = Convert.ToDateTime(ds.Tables[0].Rows[0]["RegTime1"].ToString());
}
if (ds.Tables[0].Rows[0]["RegTime2"].ToString() != "")
{
model.RegTime2 = Convert.ToDateTime(ds.Tables[0].Rows[0]["RegTime2"].ToString());
}
model.ActivateBusID = int.Parse(ds.Tables[0].Rows[0]["ActivateBusID"].ToString());
model.LockBusID = int.Parse(ds.Tables[0].Rows[0]["LockBusID"].ToString());
if (ds.Tables[0].Rows[0]["SuperiorsID"].ToString() != "")
{
model.SuperiorsID = int.Parse(ds.Tables[0].Rows[0]["SuperiorsID"].ToString());
}
model.SuperiorsIDS = ds.Tables[0].Rows[0]["SuperiorsIDS"].ToString();
if (ds.Tables[0].Rows[0]["ContactID"].ToString() != "")
{
model.ContactID = int.Parse(ds.Tables[0].Rows[0]["ContactID"].ToString());
}
model.ContactIDS = ds.Tables[0].Rows[0]["ContactIDS"].ToString();
if (ds.Tables[0].Rows[0]["RememberID"].ToString() != "")
{
model.RememberID = int.Parse(ds.Tables[0].Rows[0]["RememberID"].ToString());
}
model.RememberIDS = ds.Tables[0].Rows[0]["RememberIDS"].ToString();
if (ds.Tables[0].Rows[0]["DLRememberID"].ToString() != "")
{
model.DLRememberID = int.Parse(ds.Tables[0].Rows[0]["DLRememberID"].ToString());
}
model.DLRememberIDS = ds.Tables[0].Rows[0]["DLRememberIDS"].ToString();
if (ds.Tables[0].Rows[0]["SJRememberID"].ToString() != "")
{
model.SJRememberID = int.Parse(ds.Tables[0].Rows[0]["SJRememberID"].ToString());
}
model.SJRememberIDS = ds.Tables[0].Rows[0]["SJRememberIDS"].ToString();
if (ds.Tables[0].Rows[0]["umoney"].ToString() != "")
{
model.umoney = Double.Parse(ds.Tables[0].Rows[0]["umoney"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney0"].ToString() != "")
{
model.umoney0 = Double.Parse(ds.Tables[0].Rows[0]["umoney0"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney1"].ToString() != "")
{
model.umoney1 = Double.Parse(ds.Tables[0].Rows[0]["umoney1"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney2"].ToString() != "")
{
model.umoney2 = Double.Parse(ds.Tables[0].Rows[0]["umoney2"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney3"].ToString() != "")
{
model.umoney3 = Double.Parse(ds.Tables[0].Rows[0]["umoney3"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney4"].ToString() != "")
{
model.umoney4 = Double.Parse(ds.Tables[0].Rows[0]["umoney4"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney5"].ToString() != "")
{
model.umoney5 = Double.Parse(ds.Tables[0].Rows[0]["umoney5"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney6"].ToString() != "")
{
model.umoney6 = Double.Parse(ds.Tables[0].Rows[0]["umoney6"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney7"].ToString() != "")
{
model.umoney7 = Double.Parse(ds.Tables[0].Rows[0]["umoney7"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney8"].ToString() != "")
{
model.umoney8 = Double.Parse(ds.Tables[0].Rows[0]["umoney8"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney9"].ToString() != "")
{
model.umoney9 = Double.Parse(ds.Tables[0].Rows[0]["umoney9"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney10"].ToString() != "")
{
model.umoney10 = Double.Parse(ds.Tables[0].Rows[0]["umoney10"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney11"].ToString() != "")
{
model.umoney11 = Double.Parse(ds.Tables[0].Rows[0]["umoney11"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney12"].ToString() != "")
{
model.umoney12 = Double.Parse(ds.Tables[0].Rows[0]["umoney12"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney13"].ToString() != "")
{
model.umoney13 = Double.Parse(ds.Tables[0].Rows[0]["umoney13"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney14"].ToString() != "")
{
model.umoney14 = Double.Parse(ds.Tables[0].Rows[0]["umoney14"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney15"].ToString() != "")
{
model.umoney15 = Double.Parse(ds.Tables[0].Rows[0]["umoney15"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney16"].ToString() != "")
{
model.umoney16 = Double.Parse(ds.Tables[0].Rows[0]["umoney16"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney17"].ToString() != "")
{
model.umoney17 = Double.Parse(ds.Tables[0].Rows[0]["umoney17"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney18"].ToString() != "")
{
model.umoney18 = Double.Parse(ds.Tables[0].Rows[0]["umoney18"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney19"].ToString() != "")
{
model.umoney19 = Double.Parse(ds.Tables[0].Rows[0]["umoney19"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney20"].ToString() != "")
{
model.umoney20 = Double.Parse(ds.Tables[0].Rows[0]["umoney20"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney21"].ToString() != "")
{
model.umoney21 = Double.Parse(ds.Tables[0].Rows[0]["umoney21"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney22"].ToString() != "")
{
model.umoney22 = Double.Parse(ds.Tables[0].Rows[0]["umoney22"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney23"].ToString() != "")
{
model.umoney23 = Double.Parse(ds.Tables[0].Rows[0]["umoney23"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney24"].ToString() != "")
{
model.umoney24 = Double.Parse(ds.Tables[0].Rows[0]["umoney24"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney25"].ToString() != "")
{
model.umoney25 = Double.Parse(ds.Tables[0].Rows[0]["umoney25"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney26"].ToString() != "")
{
model.umoney26 = Double.Parse(ds.Tables[0].Rows[0]["umoney26"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney27"].ToString() != "")
{
model.umoney27 = Double.Parse(ds.Tables[0].Rows[0]["umoney27"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney28"].ToString() != "")
{
model.umoney28 = Double.Parse(ds.Tables[0].Rows[0]["umoney28"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney29"].ToString() != "")
{
model.umoney29 = Double.Parse(ds.Tables[0].Rows[0]["umoney29"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney30"].ToString() != "")
{
model.umoney30 = Double.Parse(ds.Tables[0].Rows[0]["umoney30"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney31"].ToString() != "")
{
model.umoney31 = Double.Parse(ds.Tables[0].Rows[0]["umoney31"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney32"].ToString() != "")
{
model.umoney32 = Double.Parse(ds.Tables[0].Rows[0]["umoney32"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney33"].ToString() != "")
{
model.umoney33 = Double.Parse(ds.Tables[0].Rows[0]["umoney33"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney34"].ToString() != "")
{
model.umoney34 = Double.Parse(ds.Tables[0].Rows[0]["umoney34"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney35"].ToString() != "")
{
model.umoney35 = Double.Parse(ds.Tables[0].Rows[0]["umoney35"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney36"].ToString() != "")
{
model.umoney36 = Double.Parse(ds.Tables[0].Rows[0]["umoney36"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney37"].ToString() != "")
{
model.umoney37 = Double.Parse(ds.Tables[0].Rows[0]["umoney37"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney38"].ToString() != "")
{
model.umoney38 = Double.Parse(ds.Tables[0].Rows[0]["umoney38"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney39"].ToString() != "")
{
model.umoney39 = Double.Parse(ds.Tables[0].Rows[0]["umoney39"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney40"].ToString() != "")
{
model.umoney40 = Double.Parse(ds.Tables[0].Rows[0]["umoney40"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney41"].ToString() != "")
{
model.umoney41 = Double.Parse(ds.Tables[0].Rows[0]["umoney41"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney42"].ToString() != "")
{
model.umoney42 = Double.Parse(ds.Tables[0].Rows[0]["umoney42"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney43"].ToString() != "")
{
model.umoney43 = Double.Parse(ds.Tables[0].Rows[0]["umoney43"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney44"].ToString() != "")
{
model.umoney44 = Double.Parse(ds.Tables[0].Rows[0]["umoney44"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney45"].ToString() != "")
{
model.umoney45 = Double.Parse(ds.Tables[0].Rows[0]["umoney45"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney46"].ToString() != "")
{
model.umoney46 = Double.Parse(ds.Tables[0].Rows[0]["umoney46"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney47"].ToString() != "")
{
model.umoney47 = Double.Parse(ds.Tables[0].Rows[0]["umoney47"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney48"].ToString() != "")
{
model.umoney48 = Double.Parse(ds.Tables[0].Rows[0]["umoney48"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney49"].ToString() != "")
{
model.umoney49 = Double.Parse(ds.Tables[0].Rows[0]["umoney49"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney50"].ToString() != "")
{
model.umoney50 = Double.Parse(ds.Tables[0].Rows[0]["umoney50"].ToString());
}
if (ds.Tables[0].Rows[0]["umoney51"].ToString() != "")
{
model.umoney51 = Double.Parse(ds.Tables[0].Rows[0]["umoney51"].ToString());
}
model.umoney52 = Convert.ToDouble(ds.Tables[0].Rows[0]["umoney52"].ToString());
model.umoney53 = Convert.ToDouble(ds.Tables[0].Rows[0]["umoney53"].ToString());
model.umoney54 = Convert.ToDouble(ds.Tables[0].Rows[0]["umoney54"].ToString());
if (ds.Tables[0].Rows[0]["uLevel"].ToString() != "")
{
model.uLevel = int.Parse(ds.Tables[0].Rows[0]["uLevel"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel0"].ToString() != "")
{
model.uLevel0 = int.Parse(ds.Tables[0].Rows[0]["uLevel0"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel1"].ToString() != "")
{
model.uLevel1 = int.Parse(ds.Tables[0].Rows[0]["uLevel1"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel2"].ToString() != "")
{
model.uLevel2 = int.Parse(ds.Tables[0].Rows[0]["uLevel2"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel3"].ToString() != "")
{
model.uLevel3 = int.Parse(ds.Tables[0].Rows[0]["uLevel3"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel4"].ToString() != "")
{
model.uLevel4 = int.Parse(ds.Tables[0].Rows[0]["uLevel4"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel5"].ToString() != "")
{
model.uLevel5 = int.Parse(ds.Tables[0].Rows[0]["uLevel5"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel6"].ToString() != "")
{
model.uLevel6 = int.Parse(ds.Tables[0].Rows[0]["uLevel6"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel7"].ToString() != "")
{
model.uLevel7 = int.Parse(ds.Tables[0].Rows[0]["uLevel7"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel8"].ToString() != "")
{
model.uLevel8 = int.Parse(ds.Tables[0].Rows[0]["uLevel8"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel9"].ToString() != "")
{
model.uLevel9 = int.Parse(ds.Tables[0].Rows[0]["uLevel9"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel10"].ToString() != "")
{
model.uLevel10 = int.Parse(ds.Tables[0].Rows[0]["uLevel10"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel11"].ToString() != "")
{
model.uLevel11 = int.Parse(ds.Tables[0].Rows[0]["uLevel11"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel12"].ToString() != "")
{
model.uLevel12 = int.Parse(ds.Tables[0].Rows[0]["uLevel12"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel13"].ToString() != "")
{
model.uLevel13 = int.Parse(ds.Tables[0].Rows[0]["uLevel13"].ToString());
}
if (ds.Tables[0].Rows[0]["uLevel14"].ToString() != "")
{
model.uLevel14 = int.Parse(ds.Tables[0].Rows[0]["uLevel14"].ToString());
}
model.uLevel15 = int.Parse(ds.Tables[0].Rows[0]["uLevel15"].ToString());
model.uLevel16 = int.Parse(ds.Tables[0].Rows[0]["uLevel16"].ToString());
model.uLevel17 = int.Parse(ds.Tables[0].Rows[0]["uLevel17"].ToString());
model.uLevel18 = int.Parse(ds.Tables[0].Rows[0]["uLevel18"].ToString());
model.uLevel19 = int.Parse(ds.Tables[0].Rows[0]["uLevel19"].ToString());
model.uLevel20 = int.Parse(ds.Tables[0].Rows[0]["uLevel20"].ToString());
model.uLevel21 = int.Parse(ds.Tables[0].Rows[0]["uLevel21"].ToString());
model.uLevel22 = int.Parse(ds.Tables[0].Rows[0]["uLevel22"].ToString());
model.uLevel23 = int.Parse(ds.Tables[0].Rows[0]["uLevel23"].ToString());
model.uLevel24 = int.Parse(ds.Tables[0].Rows[0]["uLevel24"].ToString());
model.uLevel25 = int.Parse(ds.Tables[0].Rows[0]["uLevel25"].ToString());
model.uLevel26 = int.Parse(ds.Tables[0].Rows[0]["uLevel26"].ToString());
model.uLevel27 = int.Parse(ds.Tables[0].Rows[0]["uLevel27"].ToString());
model.uLevel28 = int.Parse(ds.Tables[0].Rows[0]["uLevel28"].ToString());
model.uLevel29 = int.Parse(ds.Tables[0].Rows[0]["uLevel29"].ToString());
model.uLevel30 = int.Parse(ds.Tables[0].Rows[0]["uLevel30"].ToString());
model.uLevel31 = int.Parse(ds.Tables[0].Rows[0]["uLevel31"].ToString());
model.uLevel32 = int.Parse(ds.Tables[0].Rows[0]["uLevel32"].ToString());
model.uLevel33 = int.Parse(ds.Tables[0].Rows[0]["uLevel33"].ToString());
model.uLevel34 = int.Parse(ds.Tables[0].Rows[0]["uLevel34"].ToString());
model.uLevel35 = int.Parse(ds.Tables[0].Rows[0]["uLevel35"].ToString());
model.uLevel36 = int.Parse(ds.Tables[0].Rows[0]["uLevel36"].ToString());
model.uLevel37 = int.Parse(ds.Tables[0].Rows[0]["uLevel37"].ToString());
model.uLevel38 = int.Parse(ds.Tables[0].Rows[0]["uLevel38"].ToString());
model.uLevel39 = int.Parse(ds.Tables[0].Rows[0]["uLevel39"].ToString());
model.uLevel40 = int.Parse(ds.Tables[0].Rows[0]["uLevel40"].ToString());
model.uLevel41 = int.Parse(ds.Tables[0].Rows[0]["uLevel41"].ToString());
model.uLevel42 = int.Parse(ds.Tables[0].Rows[0]["uLevel42"].ToString());
model.uLevel43 = int.Parse(ds.Tables[0].Rows[0]["uLevel43"].ToString());
model.uLevel44 = int.Parse(ds.Tables[0].Rows[0]["uLevel44"].ToString());
model.uLevel45 = int.Parse(ds.Tables[0].Rows[0]["uLevel45"].ToString());
model.uLevel46 = int.Parse(ds.Tables[0].Rows[0]["uLevel46"].ToString());
model.uLevel47 = int.Parse(ds.Tables[0].Rows[0]["uLevel47"].ToString());
model.uLevel48 = int.Parse(ds.Tables[0].Rows[0]["uLevel48"].ToString());
model.uLevel49 = int.Parse(ds.Tables[0].Rows[0]["uLevel49"].ToString());
model.uLevel50 = int.Parse(ds.Tables[0].Rows[0]["uLevel50"].ToString());
model.uLevel51 = int.Parse(ds.Tables[0].Rows[0]["uLevel51"].ToString());
model.uLevel52 = int.Parse(ds.Tables[0].Rows[0]["uLevel52"].ToString());
model.uLevel53 = int.Parse(ds.Tables[0].Rows[0]["uLevel53"].ToString());
model.uLevel54 = int.Parse(ds.Tables[0].Rows[0]["uLevel54"].ToString());
model.gmcount = int.Parse(ds.Tables[0].Rows[0]["gmcount"].ToString());
model.tjcount = int.Parse(ds.Tables[0].Rows[0]["tjcount"].ToString());
model.temcount = int.Parse(ds.Tables[0].Rows[0]["temcount"].ToString());
model.IFWCLFCPJL = int.Parse(ds.Tables[0].Rows[0]["IFWCLFCPJL"].ToString());
if (ds.Tables[0].Rows[0]["IFBecomeBusiness"].ToString() != "")
{
model.IFBecomeBusiness = int.Parse(ds.Tables[0].Rows[0]["IFBecomeBusiness"].ToString());
}
if (ds.Tables[0].Rows[0]["IFBecomeAgents"].ToString() != "")
{
model.IFBecomeAgents = int.Parse(ds.Tables[0].Rows[0]["IFBecomeAgents"].ToString());
}
if (ds.Tables[0].Rows[0]["BecomeBusinessTime"].ToString() != "")
{
model.BecomeBusinessTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["BecomeBusinessTime"].ToString());
}
if (ds.Tables[0].Rows[0]["BecomeAgentsTime"].ToString() != "")
{
model.BecomeAgentsTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["BecomeAgentsTime"].ToString());
}
if (ds.Tables[0].Rows[0]["Business_ylpercent"].ToString() != "")
{
model.Business_ylpercent = Convert.ToInt32(ds.Tables[0].Rows[0]["Business_ylpercent"].ToString());
}
if (ds.Tables[0].Rows[0]["ShippingID"].ToString() != "")
{
model.ShippingID = Convert.ToInt32(ds.Tables[0].Rows[0]["ShippingID"].ToString());
}
if (ds.Tables[0].Rows[0]["ProductShipped"].ToString() != "")
{
model.ProductShipped = Convert.ToInt32(ds.Tables[0].Rows[0]["ProductShipped"].ToString());
}
if (ds.Tables[0].Rows[0]["IFStores"].ToString() != "")
{
model.IFStores = Convert.ToInt32(ds.Tables[0].Rows[0]["IFStores"].ToString());
}
if (ds.Tables[0].Rows[0]["IFPhone"].ToString() != "")
{
model.IFPhone = Convert.ToInt32(ds.Tables[0].Rows[0]["IFPhone"].ToString());
}
if (ds.Tables[0].Rows[0]["PhoneCount"].ToString() != "")
{
model.PhoneCount = Convert.ToInt32(ds.Tables[0].Rows[0]["PhoneCount"].ToString());
}
model.PhoneNumber = ds.Tables[0].Rows[0]["PhoneNumber"].ToString();
if (ds.Tables[0].Rows[0]["PhoneTime"].ToString() != "")
{
model.PhoneTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["PhoneTime"].ToString());
}
else
{
model.PhoneTime = Convert.ToDateTime(DateTime.Now.AddDays(-1));
}
if (ds.Tables[0].Rows[0]["IFEditPhone"].ToString() != "")
{
model.IFEditPhone = Convert.ToInt32(ds.Tables[0].Rows[0]["IFEditPhone"].ToString());
}
if (ds.Tables[0].Rows[0]["IFEditName"].ToString() != "")
{
model.IFEditName = Convert.ToInt32(ds.Tables[0].Rows[0]["IFEditName"].ToString());
}
if (ds.Tables[0].Rows[0]["EditPhone"].ToString() != "")
{
model.EditPhone = ds.Tables[0].Rows[0]["EditPhone"].ToString();
}
if (ds.Tables[0].Rows[0]["EditName"].ToString() != "")
{
model.EditName = ds.Tables[0].Rows[0]["EditName"].ToString();
}
model.uploadimage = ds.Tables[0].Rows[0]["uploadimage"].ToString();
model.uploadimages = ds.Tables[0].Rows[0]["uploadimages"].ToString();
model.videoids = ds.Tables[0].Rows[0]["videoids"].ToString();
model.LoginId = ds.Tables[0].Rows[0]["LoginId"].ToString();
model.LoginId2 = ds.Tables[0].Rows[0]["LoginId2"].ToString();
model.registrationId = ds.Tables[0].Rows[0]["registrationId"].ToString();
model.IsAPPOnline = Convert.ToInt32(ds.Tables[0].Rows[0]["IsAPPOnline"].ToString());
model.latitude = Convert.ToDecimal(ds.Tables[0].Rows[0]["latitude"].ToString());
model.longitude = Convert.ToDecimal(ds.Tables[0].Rows[0]["longitude"].ToString());
if (ds.Tables[0].Rows[0]["StarTime1"].ToString() != "")
{
model.StarTime1 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime1"].ToString());
}
if (ds.Tables[0].Rows[0]["StarTime2"].ToString() != "")
{
model.StarTime2 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime2"].ToString());
}
if (ds.Tables[0].Rows[0]["StarTime3"].ToString() != "")
{
model.StarTime3 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime3"].ToString());
}
if (ds.Tables[0].Rows[0]["StarTime4"].ToString() != "")
{
model.StarTime4 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime4"].ToString());
}
if (ds.Tables[0].Rows[0]["StarTime5"].ToString() != "")
{
model.StarTime5 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime5"].ToString());
}
if (ds.Tables[0].Rows[0]["StarTime6"].ToString() != "")
{
model.StarTime6 = Convert.ToDateTime(ds.Tables[0].Rows[0]["StarTime6"].ToString());
}
model.ReDataTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["ReDataTime"].ToString());
model.xopenid = ds.Tables[0].Rows[0]["xopenid"].ToString();
model.openid = ds.Tables[0].Rows[0]["openid"].ToString();
model.openid0 = ds.Tables[0].Rows[0]["openid0"].ToString();
model.openid1 = ds.Tables[0].Rows[0]["openid1"].ToString();
model.xopenid0 = ds.Tables[0].Rows[0]["xopenid0"].ToString();
model.aopenid = ds.Tables[0].Rows[0]["aopenid"].ToString();
model.aopenid0 = ds.Tables[0].Rows[0]["aopenid0"].ToString();
model.aopenid1 = ds.Tables[0].Rows[0]["aopenid1"].ToString();
if (ds.Tables[0].Rows[0]["opentype"].ToString() != "")
{
model.opentype = Convert.ToInt32(ds.Tables[0].Rows[0]["opentype"].ToString());
}
if (ds.Tables[0].Rows[0]["opentype2"].ToString() != "")
{
model.opentype2 = Convert.ToInt32(ds.Tables[0].Rows[0]["opentype2"].ToString());
}
model.session_key = ds.Tables[0].Rows[0]["session_key"].ToString();
model.session_key0 = ds.Tables[0].Rows[0]["session_key0"].ToString();
model.session_key1 = ds.Tables[0].Rows[0]["session_key1"].ToString();
model.unionid = ds.Tables[0].Rows[0]["unionid"].ToString();
model.refresh_token = ds.Tables[0].Rows[0]["refresh_token"].ToString();
model.refresh_token_time = ds.Tables[0].Rows[0]["refresh_token_time"].ToString();
if (ds.Tables[0].Rows[0]["IFUpUserName"].ToString() != "")
{
model.IFUpUserName = Convert.ToInt32(ds.Tables[0].Rows[0]["IFUpUserName"].ToString());
}
model.LoginIP = ds.Tables[0].Rows[0]["LoginIP"].ToString();
if (ds.Tables[0].Rows[0]["LoginTime"].ToString() != "")
{
model.LoginTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["LoginTime"].ToString());
}
model.utype = ds.Tables[0].Rows[0]["utype"].ToString();
model.uutype = ds.Tables[0].Rows[0]["uutype"].ToString();
}
else
{
model = null;
}
return model;
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModel(int Id)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where Id=@Id");
SqlParameter[] parameters = {
new SqlParameter("@Id", SqlDbType.Int,4)
};
parameters[0].Value = Id;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModel(string UserName, int gtype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where gtype=@gtype and IFStores=0 And UserName=@UserName");
SqlParameter[] parameters = {
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)
};
parameters[0].Value = UserName;
parameters[1].Value = gtype;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModel(string UserName, string Phone,int gtype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where gtype=@gtype and IFStores=0 And UserName=@UserName And Phone=@Phone");
SqlParameter[] parameters = {
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@Phone", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)
};
parameters[0].Value = UserName;
parameters[1].Value = Phone;
parameters[2].Value = gtype;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModel0(string UserName, string Email, int gtype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where gtype=@gtype and IFStores=0 And UserName=@UserName And Email=@Email");
SqlParameter[] parameters = {
new SqlParameter("@UserName", SqlDbType.VarChar,50),
new SqlParameter("@Email", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)
};
parameters[0].Value = UserName;
parameters[1].Value = Email;
parameters[2].Value = gtype;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModelbyPhone(string Phone, int gtype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where gtype=@gtype and IFStores=0 And Phone=@Phone");
SqlParameter[] parameters = {
new SqlParameter("@Phone", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)
};
parameters[0].Value = Phone;
parameters[1].Value = gtype;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModelbyEmail(string Email, int gtype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where gtype=@gtype and IFStores=0 And Email=@Email");
SqlParameter[] parameters = {
new SqlParameter("@Email", SqlDbType.VarChar,50),
new SqlParameter("@gtype", SqlDbType.Int)
};
parameters[0].Value = Email;
parameters[1].Value = gtype;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// 得到一个对象实体
/// </summary>
public Mtxfw.Model.user_info GetModelbyopenid(string openid, int dltype)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select top 1 * from user_info ");
strSql.Append(" where " + (dltype == 3 ? "aopenid1" : dltype == 2 ? "aopenid0" : "openid") + "=@openid");
SqlParameter[] parameters = {
new SqlParameter("@openid", SqlDbType.VarChar,250)
};
parameters[0].Value = openid;
DataSet ds = Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString(), parameters);
return GetModel(ds);
}
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select * FROM user_info a");
if (strWhere.Trim() != "")
{
strSql.Append(" where " + strWhere);
}
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString());
}
/// <summary>
/// 获得前几行数据
/// </summary>
public DataSet GetList(int Top, string strWhere, string filedOrder)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select ");
if (Top > 0)
{
strSql.Append(" top " + Top.ToString());
}
strSql.Append(" * FROM user_info a");
if (strWhere.Trim() != "")
{
strSql.Append(" where " + strWhere);
}
strSql.Append(" order by " + filedOrder);
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet(strSql.ToString());
}
/// <summary>
/// 获得数据
/// </summary>
public DataSet GetUserList(string sqlw)
{
SqlParameter[] para = { new SqlParameter("@sqlw", SqlDbType.VarChar, 8000) };
para[0].Value = sqlw;
return Mtxfw.Utility.SqlDbHelper_U.GetDataSet("GetUserList", para);
}
/// <summary>
/// 判断用户名是否存在
/// </summary>
/// <returns></returns>
public bool IsExists(string UserName, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And UserName=@UserName";
SqlParameter[] para = { new SqlParameter("@UserName", SqlDbType.VarChar, 50),
new SqlParameter("@gtype", SqlDbType.Int)};
para[0].Value = UserName;
para[1].Value = gtype;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断邀请人用户名是否存在(前台注册)
/// </summary>
/// <returns></returns>
public bool IsExists2(string UserName,int t, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And UserName=@UserName And UserState='正常'";
if (t == 1)
{
sqlStr = "select top 1 * from user_info where gtype=@gtype And UserName=@UserName And UserState='正常' And uLevel2=2";
}
SqlParameter[] para = { new SqlParameter("@UserName", SqlDbType.VarChar, 50),
new SqlParameter("@gtype", SqlDbType.Int)};
para[0].Value = UserName;
para[1].Value = gtype;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断Email是否存在
/// </summary>
/// <returns></returns>
public bool IsExistsEmail(string UserEmail, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And Email=@UserEmail";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@UserEmail", SqlDbType.VarChar, 50) };
para[0].Value = gtype;
para[1].Value = UserEmail;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断用户名和Email是否存在
/// </summary>
/// <returns></returns>
public bool IsExistsUserAndEmail(string username, string UserEmail, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And username=@username And Email=@UserEmail";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@username", SqlDbType.VarChar, 50),
new SqlParameter("@UserEmail", SqlDbType.VarChar, 50)};
para[0].Value = gtype;
para[1].Value = username;
para[2].Value = UserEmail;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断用户名和手机号码是否存在
/// </summary>
/// <returns></returns>
public bool IsExistsUserAndmobile(string username, string Usermobile, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And username=@username And Phone=@Usermobile";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@username", SqlDbType.VarChar, 50),
new SqlParameter("@Usermobile", SqlDbType.VarChar, 50)};
para[0].Value = gtype;
para[1].Value = username;
para[2].Value = Usermobile;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断手机号码是否已存在
/// </summary>
/// <returns></returns>
public bool IsExistsmobile(string Usermobile, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And Phone=@Usermobile";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@Usermobile", SqlDbType.VarChar, 50)};
para[0].Value = gtype;
para[1].Value = Usermobile;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断手机号码是否已经被其它用户验证过
/// </summary>
/// <returns></returns>
public bool IsExistsmobile(int id, string Usermobile, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And id<>@id And Phone=@Usermobile and IFPhone=1";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@id", SqlDbType.VarChar, 50),
new SqlParameter("@Usermobile", SqlDbType.VarChar, 50)};
para[0].Value = gtype;
para[1].Value = id;
para[2].Value = Usermobile;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断卡号是否存在
/// </summary>
/// <returns></returns>
public bool IsExistsCar(string Card, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And membercard=@Card";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@Card", SqlDbType.VarChar, 50) };
para[0].Value = gtype;
para[1].Value = Card;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断卡号和密码正确
/// </summary>
/// <returns></returns>
public bool IsExistsCarAndPassword(string Card, string Password, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And membercard=@Card And Password=@Password";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@Card", SqlDbType.VarChar, 50),
new SqlParameter("@Password", SqlDbType.VarChar, 50) };
para[0].Value = gtype;
para[1].Value = Card;
para[2].Value = Password;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断卡号是否已被绑定
/// </summary>
/// <returns></returns>
public bool IsExistsCarBind(string Card, int gtype)
{
string sqlStr = "select top 1 * from user_info where gtype=@gtype And remembercard<>'' And membercard=@Card";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@Card", SqlDbType.VarChar, 50) };
para[0].Value = gtype;
para[1].Value = Card;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
if (Dr.HasRows)
{
Isbool = true;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 判断登陆(前台)
/// </summary>
public bool IsLoginWeb(int gtype, String AdminName, String AdminPwd, ref string MemberCard, ref int MemberId, ref int ContactID, ref int IFStores, ref string realname, ref string realname2, ref string phone, ref string phone2, ref string SFZ, ref string BBSConent, ref string CompanyCert, ref string NCName, ref string avatar, ref string SJRememberIDS, ref string ContactIDS, ref int IFUpUserName, ref int IFBecomeBusiness, ref int uutype, ref string MemberJS, ref int MemberuLevel, ref int MemberuLevel2, ref int MemberuLevel3, ref int MemberuLevel6, ref int MemberuLevel8, ref int MemberuLevel14, ref int MemberuLevel16, ref int MemberuLevel29, ref int MemberShippingID, ref int IFEditBank, ref int IFPhone, ref Double umoney, ref Double umoney15, ref Double umoney20, ref Double umoney22, ref Double umoney26, ref Double umoney28, ref Double umoney29, ref Double umoney30, ref Double umoney33, ref Double umoney39)
{
string sqlStr = "select top 1 Id,MemberCard,Password,Password2,ContactID,IFStores,IFPhone,realname,realname2,phone,phone2,SFZ,BBSConent,CompanyCert,NCName,UserPic,Sex,SJRememberIDS,ContactIDS,IFUpUserName,IFBecomeBusiness,uutype,uLevel,uLevel2,uLevel3,uLevel6,uLevel8,uLevel14,uLevel16,uLevel29,SJRememberID,ShippingID,umoney,umoney15,umoney16,umoney17,umoney20,umoney22,(umoney26-umoney27) as umoney26,umoney28,umoney29,umoney30,umoney31,umoney33,umoney39 from user_info where gtype=@gtype And (UserName=@UserName) and Password=@AdminPwd and UserState='正常'";
SqlParameter[] para = {new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@UserName", SqlDbType.VarChar, 50),
new SqlParameter("@AdminPwd", SqlDbType.VarChar, 200),
new SqlParameter("@phone", SqlDbType.VarChar, 50)};
para[0].Value = gtype;
para[1].Value = AdminName;
para[2].Value = AdminPwd;
para[3].Value = AdminName;
bool Isbool = false;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
if (Dr.Read())
{
Isbool = true;
MemberId = int.Parse(Dr["Id"].ToString());
ContactID = int.Parse(Dr["ContactID"].ToString());
IFStores = int.Parse(Dr["IFStores"].ToString());
MemberCard = Dr["MemberCard"].ToString();
NCName = Dr["NCName"].ToString();
realname = Dr["realname"].ToString();
realname2 = Dr["realname"].ToString();
phone = Dr["phone"].ToString();
phone2 = Dr["phone2"].ToString();
SFZ = Dr["SFZ"].ToString();
BBSConent = Dr["BBSConent"].ToString();
CompanyCert = Dr["CompanyCert"].ToString();
avatar = Dr["UserPic"].ToString();
SJRememberIDS = Dr["SJRememberIDS"].ToString();
ContactIDS = Dr["ContactIDS"].ToString();
IFPhone = int.Parse(Dr["IFPhone"].ToString());
IFUpUserName = int.Parse(Dr["IFUpUserName"].ToString());
IFBecomeBusiness = int.Parse(Dr["IFBecomeBusiness"].ToString());
uutype = int.Parse(Dr["uutype"].ToString());
MemberuLevel = int.Parse(Dr["uLevel"].ToString());
MemberuLevel2 = int.Parse(Dr["uLevel2"].ToString());
MemberuLevel3 = int.Parse(Dr["uLevel3"].ToString());
MemberuLevel6 = int.Parse(Dr["uLevel6"].ToString());
MemberuLevel8 = int.Parse(Dr["uLevel8"].ToString());
MemberuLevel14 = int.Parse(Dr["uLevel14"].ToString());
MemberuLevel16 = int.Parse(Dr["uLevel16"].ToString());
MemberuLevel29 = int.Parse(Dr["uLevel29"].ToString());
MemberShippingID = int.Parse(Dr["ShippingID"].ToString());
umoney = Convert.ToDouble(Dr["umoney"]) - Convert.ToDouble(Dr["umoney17"]);
umoney20 = Convert.ToDouble(Dr["umoney20"]);
umoney15 = Convert.ToDouble(Dr["umoney15"]);
umoney22 = Convert.ToDouble(Dr["umoney22"]);
umoney26 = Convert.ToDouble(Dr["umoney26"]);
umoney28 = Convert.ToDouble(Dr["umoney28"]);
umoney29 = Convert.ToDouble(Dr["umoney29"]);
umoney30 = Convert.ToDouble(Dr["umoney30"]);
umoney33 = Convert.ToDouble(Dr["umoney33"]);
umoney39 = Convert.ToDouble(Dr["umoney39"]);
if (IFStores == 1)
{
MemberJS = new DAL.Adminjs().GetModel(int.Parse(Dr["SJRememberID"].ToString())).js;
}
if (realname2 == "" || phone2 == "")
{
IFEditBank = 1;
}
}
Dr.Close();
return Isbool;
}
/// <summary>
/// 根据ID获取用户名
/// </summary>
public SqlDataReader GetUserName(int gtype, int MemberId)
{
string sqlStr = "select * from user_info where gtype=@gtype And ID=@MemberId";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@MemberId", SqlDbType.Int)};
para[0].Value = gtype;
para[1].Value = MemberId;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
return Dr;
}
/// <summary>
/// 根据ID获取用户名
/// </summary>
public SqlDataReader GetUserName2(int gtype, int MemberId, string strsj, string strsj2)
{
string strsql = "";
string yjsql1 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=0)", yjsql2 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=1)", yjsql3 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=2)";
if (strsj.Trim() != "" && strsj2.Trim() != "")
{
strsql = " and (d.addtime between '" + strsj.Trim() + " 00:00:00' and '" + strsj2.Trim() + " 23:59:59') ";
yjsql1 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=0) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=0))))";
yjsql2 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=1) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=1))))";
yjsql3 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=2) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=2))))";
}
string sqlStr = "select a.id,a.UserName,a.realname,a.ncname,a.uLevel,a.uLevel4,a.uLevel7,a.umoney19,a.umoney21 as umoney20,a.UserState,(select count(id) from user_info b where charindex(',' + Convert(varchar(50),a.id) + ',',b.SuperiorsIDS)>0 And b.uutype='0') as ucount," + yjsql1 + " as aumoney21," + yjsql2 + " as bumoney21," + yjsql3 + " as cumoney21 from user_info a where gtype=@gtype And a.ID=@MemberId And uutype='0'";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@MemberId", SqlDbType.Int) };
para[0].Value = MemberId;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
return Dr;
}
/// <summary>
/// 根据ID获取用户名
/// </summary>
public SqlDataReader GetUserName3(int gtype, int MemberId, int uLevel5, string strsj, string strsj2)
{
string strsql = "";
string yjsql1 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=0)", yjsql2 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=1)", yjsql3 = "(select (b.umoney19) from user_info b where b.uutype='0' And b.SuperiorsID=a.ID And b.uLevel5=2)";
if (strsj.Trim() != "" && strsj2.Trim() != "")
{
strsql = " and (d.addtime between '" + strsj.Trim() + " 00:00:00' and '" + strsj2.Trim() + " 23:59:59') ";
yjsql1 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=0) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=0))))";
yjsql2 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=1) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=1))))";
yjsql3 = "(select sum(d.Addmoney) from user_Results_jl2 d where d.utype=8 and d.Seef>0 and d.IFDelete=0" + strsql + " and d.MemberId in(select b.id from user_info b where (b.SuperiorsIDS like (select c.SuperiorsIDS+Convert(Varchar(50),c.id) + ',%' from user_info c where c.SuperiorsID=a.ID And c.uLevel5=2) Or b.id=(select c.id from user_info c where c.SuperiorsID=a.ID And c.uLevel5=2))))";
}
string sqlStr = "select top 3 a.id,a.UserName,a.realname,a.ncname,a.uLevel,a.uLevel4,a.uLevel7,a.umoney19,a.umoney21 as umoney20,a.UserState,(select count(id) from user_info b where charindex(',' + Convert(varchar(50),a.id) + ',',b.SuperiorsIDS)>0 And b.uutype='0') as ucount," + yjsql1 + " as aumoney21," + yjsql2 + " as bumoney21," + yjsql3 + " as cumoney21 from user_info a where gtype=@gtype And a.SuperiorsID=@MemberId And uutype='0' And uLevel5=@uLevel5 Order By uLevel5 Asc";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@MemberId", SqlDbType.Int),
new SqlParameter("@uLevel5", SqlDbType.Int)};
para[0].Value = MemberId;
para[1].Value = uLevel5;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
return Dr;
}
/// <summary>
/// 根据用户名获取ID
/// </summary>
public SqlDataReader GetUserId(int gtype, string UserName)
{
string sqlStr = "select * from user_info where gtype=@gtype And (membercard=@UserName Or UserName=@UserName)";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@UserName", SqlDbType.VarChar,50) };
para[0].Value = gtype;
para[1].Value = UserName;
SqlDataReader Dr = Mtxfw.Utility.SqlDbHelper_U.GetDataReader(sqlStr.ToString(), para);
return Dr;
}
/// <summary>
/// 获取最大卡号
/// </summary>
public Int64 GetMaxMemberCard(int gtype)
{
string sql = "select top 1 isnull(max(Convert(bigint,substring(MemberCard,3,len(MemberCard)))),0) from [user_info] where gtype=@gtype";
SqlParameter[] para = { new SqlParameter("@gtype", SqlDbType.Int)};
para[0].Value = gtype;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteScalar2(sql, para);
}
/// <summary>
/// 增加用户账户金额
/// </summary>
public int UpdateMoney(int gtype, string SelMoney, Double SelValueMoney)
{
String sql = "update [user_info] set " + SelMoney + "=" + SelMoney + "+@SelValueMoney where gtype=@gtype And uutype='0' And UserState='正常' And IFStores=0";
SqlParameter[] para = {new SqlParameter("@gtype", SqlDbType.Int),
new SqlParameter("@SelValueMoney", SqlDbType.Money)};
para[0].Value = gtype;
para[0].Value = SelValueMoney;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 增加用户账户金额
/// </summary>
public int UpdateMoney(string SelMoney, Double SelValueMoney, int Id)
{
String sql = "update [user_info] set " + SelMoney + "=" + SelMoney + "+@SelValueMoney where Id=@Id";
SqlParameter[] para = { new SqlParameter("@SelValueMoney", SqlDbType.Money),
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = SelValueMoney;
para[1].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新累计奖金
/// </summary>
public int UpdateMoney0(int Id)
{
String sql = "update [user_info] set umoney0=0,umoney1=0,umoney2=0,umoney3=0,umoney4=0,umoney5=0,umoney6=0,umoney7=0,umoney8=0,umoney9=0,umoney10=0,umoney11=0,umoney12=0,umoney13=0,umoney14=0 where Id=@Id";
SqlParameter[] para = {
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新销售业绩奖,销售业绩奖已对碰PV额
/// </summary>
public int UpdateMoney1(Double SelValueMoney, Double SelValueMoney2, int Id)
{
String sql = "update [user_info] set umoney4=umoney4+@SelValueMoney,umoney24=umoney24+@SelValueMoney2,umoney25=umoney25+@SelValueMoney2 where Id=@Id";
SqlParameter[] para = { new SqlParameter("@SelValueMoney", SqlDbType.Money),
new SqlParameter("@SelValueMoney2", SqlDbType.Money),
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = SelValueMoney;
para[1].Value = SelValueMoney2;
para[2].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新用户账户金额
/// </summary>
public int UpdateMoney2(string SelMoney, Double SelValueMoney, int Id)
{
String sql = "update [user_info] set " + SelMoney + "=@SelValueMoney where Id=@Id";
SqlParameter[] para = { new SqlParameter("@SelValueMoney", SqlDbType.Money),
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = SelValueMoney;
para[1].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 增加用户账户所有金额字段
/// </summary>
public int UpdateMoney(Double UMoney, Double UMoney0, Double UMoney1, Double UMoney2, Double UMoney3, Double UMoney4, Double UMoney5, Double UMoney6, Double UMoney7, Double UMoney8, Double UMoney9, Double UMoney10, Double UMoney11, Double UMoney13, Double UMoney14, Double UMoney16, Double UMoney18, Double UMoney20, Double UMoney21, int Id, int p)
{
String sql = "update [user_info] set umoney=umoney+@UMoney,umoney0=umoney0+@UMoney0,umoney1=umoney1+@UMoney1,umoney2=umoney2+@UMoney2,umoney3=umoney3+@UMoney3,umoney4=umoney4+@UMoney4,umoney5=umoney5+@UMoney5,umoney6=umoney6+@UMoney6,umoney7=umoney7+@UMoney7,umoney8=umoney8+@UMoney8,umoney9=umoney9+@UMoney9,umoney10=umoney10+@UMoney10,umoney11=umoney11+@UMoney11,umoney13=umoney13+@UMoney13,umoney14=umoney14+@UMoney14,umoney16=umoney16+@UMoney16,umoney18=umoney18+@UMoney18,umoney20=umoney20+@UMoney20,umoney21=umoney21+@UMoney21 where Id=@Id";
if (p == 1)
{
sql = "update [user_info] set umoney=@UMoney,umoney0=@UMoney0,umoney1=@UMoney1,umoney2=@UMoney2,umoney3=@UMoney3,umoney4=@UMoney4,umoney5=@UMoney5,umoney6=@UMoney6,umoney7=@UMoney7,umoney8=@UMoney8,umoney9=@UMoney9,umoney10=@UMoney10,umoney11=@UMoney11,umoney13=@UMoney13,umoney14=@UMoney14,umoney16=@UMoney16,umoney18=@UMoney18,umoney20=@UMoney20,umoney21=@UMoney21 where Id=@Id";
}
SqlParameter[] para = { new SqlParameter("@UMoney", SqlDbType.Money),
new SqlParameter("@UMoney0", SqlDbType.Money),
new SqlParameter("@UMoney1", SqlDbType.Money),
new SqlParameter("@UMoney2", SqlDbType.Money),
new SqlParameter("@UMoney3", SqlDbType.Money),
new SqlParameter("@UMoney4", SqlDbType.Money),
new SqlParameter("@UMoney5", SqlDbType.Money),
new SqlParameter("@UMoney6", SqlDbType.Money),
new SqlParameter("@UMoney7", SqlDbType.Money),
new SqlParameter("@UMoney8", SqlDbType.Money),
new SqlParameter("@UMoney9", SqlDbType.Money),
new SqlParameter("@UMoney10", SqlDbType.Money),
new SqlParameter("@UMoney11", SqlDbType.Money),
new SqlParameter("@UMoney13", SqlDbType.Money),
new SqlParameter("@UMoney14", SqlDbType.Money),
new SqlParameter("@UMoney16", SqlDbType.Money),
new SqlParameter("@UMoney18", SqlDbType.Money),
new SqlParameter("@UMoney20", SqlDbType.Money),
new SqlParameter("@UMoney21", SqlDbType.Money),
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = UMoney;
para[1].Value = UMoney0;
para[2].Value = UMoney1;
para[3].Value = UMoney2;
para[4].Value = UMoney3;
para[5].Value = UMoney4;
para[6].Value = UMoney5;
para[7].Value = UMoney6;
para[8].Value = UMoney7;
para[9].Value = UMoney8;
para[10].Value = UMoney9;
para[11].Value = UMoney10;
para[12].Value = UMoney11;
para[13].Value = UMoney13;
para[14].Value = UMoney14;
para[15].Value = UMoney16;
para[16].Value = UMoney18;
para[17].Value = UMoney20;
para[18].Value = UMoney21;
para[19].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新路径
/// </summary>
public void UpdateRememberIDS(String ReSel, String ReSelValue,int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set " + ReSel + "=@ReSelValue where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@ReSelValue", SqlDbType.NVarChar),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = ReSelValue;
parameters[1].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新手机验证时间
/// </summary>
public void UpdatePhoneTime(string PhoneNumber, DateTime PhoneTime, int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set PhoneCount=PhoneCount+1,PhoneNumber=@PhoneNumber,PhoneTime=@PhoneTime where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@PhoneNumber", SqlDbType.VarChar,50),
new SqlParameter("@PhoneTime", SqlDbType.DateTime),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = PhoneNumber;
parameters[1].Value = PhoneTime;
parameters[2].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新手机验证时间
/// </summary>
public void UpdatePhoneTime0(string PhoneNumber, DateTime PhoneTime, int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set PhoneCount=PhoneCount+1,PhoneNumber=@PhoneNumber,PhoneTime=@PhoneTime where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@PhoneNumber", SqlDbType.VarChar,50),
new SqlParameter("@PhoneTime", SqlDbType.DateTime),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = PhoneNumber;
parameters[1].Value = PhoneTime;
parameters[2].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新手机验证时间
/// </summary>
public void UpdatePhoneTime1(string EditPhone, string PhoneNumber, int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set PhoneCount=0,EditPhone=@EditPhone,PhoneNumber=@PhoneNumber where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@EditPhone", SqlDbType.VarChar,50),
new SqlParameter("@PhoneNumber", SqlDbType.VarChar,50),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = EditPhone;
parameters[1].Value = PhoneNumber;
parameters[2].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新手机验证时间
/// </summary>
public void UpdatePhoneTime2(string EditPhone, string PhoneNumber, int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set PhoneCount=0,EditPhone='',Phone=@EditPhone,PhoneNumber=@PhoneNumber where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@EditPhone", SqlDbType.VarChar,50),
new SqlParameter("@PhoneNumber", SqlDbType.VarChar,50),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = EditPhone;
parameters[1].Value = PhoneNumber;
parameters[2].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新手机验证时间
/// </summary>
public void UpdatePhoneTime3(string PhoneNumber, int ID)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update user_info set PhoneCount=0,PhoneNumber=@PhoneNumber where ID=@ID");
SqlParameter[] parameters = {
new SqlParameter("@PhoneNumber", SqlDbType.VarChar,50),
new SqlParameter("@ID", SqlDbType.Int)};
parameters[0].Value = PhoneNumber;
parameters[1].Value = ID;
Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(strSql.ToString(), parameters);
}
/// <summary>
/// 更新登录次数
/// </summary>
public int UpdateLogins(string LoginIP,string LoginId, int Id,int IFXCX)
{
String sql = "update [user_info] set IsOnline=1,Logins=Logins+1,LoginTime=GetDate(),LoginIP=@LoginIP,LoginId"+ (IFXCX==1?"2":"") + "=@LoginId,RefreshTime=GetDate() where Id=@Id";
SqlParameter[] para = { new SqlParameter("@LoginIP", SqlDbType.VarChar,50),
new SqlParameter("@LoginId", SqlDbType.VarChar,50),
new SqlParameter("@Id", SqlDbType.Int) };
para[0].Value = LoginIP;
para[1].Value = LoginId;
para[2].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新退出时间
/// </summary>
public int UpdateLogoutTime(int Id, string LoginId, int IFXCX)
{
String sql = "update [user_info] set IsOnline=0,LogoutTime=GetDate(),LoginId='' where Id=@Id And LoginId" + (IFXCX == 1 ? "2" : "") + "=@LoginId";
SqlParameter[] para = { new SqlParameter("@Id", SqlDbType.Int),
new SqlParameter("@LoginId", SqlDbType.VarChar, 50) };
para[0].Value = Id;
para[1].Value = LoginId;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新经纬度
/// </summary>
public int Updatelatitudelongitude(string latitude, string longitude, int Id)
{
String sql = "update [user_info] set latitude=@latitude,longitude=@longitude where Id=@Id";
SqlParameter[] para = {
new SqlParameter("@latitude", SqlDbType.Decimal),
new SqlParameter("@longitude", SqlDbType.Decimal, 50),
new SqlParameter("@Id", SqlDbType.Int)};
para[0].Value = latitude;
para[1].Value = longitude;
para[2].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
/// <summary>
/// 更新openid和opentype
/// </summary>
public int Updateopenid(string selopenid, string openid, int Id)
{
String sql = "update [user_info] set "+ selopenid + "=openid where Id=@Id";
SqlParameter[] para = {
new SqlParameter("@openid", SqlDbType.VarChar,100),
new SqlParameter("@Id", SqlDbType.Int)};
para[0].Value = openid;
para[1].Value = Id;
return Mtxfw.Utility.SqlDbHelper_U.ExecuteCmd(sql, para);
}
}
}