예제 #1
0
        protected Model.WebApiInterface_LogModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.WebApiInterface_LogModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("OrderId", fields))
            {
                model.OrderId = DbTool.ConvertObject <System.Int32>(dr["OrderId"]);
            }
            if (DbTool.HasFields("ResponseData", fields))
            {
                model.ResponseData = DbTool.ConvertObject <System.String>(dr["ResponseData"]);
            }
            if (DbTool.HasFields("CreateTime", fields))
            {
                model.CreateTime = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
            }
            if (DbTool.HasFields("StatusId", fields))
            {
                model.StatusId = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
            }
            if (DbTool.HasFields("Remark", fields))
            {
                model.Remark = DbTool.ConvertObject <System.String>(dr["Remark"]);
            }

            return(model);
        }
예제 #2
0
        protected Model.BehaviorLogModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.BehaviorLogModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("Ip", fields))
            {
                model.Ip = DbTool.ConvertObject <System.String>(dr["Ip"]);
            }
            if (DbTool.HasFields("BehaviorType", fields))
            {
                model.BehaviorType = DbTool.ConvertObject <System.Int32>(dr["BehaviorType"]);
            }
            if (DbTool.HasFields("FailureReason", fields))
            {
                model.FailureReason = DbTool.ConvertObject <System.String>(dr["FailureReason"]);
            }
            if (DbTool.HasFields("LockValue", fields))
            {
                model.LockValue = DbTool.ConvertObject <System.String>(dr["LockValue"]);
            }
            if (DbTool.HasFields("CreateTime", fields))
            {
                model.CreateTime = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
            }
            if (DbTool.HasFields("Remark", fields))
            {
                model.Remark = DbTool.ConvertObject <System.String>(dr["Remark"]);
            }

            return(model);
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
 protected void BindDataReader(Model.Login_LogModel model, SqlDataReader dr)
 {
     model.LogId     = DbTool.ConvertObject <System.Int32>(dr["LogId"]);
     model.LoginTime = DbTool.ConvertObject <System.DateTime>(dr["LoginTime"]);
     model.LoginIp   = DbTool.ConvertObject <System.String>(dr["LoginIp"]);
     model.UserName  = DbTool.ConvertObject <System.String>(dr["UserName"]);
 }
예제 #6
0
        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));
        }
예제 #7
0
        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));
        }
예제 #8
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));
        }
예제 #9
0
        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));
        }
예제 #10
0
        protected Model.DelayedAwardsModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.DelayedAwardsModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("OrderId", fields))
            {
                model.OrderId = DbTool.ConvertObject <System.Int32>(dr["OrderId"]);
            }
            if (DbTool.HasFields("StatusId", fields))
            {
                model.StatusId = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
            }
            if (DbTool.HasFields("CreateTime", fields))
            {
                model.CreateTime = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
            }
            if (DbTool.HasFields("DelayedTime", fields))
            {
                model.DelayedTime = DbTool.ConvertObject <System.DateTime>(dr["DelayedTime"]);
            }
            if (DbTool.HasFields("UpdateTime", fields))
            {
                model.UpdateTime = DbTool.ConvertObject <System.DateTime>(dr["UpdateTime"]);
            }
            if (DbTool.HasFields("Remark", fields))
            {
                model.Remark = DbTool.ConvertObject <System.String>(dr["Remark"]);
            }

            return(model);
        }
예제 #11
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));
        }
예제 #12
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));
        }
예제 #13
0
        protected Model.ConfigLogModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.ConfigLogModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("ConfigId", fields))
            {
                model.ConfigId = DbTool.ConvertObject <System.Int32>(dr["ConfigId"]);
            }
            if (DbTool.HasFields("UserId", fields))
            {
                model.UserId = DbTool.ConvertObject <System.Int32>(dr["UserId"]);
            }
            if (DbTool.HasFields("Title", fields))
            {
                model.Title = DbTool.ConvertObject <System.String>(dr["Title"]);
            }
            if (DbTool.HasFields("Note", fields))
            {
                model.Note = DbTool.ConvertObject <System.String>(dr["Note"]);
            }
            if (DbTool.HasFields("CTime", fields))
            {
                model.CTime = DbTool.ConvertObject <System.DateTime>(dr["CTime"]);
            }

            return(model);
        }
예제 #14
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));
        }
예제 #15
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));
        }
