Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 7
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));
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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));
        }
Ejemplo n.º 10
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"]);
 }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
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));
        }
Ejemplo n.º 16
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);
        }
Ejemplo n.º 17
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);
        }
Ejemplo n.º 18
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);
        }
Ejemplo n.º 19
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"]);
 }
Ejemplo n.º 20
0
        public int CheckGroupIdByAbsolutePath(string AbsoluteUrl, int GroupId)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("SELECT COUNT(1) FROM [MenuInfo] m left join Permission p on p.MenuId=m.MenuId ");
            sql.Append("where [MenuUrl] like '%" + AbsoluteUrl + "%' and  GroupId=" + GroupId);
            return(DbTool.ConvertObject <int>(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql.ToString()), 0));
        }
Ejemplo n.º 21
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));
        }
Ejemplo n.º 22
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));
        }
Ejemplo n.º 23
0
 protected void BindDataReader(Model.WebApiInterface_LogModel model, SqlDataReader dr)
 {
     model.Id           = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.OrderId      = DbTool.ConvertObject <System.Int32>(dr["OrderId"]);
     model.ResponseData = DbTool.ConvertObject <System.String>(dr["ResponseData"]);
     model.CreateTime   = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
     model.StatusId     = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
     model.Remark       = DbTool.ConvertObject <System.String>(dr["Remark"]);
 }
Ejemplo n.º 24
0
 protected void BindDataReader(Model.ConfigLogModel model, SqlDataReader dr)
 {
     model.Id       = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.ConfigId = DbTool.ConvertObject <System.Int32>(dr["ConfigId"]);
     model.UserId   = DbTool.ConvertObject <System.Int32>(dr["UserId"]);
     model.Title    = DbTool.ConvertObject <System.String>(dr["Title"]);
     model.Note     = DbTool.ConvertObject <System.String>(dr["Note"]);
     model.CTime    = DbTool.ConvertObject <System.DateTime>(dr["CTime"]);
 }
Ejemplo n.º 25
0
 protected void BindDataReader(Model.DelayedAwardsModel model, SqlDataReader dr)
 {
     model.Id          = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.OrderId     = DbTool.ConvertObject <System.Int32>(dr["OrderId"]);
     model.StatusId    = DbTool.ConvertObject <System.Int32>(dr["StatusId"]);
     model.CreateTime  = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
     model.DelayedTime = DbTool.ConvertObject <System.DateTime>(dr["DelayedTime"]);
     model.UpdateTime  = DbTool.ConvertObject <System.DateTime>(dr["UpdateTime"]);
     model.Remark      = DbTool.ConvertObject <System.String>(dr["Remark"]);
 }
Ejemplo n.º 26
0
 protected void BindDataReader(Model.BehaviorLogModel model, SqlDataReader dr)
 {
     model.Id            = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.Ip            = DbTool.ConvertObject <System.String>(dr["Ip"]);
     model.BehaviorType  = DbTool.ConvertObject <System.Int32>(dr["BehaviorType"]);
     model.FailureReason = DbTool.ConvertObject <System.String>(dr["FailureReason"]);
     model.LockValue     = DbTool.ConvertObject <System.String>(dr["LockValue"]);
     model.CreateTime    = DbTool.ConvertObject <System.DateTime>(dr["CreateTime"]);
     model.Remark        = DbTool.ConvertObject <System.String>(dr["Remark"]);
 }
Ejemplo n.º 27
0
 protected void BindDataReader(Model.SourceInfoModel model, SqlDataReader dr)
 {
     model.Id        = DbTool.ConvertObject <System.Int32>(dr["Id"]);
     model.Ip        = DbTool.ConvertObject <System.String>(dr["Ip"]);
     model.Pros      = DbTool.ConvertObject <System.String>(dr["Pros"]);
     model.City      = DbTool.ConvertObject <System.String>(dr["City"]);
     model.SourceUrl = DbTool.ConvertObject <System.String>(dr["SourceUrl"]);
     model.Dtime     = DbTool.ConvertObject <System.DateTime>(dr["Dtime"]);
     model.Type      = DbTool.ConvertObject <System.String>(dr["Type"]);
 }
Ejemplo n.º 28
0
        public static object ExecuteScalar(SqlTransaction trans, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters)
        {
            SqlCommand cmd = new SqlCommand();

            PrepareCommand(cmd, trans.Connection, trans, cmdType, cmdText, commandParameters);
            int val = DbTool.ConvertObject <int>(cmd.ExecuteScalar(), 0);

            cmd.Parameters.Clear();
            return(val);
        }
Ejemplo n.º 29
0
        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));
        }
Ejemplo n.º 30
0
        protected Model.VoteInfoModel AutoBindDataReader(SqlDataReader dr, params string[] fields)
        {
            var model = new Model.VoteInfoModel();

            if (DbTool.HasFields("Id", fields))
            {
                model.Id = DbTool.ConvertObject <System.Int32>(dr["Id"]);
            }
            if (DbTool.HasFields("OrderCode", fields))
            {
                model.OrderCode = DbTool.ConvertObject <System.String>(dr["OrderCode"]);
            }
            if (DbTool.HasFields("VoteDate", fields))
            {
                model.VoteDate = DbTool.ConvertObject <System.DateTime>(dr["VoteDate"]);
            }
            if (DbTool.HasFields("VoteDt", fields))
            {
                model.VoteDt = DbTool.ConvertObject <System.String>(dr["VoteDt"]);
            }
            if (DbTool.HasFields("Ip", fields))
            {
                model.Ip = DbTool.ConvertObject <System.String>(dr["Ip"]);
            }
            if (DbTool.HasFields("VoteName", fields))
            {
                model.VoteName = DbTool.ConvertObject <System.String>(dr["VoteName"]);
            }
            if (DbTool.HasFields("VoteOpid", fields))
            {
                model.VoteOpid = DbTool.ConvertObject <System.String>(dr["VoteOpid"]);
            }
            if (DbTool.HasFields("VoteId", fields))
            {
                model.VoteId = DbTool.ConvertObject <System.Int32>(dr["VoteId"]);
            }
            if (DbTool.HasFields("States", fields))
            {
                model.States = DbTool.ConvertObject <System.Int32>(dr["States"]);
            }
            if (DbTool.HasFields("OpenId", fields))
            {
                model.OpenId = DbTool.ConvertObject <System.String>(dr["OpenId"]);
            }
            if (DbTool.HasFields("NickName", fields))
            {
                model.NickName = DbTool.ConvertObject <System.String>(dr["NickName"]);
            }
            if (DbTool.HasFields("NickImg", fields))
            {
                model.NickImg = DbTool.ConvertObject <System.String>(dr["NickImg"]);
            }

            return(model);
        }