public int Update(Model.ObjectInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update ObjectInfo set "); strSql.Append("ObjectName=@ObjectName,IsTest=@IsTest,OnlineTime=@OnlineTime,OnOffTime=@OnOffTime,MobCount=@MobCount,OpenIdCount=@OpenIdCount,IpCount=@IpCount,NoStartText=@NoStartText,CStext=@CStext,EndText=@EndText,WHtext=@WHtext,Note=@Note "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@ObjectName", DbTool.FixSqlParameter(model.ObjectName)) , new SqlParameter("@IsTest", DbTool.FixSqlParameter(model.IsTest)) , new SqlParameter("@OnlineTime", DbTool.FixSqlParameter(model.OnlineTime)) , new SqlParameter("@OnOffTime", DbTool.FixSqlParameter(model.OnOffTime)) , new SqlParameter("@MobCount", DbTool.FixSqlParameter(model.MobCount)) , new SqlParameter("@OpenIdCount", DbTool.FixSqlParameter(model.OpenIdCount)) , new SqlParameter("@IpCount", DbTool.FixSqlParameter(model.IpCount)) , new SqlParameter("@NoStartText", DbTool.FixSqlParameter(model.NoStartText)) , new SqlParameter("@CStext", DbTool.FixSqlParameter(model.CStext)) , new SqlParameter("@EndText", DbTool.FixSqlParameter(model.EndText)) , new SqlParameter("@WHtext", DbTool.FixSqlParameter(model.WHtext)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Update(Model.DistanceModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Distance set "); strSql.Append("Lng=@Lng,Lat=@Lat,Province=@Province,City=@City,District=@District,Address=@Address,StorName=@StorName,Channel=@Channel,CreateTime=@CreateTime,StatusId=@StatusId,Describe=@Describe,Note=@Note "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Lng", DbTool.FixSqlParameter(model.Lng)) , new SqlParameter("@Lat", DbTool.FixSqlParameter(model.Lat)) , new SqlParameter("@Province", DbTool.FixSqlParameter(model.Province)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@District", DbTool.FixSqlParameter(model.District)) , new SqlParameter("@Address", DbTool.FixSqlParameter(model.Address)) , new SqlParameter("@StorName", DbTool.FixSqlParameter(model.StorName)) , new SqlParameter("@Channel", DbTool.FixSqlParameter(model.Channel)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@Describe", DbTool.FixSqlParameter(model.Describe)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Update(Model.AwardsStatisticsModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update AwardsStatistics set "); strSql.Append("AwardsId=@AwardsId,AwardsName=@AwardsName,DateStamp=@DateStamp,YesterdayTotal=@YesterdayTotal,TodayTotal=@TodayTotal,AllTotal=@AllTotal,BackTotal=@BackTotal,AwardsType=@AwardsType,PrizeName=@PrizeName,Angle=@Angle,PresetValue=@PresetValue,CreateTime=@CreateTime,UpdateTime=@UpdateTime,StatusId=@StatusId,Remark=@Remark "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@AwardsId", DbTool.FixSqlParameter(model.AwardsId)) , new SqlParameter("@AwardsName", DbTool.FixSqlParameter(model.AwardsName)) , new SqlParameter("@DateStamp", DbTool.FixSqlParameter(model.DateStamp)) , new SqlParameter("@YesterdayTotal", DbTool.FixSqlParameter(model.YesterdayTotal)) , new SqlParameter("@TodayTotal", DbTool.FixSqlParameter(model.TodayTotal)) , new SqlParameter("@AllTotal", DbTool.FixSqlParameter(model.AllTotal)) , new SqlParameter("@BackTotal", DbTool.FixSqlParameter(model.BackTotal)) , new SqlParameter("@AwardsType", DbTool.FixSqlParameter(model.AwardsType)) , new SqlParameter("@PrizeName", DbTool.FixSqlParameter(model.PrizeName)) , new SqlParameter("@Angle", DbTool.FixSqlParameter(model.Angle)) , new SqlParameter("@PresetValue", DbTool.FixSqlParameter(model.PresetValue)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.PassCodeInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [PassCodeInfo]"); strSql.Append("(Codes,CodeIndex,CodeName,OpenId,StatusId,CreateTime,ActiveTime,Mob,ActiveIp,EventId,CustomerId,Notes)"); strSql.Append(" values (@Codes,@CodeIndex,@CodeName,@OpenId,@StatusId,@CreateTime,@ActiveTime,@Mob,@ActiveIp,@EventId,@CustomerId,@Notes)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@Codes", DbTool.FixSqlParameter(model.Codes)) , new SqlParameter("@CodeIndex", DbTool.FixSqlParameter(model.CodeIndex)) , new SqlParameter("@CodeName", DbTool.FixSqlParameter(model.CodeName)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@ActiveTime", DbTool.FixSqlParameter(model.ActiveTime)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@ActiveIp", DbTool.FixSqlParameter(model.ActiveIp)) , new SqlParameter("@EventId", DbTool.FixSqlParameter(model.EventId)) , new SqlParameter("@CustomerId", DbTool.FixSqlParameter(model.CustomerId)) , new SqlParameter("@Notes", DbTool.FixSqlParameter(model.Notes)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.Operation_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Operation_Log set "); strSql.Append("Mobile=@Mobile,OrderCode=@OrderCode,LStatus=@LStatus,Status=@Status,OperationType=@OperationType,Description=@Description,CreateTime=@CreateTime,UpdateTime=@UpdateTime,UserName=@UserName,Remark=@Remark,HideContent=@HideContent "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Mobile", DbTool.FixSqlParameter(model.Mobile)) , new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@LStatus", DbTool.FixSqlParameter(model.LStatus)) , new SqlParameter("@Status", DbTool.FixSqlParameter(model.Status)) , new SqlParameter("@OperationType", DbTool.FixSqlParameter(model.OperationType)) , new SqlParameter("@Description", DbTool.FixSqlParameter(model.Description)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@UserName", DbTool.FixSqlParameter(model.UserName)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) , new SqlParameter("@HideContent", DbTool.FixSqlParameter(model.HideContent)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.Operation_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Operation_Log]"); strSql.Append("(Mobile,OrderCode,LStatus,Status,OperationType,Description,CreateTime,UpdateTime,UserName,Remark,HideContent)"); strSql.Append(" values (@Mobile,@OrderCode,@LStatus,@Status,@OperationType,@Description,@CreateTime,@UpdateTime,@UserName,@Remark,@HideContent)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@Mobile", DbTool.FixSqlParameter(model.Mobile)) , new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@LStatus", DbTool.FixSqlParameter(model.LStatus)) , new SqlParameter("@Status", DbTool.FixSqlParameter(model.Status)) , new SqlParameter("@OperationType", DbTool.FixSqlParameter(model.OperationType)) , new SqlParameter("@Description", DbTool.FixSqlParameter(model.Description)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@UserName", DbTool.FixSqlParameter(model.UserName)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) , new SqlParameter("@HideContent", DbTool.FixSqlParameter(model.HideContent)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Add(Model.AwardsStatisticsModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [AwardsStatistics]"); strSql.Append("(AwardsId,AwardsName,DateStamp,YesterdayTotal,TodayTotal,AllTotal,BackTotal,AwardsType,PrizeName,Angle,PresetValue,CreateTime,UpdateTime,StatusId,Remark)"); strSql.Append(" values (@AwardsId,@AwardsName,@DateStamp,@YesterdayTotal,@TodayTotal,@AllTotal,@BackTotal,@AwardsType,@PrizeName,@Angle,@PresetValue,@CreateTime,@UpdateTime,@StatusId,@Remark)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@AwardsId", DbTool.FixSqlParameter(model.AwardsId)) , new SqlParameter("@AwardsName", DbTool.FixSqlParameter(model.AwardsName)) , new SqlParameter("@DateStamp", DbTool.FixSqlParameter(model.DateStamp)) , new SqlParameter("@YesterdayTotal", DbTool.FixSqlParameter(model.YesterdayTotal)) , new SqlParameter("@TodayTotal", DbTool.FixSqlParameter(model.TodayTotal)) , new SqlParameter("@AllTotal", DbTool.FixSqlParameter(model.AllTotal)) , new SqlParameter("@BackTotal", DbTool.FixSqlParameter(model.BackTotal)) , new SqlParameter("@AwardsType", DbTool.FixSqlParameter(model.AwardsType)) , new SqlParameter("@PrizeName", DbTool.FixSqlParameter(model.PrizeName)) , new SqlParameter("@Angle", DbTool.FixSqlParameter(model.Angle)) , new SqlParameter("@PresetValue", DbTool.FixSqlParameter(model.PresetValue)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.PassCodeInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update PassCodeInfo set "); strSql.Append("Codes=@Codes,CodeIndex=@CodeIndex,CodeName=@CodeName,OpenId=@OpenId,StatusId=@StatusId,CreateTime=@CreateTime,ActiveTime=@ActiveTime,Mob=@Mob,ActiveIp=@ActiveIp,EventId=@EventId,CustomerId=@CustomerId,Notes=@Notes "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Codes", DbTool.FixSqlParameter(model.Codes)) , new SqlParameter("@CodeIndex", DbTool.FixSqlParameter(model.CodeIndex)) , new SqlParameter("@CodeName", DbTool.FixSqlParameter(model.CodeName)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@ActiveTime", DbTool.FixSqlParameter(model.ActiveTime)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@ActiveIp", DbTool.FixSqlParameter(model.ActiveIp)) , new SqlParameter("@EventId", DbTool.FixSqlParameter(model.EventId)) , new SqlParameter("@CustomerId", DbTool.FixSqlParameter(model.CustomerId)) , new SqlParameter("@Notes", DbTool.FixSqlParameter(model.Notes)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.DistanceModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Distance]"); strSql.Append("(Lng,Lat,Province,City,District,Address,StorName,Channel,CreateTime,StatusId,Describe,Note)"); strSql.Append(" values (@Lng,@Lat,@Province,@City,@District,@Address,@StorName,@Channel,@CreateTime,@StatusId,@Describe,@Note)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@Lng", DbTool.FixSqlParameter(model.Lng)) , new SqlParameter("@Lat", DbTool.FixSqlParameter(model.Lat)) , new SqlParameter("@Province", DbTool.FixSqlParameter(model.Province)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@District", DbTool.FixSqlParameter(model.District)) , new SqlParameter("@Address", DbTool.FixSqlParameter(model.Address)) , new SqlParameter("@StorName", DbTool.FixSqlParameter(model.StorName)) , new SqlParameter("@Channel", DbTool.FixSqlParameter(model.Channel)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@Describe", DbTool.FixSqlParameter(model.Describe)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Add(Model.LotteryErro_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [LotteryErro_Log]"); strSql.Append("(Ip,Mob,Code,OpenId,CreateTime,Types,LotErro,Pros,City,Note)"); strSql.Append(" values (@Ip,@Mob,@Code,@OpenId,@CreateTime,@Types,@LotErro,@Pros,@City,@Note)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@Types", DbTool.FixSqlParameter(model.Types)) , new SqlParameter("@LotErro", DbTool.FixSqlParameter(model.LotErro)) , new SqlParameter("@Pros", DbTool.FixSqlParameter(model.Pros)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.VerificationCodeModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update VerificationCode set "); strSql.Append("Code=@Code,Mobile=@Mobile,OpenId=@OpenId,CreateTime=@CreateTime,TimeStamp=@TimeStamp,Ip=@Ip,StatusId=@StatusId,ExpiryTime=@ExpiryTime,Remark=@Remark "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@Mobile", DbTool.FixSqlParameter(model.Mobile)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@TimeStamp", DbTool.FixSqlParameter(model.TimeStamp)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@StatusId", DbTool.FixSqlParameter(model.StatusId)) , new SqlParameter("@ExpiryTime", DbTool.FixSqlParameter(model.ExpiryTime)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Update(Model.VoteInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update VoteInfo set "); strSql.Append("OrderCode=@OrderCode,VoteDate=@VoteDate,VoteDt=@VoteDt,Ip=@Ip,VoteName=@VoteName,VoteOpid=@VoteOpid,VoteId=@VoteId,States=@States,OpenId=@OpenId,NickName=@NickName,NickImg=@NickImg "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@VoteDate", DbTool.FixSqlParameter(model.VoteDate)) , new SqlParameter("@VoteDt", DbTool.FixSqlParameter(model.VoteDt)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@VoteName", DbTool.FixSqlParameter(model.VoteName)) , new SqlParameter("@VoteOpid", DbTool.FixSqlParameter(model.VoteOpid)) , new SqlParameter("@VoteId", DbTool.FixSqlParameter(model.VoteId)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@NickName", DbTool.FixSqlParameter(model.NickName)) , new SqlParameter("@NickImg", DbTool.FixSqlParameter(model.NickImg)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.VoteInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [VoteInfo]"); strSql.Append("(OrderCode,VoteDate,VoteDt,Ip,VoteName,VoteOpid,VoteId,States,OpenId,NickName,NickImg)"); strSql.Append(" values (@OrderCode,@VoteDate,@VoteDt,@Ip,@VoteName,@VoteOpid,@VoteId,@States,@OpenId,@NickName,@NickImg)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@VoteDate", DbTool.FixSqlParameter(model.VoteDate)) , new SqlParameter("@VoteDt", DbTool.FixSqlParameter(model.VoteDt)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@VoteName", DbTool.FixSqlParameter(model.VoteName)) , new SqlParameter("@VoteOpid", DbTool.FixSqlParameter(model.VoteOpid)) , new SqlParameter("@VoteId", DbTool.FixSqlParameter(model.VoteId)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@NickName", DbTool.FixSqlParameter(model.NickName)) , new SqlParameter("@NickImg", DbTool.FixSqlParameter(model.NickImg)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Add(Model.Cj_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Cj_Log]"); strSql.Append("(OrderCode,OpenId,Mob,Jx,Jp,States,CTime,Ip,Pros,City,Adds,Code,Note)"); strSql.Append(" values (@OrderCode,@OpenId,@Mob,@Jx,@Jp,@States,@CTime,@Ip,@Pros,@City,@Adds,@Code,@Note)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@Jx", DbTool.FixSqlParameter(model.Jx)) , new SqlParameter("@Jp", DbTool.FixSqlParameter(model.Jp)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@CTime", DbTool.FixSqlParameter(model.CTime)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Pros", DbTool.FixSqlParameter(model.Pros)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Adds", DbTool.FixSqlParameter(model.Adds)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.Cj_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Cj_Log set "); strSql.Append("OrderCode=@OrderCode,OpenId=@OpenId,Mob=@Mob,Jx=@Jx,Jp=@Jp,States=@States,CTime=@CTime,Ip=@Ip,Pros=@Pros,City=@City,Adds=@Adds,Code=@Code,Note=@Note "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@Jx", DbTool.FixSqlParameter(model.Jx)) , new SqlParameter("@Jp", DbTool.FixSqlParameter(model.Jp)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@CTime", DbTool.FixSqlParameter(model.CTime)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Pros", DbTool.FixSqlParameter(model.Pros)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Adds", DbTool.FixSqlParameter(model.Adds)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.ObjectInfoModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [ObjectInfo]"); strSql.Append("(ObjectName,IsTest,OnlineTime,OnOffTime,MobCount,OpenIdCount,IpCount,NoStartText,CStext,EndText,WHtext,Note)"); strSql.Append(" values (@ObjectName,@IsTest,@OnlineTime,@OnOffTime,@MobCount,@OpenIdCount,@IpCount,@NoStartText,@CStext,@EndText,@WHtext,@Note)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@ObjectName", DbTool.FixSqlParameter(model.ObjectName)) , new SqlParameter("@IsTest", DbTool.FixSqlParameter(model.IsTest)) , new SqlParameter("@OnlineTime", DbTool.FixSqlParameter(model.OnlineTime)) , new SqlParameter("@OnOffTime", DbTool.FixSqlParameter(model.OnOffTime)) , new SqlParameter("@MobCount", DbTool.FixSqlParameter(model.MobCount)) , new SqlParameter("@OpenIdCount", DbTool.FixSqlParameter(model.OpenIdCount)) , new SqlParameter("@IpCount", DbTool.FixSqlParameter(model.IpCount)) , new SqlParameter("@NoStartText", DbTool.FixSqlParameter(model.NoStartText)) , new SqlParameter("@CStext", DbTool.FixSqlParameter(model.CStext)) , new SqlParameter("@EndText", DbTool.FixSqlParameter(model.EndText)) , new SqlParameter("@WHtext", DbTool.FixSqlParameter(model.WHtext)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.LotteryErro_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update LotteryErro_Log set "); strSql.Append("Ip=@Ip,Mob=@Mob,Code=@Code,OpenId=@OpenId,CreateTime=@CreateTime,Types=@Types,LotErro=@LotErro,Pros=@Pros,City=@City,Note=@Note "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@Types", DbTool.FixSqlParameter(model.Types)) , new SqlParameter("@LotErro", DbTool.FixSqlParameter(model.LotErro)) , new SqlParameter("@Pros", DbTool.FixSqlParameter(model.Pros)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int AddConfig(Model.ConfigModel model, Model.ConfigLogModel mdlog) { int rtn = 0; using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } using (SqlTransaction trans = conn.BeginTransaction()) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Config]"); strSql.Append("(TId,KId,Title,Val,Types,States,Sort,Remark)"); strSql.Append(" values (@TId,@KId,@Title,@Val,@Types,@States,@Sort,@Remark)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@TId", DbTool.FixSqlParameter(model.TId)), new SqlParameter("@KId", DbTool.FixSqlParameter(model.KId)) , new SqlParameter("@Title", DbTool.FixSqlParameter(model.Title)) , new SqlParameter("@Val", DbTool.FixSqlParameter(model.Val)) , new SqlParameter("@Types", DbTool.FixSqlParameter(model.Types)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@Sort", DbTool.FixSqlParameter(model.Sort)) , new SqlParameter("@Remark", DbTool.FixSqlParameter(model.Remark)) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql.ToString(), parameters); StringBuilder strSql2 = new StringBuilder(); strSql2.Append("insert into [ConfigLog]"); strSql2.Append("(ConfigId,UserId,Title,Note,CTime)"); strSql2.Append(" values (@ConfigId,@UserId,@Title,@Note,@CTime)"); strSql2.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters2 = { new SqlParameter("@ConfigId", DbTool.FixSqlParameter(mdlog.ConfigId)) , new SqlParameter("@UserId", DbTool.FixSqlParameter(mdlog.UserId)) , new SqlParameter("@Title", DbTool.FixSqlParameter(mdlog.Title)) , new SqlParameter("@Note", DbTool.FixSqlParameter(mdlog.Note)) , new SqlParameter("@CTime", DbTool.FixSqlParameter(mdlog.CTime)) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql2.ToString(), parameters2); trans.Commit(); return(rtn); } catch (Exception) { trans.Rollback(); rtn = 0; } } } return(0); }
public int Update(Model.FictitiousOrderModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update FictitiousOrder set "); strSql.Append("OrderCode=@OrderCode,OpenId=@OpenId,NickName=@NickName,HeadImgurl=@HeadImgurl,Texts=@Texts,FilesId=@FilesId,States=@States,Number=@Number,Name=@Name,Mob=@Mob,CreateTime=@CreateTime,Title=@Title,Age=@Age,Tdate=@Tdate,Jp=@Jp,Jx=@Jx,PrizeCode=@PrizeCode,IDCard=@IDCard,DateStamp=@DateStamp,Code=@Code,HbOrderCode=@HbOrderCode,Ip=@Ip,Types=@Types,Adds=@Adds,RedPackMoney=@RedPackMoney,MobHome=@MobHome,IpAddress=@IpAddress,Province=@Province,City=@City,Area=@Area,Sources=@Sources,UpdateTime=@UpdateTime,Account=@Account,Note=@Note,AwardId=@AwardId,RedAwardId=@RedAwardId,IsBack=@IsBack,IsGrant=@IsGrant,GrantTime=@GrantTime,IsThrottle=@IsThrottle "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@NickName", DbTool.FixSqlParameter(model.NickName)) , new SqlParameter("@HeadImgurl", DbTool.FixSqlParameter(model.HeadImgurl)) , new SqlParameter("@Texts", DbTool.FixSqlParameter(model.Texts)) , new SqlParameter("@FilesId", DbTool.FixSqlParameter(model.FilesId)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@Number", DbTool.FixSqlParameter(model.Number)) , new SqlParameter("@Name", DbTool.FixSqlParameter(model.Name)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@Title", DbTool.FixSqlParameter(model.Title)) , new SqlParameter("@Age", DbTool.FixSqlParameter(model.Age)) , new SqlParameter("@Tdate", DbTool.FixSqlParameter(model.Tdate)) , new SqlParameter("@Jp", DbTool.FixSqlParameter(model.Jp)) , new SqlParameter("@Jx", DbTool.FixSqlParameter(model.Jx)) , new SqlParameter("@PrizeCode", DbTool.FixSqlParameter(model.PrizeCode)) , new SqlParameter("@IDCard", DbTool.FixSqlParameter(model.IDCard)) , new SqlParameter("@DateStamp", DbTool.FixSqlParameter(model.DateStamp)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@HbOrderCode", DbTool.FixSqlParameter(model.HbOrderCode)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Types", DbTool.FixSqlParameter(model.Types)) , new SqlParameter("@Adds", DbTool.FixSqlParameter(model.Adds)) , new SqlParameter("@RedPackMoney", DbTool.FixSqlParameter(model.RedPackMoney)) , new SqlParameter("@MobHome", DbTool.FixSqlParameter(model.MobHome)) , new SqlParameter("@IpAddress", DbTool.FixSqlParameter(model.IpAddress)) , new SqlParameter("@Province", DbTool.FixSqlParameter(model.Province)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Area", DbTool.FixSqlParameter(model.Area)) , new SqlParameter("@Sources", DbTool.FixSqlParameter(model.Sources)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@Account", DbTool.FixSqlParameter(model.Account)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@AwardId", DbTool.FixSqlParameter(model.AwardId)) , new SqlParameter("@RedAwardId", DbTool.FixSqlParameter(model.RedAwardId)) , new SqlParameter("@IsBack", DbTool.FixSqlParameter(model.IsBack)) , new SqlParameter("@IsGrant", DbTool.FixSqlParameter(model.IsGrant)) , new SqlParameter("@GrantTime", DbTool.FixSqlParameter(model.GrantTime)) , new SqlParameter("@IsThrottle", DbTool.FixSqlParameter(model.IsThrottle)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.FictitiousOrderModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [FictitiousOrder]"); strSql.Append("(OrderCode,OpenId,NickName,HeadImgurl,Texts,FilesId,States,Number,Name,Mob,CreateTime,Title,Age,Tdate,Jp,Jx,PrizeCode,IDCard,DateStamp,Code,HbOrderCode,Ip,Types,Adds,RedPackMoney,MobHome,IpAddress,Province,City,Area,Sources,UpdateTime,Account,Note,AwardId,RedAwardId,IsBack,IsGrant,GrantTime,IsThrottle)"); strSql.Append(" values (@OrderCode,@OpenId,@NickName,@HeadImgurl,@Texts,@FilesId,@States,@Number,@Name,@Mob,@CreateTime,@Title,@Age,@Tdate,@Jp,@Jx,@PrizeCode,@IDCard,@DateStamp,@Code,@HbOrderCode,@Ip,@Types,@Adds,@RedPackMoney,@MobHome,@IpAddress,@Province,@City,@Area,@Sources,@UpdateTime,@Account,@Note,@AwardId,@RedAwardId,@IsBack,@IsGrant,@GrantTime,@IsThrottle)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@OrderCode", DbTool.FixSqlParameter(model.OrderCode)) , new SqlParameter("@OpenId", DbTool.FixSqlParameter(model.OpenId)) , new SqlParameter("@NickName", DbTool.FixSqlParameter(model.NickName)) , new SqlParameter("@HeadImgurl", DbTool.FixSqlParameter(model.HeadImgurl)) , new SqlParameter("@Texts", DbTool.FixSqlParameter(model.Texts)) , new SqlParameter("@FilesId", DbTool.FixSqlParameter(model.FilesId)) , new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@Number", DbTool.FixSqlParameter(model.Number)) , new SqlParameter("@Name", DbTool.FixSqlParameter(model.Name)) , new SqlParameter("@Mob", DbTool.FixSqlParameter(model.Mob)) , new SqlParameter("@CreateTime", DbTool.FixSqlParameter(model.CreateTime)) , new SqlParameter("@Title", DbTool.FixSqlParameter(model.Title)) , new SqlParameter("@Age", DbTool.FixSqlParameter(model.Age)) , new SqlParameter("@Tdate", DbTool.FixSqlParameter(model.Tdate)) , new SqlParameter("@Jp", DbTool.FixSqlParameter(model.Jp)) , new SqlParameter("@Jx", DbTool.FixSqlParameter(model.Jx)) , new SqlParameter("@PrizeCode", DbTool.FixSqlParameter(model.PrizeCode)) , new SqlParameter("@IDCard", DbTool.FixSqlParameter(model.IDCard)) , new SqlParameter("@DateStamp", DbTool.FixSqlParameter(model.DateStamp)) , new SqlParameter("@Code", DbTool.FixSqlParameter(model.Code)) , new SqlParameter("@HbOrderCode", DbTool.FixSqlParameter(model.HbOrderCode)) , new SqlParameter("@Ip", DbTool.FixSqlParameter(model.Ip)) , new SqlParameter("@Types", DbTool.FixSqlParameter(model.Types)) , new SqlParameter("@Adds", DbTool.FixSqlParameter(model.Adds)) , new SqlParameter("@RedPackMoney", DbTool.FixSqlParameter(model.RedPackMoney)) , new SqlParameter("@MobHome", DbTool.FixSqlParameter(model.MobHome)) , new SqlParameter("@IpAddress", DbTool.FixSqlParameter(model.IpAddress)) , new SqlParameter("@Province", DbTool.FixSqlParameter(model.Province)) , new SqlParameter("@City", DbTool.FixSqlParameter(model.City)) , new SqlParameter("@Area", DbTool.FixSqlParameter(model.Area)) , new SqlParameter("@Sources", DbTool.FixSqlParameter(model.Sources)) , new SqlParameter("@UpdateTime", DbTool.FixSqlParameter(model.UpdateTime)) , new SqlParameter("@Account", DbTool.FixSqlParameter(model.Account)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@AwardId", DbTool.FixSqlParameter(model.AwardId)) , new SqlParameter("@RedAwardId", DbTool.FixSqlParameter(model.RedAwardId)) , new SqlParameter("@IsBack", DbTool.FixSqlParameter(model.IsBack)) , new SqlParameter("@IsGrant", DbTool.FixSqlParameter(model.IsGrant)) , new SqlParameter("@GrantTime", DbTool.FixSqlParameter(model.GrantTime)) , new SqlParameter("@IsThrottle", DbTool.FixSqlParameter(model.IsThrottle)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Edit(Model.DelayedAwardsModel model, Model.OrderInfoModel OrderModel) { int rtn = 0; using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } using (SqlTransaction trans = conn.BeginTransaction()) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("update OrderInfo set "); strSql.Append("IsGrant=@IsGrant,GrantTime=@GrantTime,States=@States"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@IsGrant", DbTool.FixSqlParameter(OrderModel.IsGrant)) , new SqlParameter("@GrantTime", DbTool.FixSqlParameter(OrderModel.GrantTime)) , new SqlParameter("@States", DbTool.FixSqlParameter(OrderModel.States)) , new SqlParameter("@Id", OrderModel.Id) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql.ToString(), parameters); StringBuilder strSql2 = new StringBuilder(); strSql2.Append("update DelayedAwards set "); strSql2.Append("StatusId=@StatusId,UpdateTime=@UpdateTime"); strSql2.Append(" where Id=@Id "); SqlParameter[] parameters2 = { new SqlParameter("@StatusId", model.StatusId), new SqlParameter("@UpdateTime", model.UpdateTime), new SqlParameter("@Id", model.Id) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql2.ToString(), parameters2); if (rtn > 1) { trans.Commit(); return(rtn); } } catch (Exception) { trans.Rollback(); rtn = 0; } } } return(0); }
public int DelConfig(Model.ConfigModel model, Model.ConfigLogModel mdlog) { int rtn = 0; using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString)) { if (conn.State != ConnectionState.Open) { conn.Open(); } using (SqlTransaction trans = conn.BeginTransaction()) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from Config "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", model.Id) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql.ToString(), parameters); StringBuilder strSql2 = new StringBuilder(); strSql2.Append("insert into [ConfigLog]"); strSql2.Append("(ConfigId,UserId,Title,Note,CTime)"); strSql2.Append(" values (@ConfigId,@UserId,@Title,@Note,@CTime)"); strSql2.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters2 = { new SqlParameter("@ConfigId", DbTool.FixSqlParameter(mdlog.ConfigId)) , new SqlParameter("@UserId", DbTool.FixSqlParameter(mdlog.UserId)) , new SqlParameter("@Title", DbTool.FixSqlParameter(mdlog.Title)) , new SqlParameter("@Note", DbTool.FixSqlParameter(mdlog.Note)) , new SqlParameter("@CTime", DbTool.FixSqlParameter(mdlog.CTime)) }; rtn += SqlHelper.ExecuteNonQuery(trans, CommandType.Text, strSql2.ToString(), parameters2); trans.Commit(); return(rtn); } catch (Exception) { trans.Rollback(); rtn = 0; } } } return(0); }
public int UpdateStates(Model.ConfigModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Config set "); strSql.Append("States=@States "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@States", DbTool.FixSqlParameter(model.States)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public DataTable GetStorList(string lng, string lat, int km, int num) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT top (@num) * from [dbo].Distance a where (6371.004*ACOS(SIN(@GPSLat/180*PI())*SIN(a.Lat/180*PI())+COS(@GPSLat/180*PI())*COS(a.Lat/180*PI())*COS((@GPSLng-a.Lng)/180*PI())))<@km"); SqlParameter[] parameters = { new SqlParameter("@GPSLng", DbTool.ConvertObject <System.Decimal>(lng, 0)), new SqlParameter("@GPSLat", DbTool.ConvertObject <System.Decimal>(lat, 0)), new SqlParameter("@km", DbTool.FixSqlParameter(km)), new SqlParameter("@num", DbTool.FixSqlParameter(num)), }; DataTable ds = SqlHelper.ExecuteDataTable(conn, CommandType.Text, strSql.ToString(), parameters); return(ds); }
public int UpdateLngLat(Model.DistanceModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Distance set "); strSql.Append("Lng=@Lng,Lat=@Lat"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Lng", DbTool.FixSqlParameter(model.Lng)) , new SqlParameter("@Lat", DbTool.FixSqlParameter(model.Lat)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int UpdatePrizeNameById(Model.AwardsStatisticsModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update AwardsStatistics set "); strSql.Append("PrizeName=@PrizeName,PresetValue=@PresetValue"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@PrizeName", DbTool.FixSqlParameter(model.PrizeName)) , new SqlParameter("@PresetValue", DbTool.FixSqlParameter(model.PresetValue)) , new SqlParameter("@Id", model.Id) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.Login_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Login_Log]"); strSql.Append("(LoginTime,LoginIp,UserName,Notes)"); strSql.Append(" values (@LoginTime,@LoginIp,@UserName,@Notes)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@LoginTime", DbTool.FixSqlParameter(model.LoginTime)) , new SqlParameter("@LoginIp", DbTool.FixSqlParameter(model.LoginIp)) , new SqlParameter("@UserName", DbTool.FixSqlParameter(model.UserName)) , new SqlParameter("@Notes", DbTool.FixSqlParameter(model.Notes)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Update(Model.Login_LogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Login_Log set "); strSql.Append("LoginTime=@LoginTime,LoginIp=@LoginIp,UserName=@UserName "); strSql.Append(" where LogId=@LogId "); SqlParameter[] parameters = { new SqlParameter("@LoginTime", DbTool.FixSqlParameter(model.LoginTime)) , new SqlParameter("@LoginIp", DbTool.FixSqlParameter(model.LoginIp)) , new SqlParameter("@UserName", DbTool.FixSqlParameter(model.UserName)) , new SqlParameter("@LogId", model.LogId) }; return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, strSql.ToString(), parameters)); }
public int Add(Model.MsgConfigModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [MsgConfig]"); strSql.Append("(SupplierId,MsgType,MsgTitle,MsgTemp)"); strSql.Append(" values (@SupplierId,@MsgType,@MsgTitle,@MsgTemp)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@SupplierId", DbTool.FixSqlParameter(model.SupplierId)) , new SqlParameter("@MsgType", DbTool.FixSqlParameter(model.MsgType)) , new SqlParameter("@MsgTitle", DbTool.FixSqlParameter(model.MsgTitle)) , new SqlParameter("@MsgTemp", DbTool.FixSqlParameter(model.MsgTemp)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }
public int Add(Model.ConfigLogModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [ConfigLog]"); strSql.Append("(ConfigId,UserId,Title,Note,CTime)"); strSql.Append(" values (@ConfigId,@UserId,@Title,@Note,@CTime)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@ConfigId", DbTool.FixSqlParameter(model.ConfigId)) , new SqlParameter("@UserId", DbTool.FixSqlParameter(model.UserId)) , new SqlParameter("@Title", DbTool.FixSqlParameter(model.Title)) , new SqlParameter("@Note", DbTool.FixSqlParameter(model.Note)) , new SqlParameter("@CTime", DbTool.FixSqlParameter(model.CTime)) }; return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, strSql.ToString(), parameters), 0)); }