예제 #16
0
        protected Model.SourceInfoModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.SourceInfoModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("Ip", fields))
            {
                model.Ip = DbTool.ConvertObject <System.String>(dr["Ip"]);
            }
            if (DbTool.HasFields("Pros", fields))
            {
                model.Pros = DbTool.ConvertObject <System.String>(dr["Pros"]);
            }
            if (DbTool.HasFields("City", fields))
            {
                model.City = DbTool.ConvertObject <System.String>(dr["City"]);
            }
            if (DbTool.HasFields("SourceUrl", fields))
            {
                model.SourceUrl = DbTool.ConvertObject <System.String>(dr["SourceUrl"]);
            }
            if (DbTool.HasFields("Dtime", fields))
            {
                model.Dtime = DbTool.ConvertObject <System.DateTime>(dr["Dtime"]);
            }
            if (DbTool.HasFields("Type", fields))
            {
                model.Type = DbTool.ConvertObject <System.String>(dr["Type"]);
            }

            return(model);
        }
예제 #17
0
        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));
        }
예제 #18
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));
        }
예제 #19
0
파일: Cj_LogDal.cs 프로젝트: quwujin/SM297
        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));
        }
예제 #20
0
        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));
        }
예제 #21
0
        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));
        }
예제 #22
0
파일: Cj_LogDal.cs 프로젝트: quwujin/SM297
        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));
        }
예제 #23
0
        protected Model.MsgConfigModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.MsgConfigModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("SupplierId", fields))
            {
                model.SupplierId = DbTool.ConvertObject <System.Int32>(dr["SupplierId"]);
            }
            if (DbTool.HasFields("MsgType", fields))
            {
                model.MsgType = DbTool.ConvertObject <System.String>(dr["MsgType"]);
            }
            if (DbTool.HasFields("MsgTitle", fields))
            {
                model.MsgTitle = DbTool.ConvertObject <System.String>(dr["MsgTitle"]);
            }
            if (DbTool.HasFields("MsgTemp", fields))
            {
                model.MsgTemp = DbTool.ConvertObject <System.String>(dr["MsgTemp"]);
            }

            return(model);
        }
예제 #24
0
        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));
        }
예제 #25
0
        protected Model.PassCodeInfoModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.PassCodeInfoModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("Codes", fields))
            {
                model.Codes = DbTool.ConvertObject <System.String>(dr["Codes"]);
            }
            if (DbTool.HasFields("CodeIndex", fields))
            {
                model.CodeIndex = DbTool.ConvertObject <System.String>(dr["CodeIndex"]);
            }
            if (DbTool.HasFields("CodeName", fields))
            {
                model.CodeName = DbTool.ConvertObject <System.String>(dr["CodeName"]);
            }
            if (DbTool.HasFields("OpenId", fields))
            {
                model.OpenId = DbTool.ConvertObject <System.String>(dr["OpenId"]);
            }
            if (DbTool.HasFields("StatusId", fields))
            {
                model.StatusId = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
            }
            if (DbTool.HasFields("CreateTime", fields))
            {
                model.CreateTime = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
            }
            if (DbTool.HasFields("ActiveTime", fields))
            {
                model.ActiveTime = DbTool.ConvertObject <System.DateTime>(dr["ActiveTime"]);
            }
            if (DbTool.HasFields("Mob", fields))
            {
                model.Mob = DbTool.ConvertObject <System.String>(dr["Mob"]);
            }
            if (DbTool.HasFields("ActiveIp", fields))
            {
                model.ActiveIp = DbTool.ConvertObject <System.String>(dr["ActiveIp"]);
            }
            if (DbTool.HasFields("EventId", fields))
            {
                model.EventId = DbTool.ConvertObject <System.Int32>(dr["EventId"]);
            }
            if (DbTool.HasFields("CustomerId", fields))
            {
                model.CustomerId = DbTool.ConvertObject <System.Int32>(dr["CustomerId"]);
            }
            if (DbTool.HasFields("Notes", fields))
            {
                model.Notes = DbTool.ConvertObject <System.String>(dr["Notes"]);
            }

            return(model);
        }
예제 #26
0
        protected Model.ObjectInfoModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.ObjectInfoModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("ObjectName", fields))
            {
                model.ObjectName = DbTool.ConvertObject <System.String>(dr["ObjectName"]);
            }
            if (DbTool.HasFields("IsTest", fields))
            {
                model.IsTest = DbTool.ConvertObject <System.Int32>(dr["IsTest"]);
            }
            if (DbTool.HasFields("OnlineTime", fields))
            {
                model.OnlineTime = DbTool.ConvertObject <System.DateTime>(dr["OnlineTime"]);
            }
            if (DbTool.HasFields("OnOffTime", fields))
            {
                model.OnOffTime = DbTool.ConvertObject <System.DateTime>(dr["OnOffTime"]);
            }
            if (DbTool.HasFields("MobCount", fields))
            {
                model.MobCount = DbTool.ConvertObject <System.Int32>(dr["MobCount"]);
            }
            if (DbTool.HasFields("OpenIdCount", fields))
            {
                model.OpenIdCount = DbTool.ConvertObject <System.Int32>(dr["OpenIdCount"]);
            }
            if (DbTool.HasFields("IpCount", fields))
            {
                model.IpCount = DbTool.ConvertObject <System.Int32>(dr["IpCount"]);
            }
            if (DbTool.HasFields("NoStartText", fields))
            {
                model.NoStartText = DbTool.ConvertObject <System.String>(dr["NoStartText"]);
            }
            if (DbTool.HasFields("CStext", fields))
            {
                model.CStext = DbTool.ConvertObject <System.String>(dr["CStext"]);
            }
            if (DbTool.HasFields("EndText", fields))
            {
                model.EndText = DbTool.ConvertObject <System.String>(dr["EndText"]);
            }
            if (DbTool.HasFields("WHtext", fields))
            {
                model.WHtext = DbTool.ConvertObject <System.String>(dr["WHtext"]);
            }
            if (DbTool.HasFields("Note", fields))
            {
                model.Note = DbTool.ConvertObject <System.String>(dr["Note"]);
            }

            return(model);
        }
예제 #27
0
        protected Model.DistanceModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.DistanceModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("Lng", fields))
            {
                model.Lng = DbTool.ConvertObject <System.Decimal>(dr["Lng"]);
            }
            if (DbTool.HasFields("Lat", fields))
            {
                model.Lat = DbTool.ConvertObject <System.Decimal>(dr["Lat"]);
            }
            if (DbTool.HasFields("Province", fields))
            {
                model.Province = DbTool.ConvertObject <System.String>(dr["Province"]);
            }
            if (DbTool.HasFields("City", fields))
            {
                model.City = DbTool.ConvertObject <System.String>(dr["City"]);
            }
            if (DbTool.HasFields("District", fields))
            {
                model.District = DbTool.ConvertObject <System.String>(dr["District"]);
            }
            if (DbTool.HasFields("Address", fields))
            {
                model.Address = DbTool.ConvertObject <System.String>(dr["Address"]);
            }
            if (DbTool.HasFields("StorName", fields))
            {
                model.StorName = DbTool.ConvertObject <System.String>(dr["StorName"]);
            }
            if (DbTool.HasFields("Channel", fields))
            {
                model.Channel = DbTool.ConvertObject <System.String>(dr["Channel"]);
            }
            if (DbTool.HasFields("CreateTime", fields))
            {
                model.CreateTime = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
            }
            if (DbTool.HasFields("StatusId", fields))
            {
                model.StatusId = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
            }
            if (DbTool.HasFields("Describe", fields))
            {
                model.Describe = DbTool.ConvertObject <System.String>(dr["Describe"]);
            }
            if (DbTool.HasFields("Note", fields))
            {
                model.Note = DbTool.ConvertObject <System.String>(dr["Note"]);
            }

            return(model);
        }
예제 #28
0
        public int CheckCount(string sqlwhere)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("select count(*) from AwardsStatistics where 1=1 ");
            sql.Append(sqlwhere);
            return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql.ToString()), 0));
        }
예제 #29
0
        /// <summary>
        /// 获取记录数
        /// </summary>
        public int GetRowCount()
        {
            string sql = "select count(*) from ConfigLog ";

            var obj = SqlHelper.ExecuteScalar(conn, CommandType.Text, sql, null);

            return(DbTool.ConvertObject <int>(obj, 0));
        }
예제 #30
0
 protected void BindDataReader(Model.MsgConfigModel model, SqlDataReader dr)
 {
     model.Id         = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.SupplierId = DbTool.ConvertObject <System.Int32>(dr["SupplierId"]);
     model.MsgType    = DbTool.ConvertObject <System.String>(dr["MsgType"]);
     model.MsgTitle   = DbTool.ConvertObject <System.String>(dr["MsgTitle"]);
     model.MsgTemp    = DbTool.ConvertObject <System.String>(dr["MsgTemp"]);
 }