Ejemplo n.º 1
0
        public IList<Core.Business.InstantlyKilling> GetAllInstantlyKilling()
        {
            IList<Core.Business.InstantlyKilling> instantlyKillinglist = new List<Core.Business.InstantlyKilling>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllInstantlyKilling);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.InstantlyKilling instantlyKilling = new Core.Business.InstantlyKilling();

                    if (!reader.IsDBNull(0)) instantlyKilling.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) instantlyKilling.TotalTime = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) instantlyKilling.DateCreated = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) instantlyKilling.BeginTime = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) instantlyKilling.Integral = reader.GetDouble(4);
                    if (!reader.IsDBNull(5)) instantlyKilling.ReferencePrice = reader.GetDouble(5);
                    if (!reader.IsDBNull(6)) instantlyKilling.IsEnd = reader.GetBoolean(6);
                    if (!reader.IsDBNull(7)) instantlyKilling.AccountId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) instantlyKilling.Name = reader.GetString(8);
                    if (!reader.IsDBNull(9)) instantlyKilling.ImagePath = reader.GetString(9);
                    if (!reader.IsDBNull(10)) instantlyKilling.AccountName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) instantlyKilling.ProductInfo = reader.GetString(11);
                    if (!reader.IsDBNull(12)) instantlyKilling.IsEnable = reader.GetBoolean(12);
                    if (!reader.IsDBNull(13)) instantlyKilling.RobotNum = reader.GetInt32(13);
                    if (!reader.IsDBNull(14)) instantlyKilling.InterfereNum = reader.GetDateTime(14);
                    if (!reader.IsDBNull(15)) instantlyKilling.RobotId = reader.GetString(15);
                    if (!reader.IsDBNull(16)) instantlyKilling.Seconds = reader.GetInt32(16);
                    if (!reader.IsDBNull(17)) instantlyKilling.EndTime = reader.GetDateTime(17);

                    instantlyKilling.MarkOld();
                    instantlyKillinglist.Add(instantlyKilling);
                }
                reader.Close();
            }
            return instantlyKillinglist;
        }
Ejemplo n.º 2
0
        public IList<Core.Business.InstantlyKilling> GetAllInstantlyKilling(String Sort, int PageSize)
        {
            IList<Core.Business.InstantlyKilling> instantlyKillinglist = new List<Core.Business.InstantlyKilling>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            String Query = "SELECT TOP (" + PageSize + ") [Id],[TotalTime],[DateCreated],[BeginTime],[Integral],[ReferencePrice],[IsEnd],[AccountId],[Name],[ImagePath],[AccountName],[ProductInfo],[IsEnable],[RobotNum],[InterfereNum],[RobotId],[Seconds],[EndTime] FROM [InstantlyKilling] ORDER BY " + Sort + ";";

            SqlDataReader reader = sql.ExecuteSqlReader(Query);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.InstantlyKilling instantlyKilling = new Core.Business.InstantlyKilling();

                    if (!reader.IsDBNull(0)) instantlyKilling.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) instantlyKilling.TotalTime = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) instantlyKilling.DateCreated = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) instantlyKilling.BeginTime = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) instantlyKilling.Integral = reader.GetDouble(4);
                    if (!reader.IsDBNull(5)) instantlyKilling.ReferencePrice = reader.GetDouble(5);
                    if (!reader.IsDBNull(6)) instantlyKilling.IsEnd = reader.GetBoolean(6);
                    if (!reader.IsDBNull(7)) instantlyKilling.AccountId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) instantlyKilling.Name = reader.GetString(8);
                    if (!reader.IsDBNull(9)) instantlyKilling.ImagePath = reader.GetString(9);
                    if (!reader.IsDBNull(10)) instantlyKilling.AccountName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) instantlyKilling.ProductInfo = reader.GetString(11);
                    if (!reader.IsDBNull(12)) instantlyKilling.IsEnable = reader.GetBoolean(12);
                    if (!reader.IsDBNull(13)) instantlyKilling.RobotNum = reader.GetInt32(13);
                    if (!reader.IsDBNull(14)) instantlyKilling.InterfereNum = reader.GetDateTime(14);
                    if (!reader.IsDBNull(15)) instantlyKilling.RobotId = reader.GetString(15);
                    if (!reader.IsDBNull(16)) instantlyKilling.Seconds = reader.GetInt32(16);
                    if (!reader.IsDBNull(17)) instantlyKilling.EndTime = reader.GetDateTime(17);

                    instantlyKilling.MarkOld();
                    instantlyKillinglist.Add(instantlyKilling);
                }
                reader.Close();
            }
            return instantlyKillinglist;
        }
Ejemplo n.º 3
0
        public IList<Core.Business.InstantlyKilling> GetAllInstantlyKilling(String IsEnable, String IsEnd, String Sort, Core.PagingInfo pagingInfo)
        {
            IList<Core.Business.InstantlyKilling> instantlyKillinglist = new List<Core.Business.InstantlyKilling>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            String Filter = SetStrFilter(IsEnable, IsEnd);

            sql.AddParameter("@PageNumber", SqlDbType.Int, pagingInfo.CurrentPage);
            sql.AddParameter("@PageSize", SqlDbType.Int, pagingInfo.PageSize);

            sql.AddParameter("@Tables", SqlDbType.NVarChar, "InstantlyKilling");
            sql.AddParameter("@PK", SqlDbType.NVarChar, "Id");
            sql.AddParameter("@Sort", SqlDbType.NVarChar, Sort + " DESC");
            sql.AddParameter("@Fields", SqlDbType.NVarChar, "[Id],[TotalTime],[DateCreated],[BeginTime],[Integral],[ReferencePrice],[IsEnd],[AccountId],[Name],[ImagePath],[AccountName],[ProductInfo],[IsEnable],[RobotNum],[InterfereNum],[RobotId],[Seconds],[EndTime]");
            sql.AddParameter("@Filter", SqlDbType.NVarChar, Filter);

            SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.InstantlyKilling instantlyKilling = new Core.Business.InstantlyKilling();

                    if (!reader.IsDBNull(0)) instantlyKilling.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) instantlyKilling.TotalTime = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) instantlyKilling.DateCreated = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) instantlyKilling.BeginTime = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) instantlyKilling.Integral = reader.GetDouble(4);
                    if (!reader.IsDBNull(5)) instantlyKilling.ReferencePrice = reader.GetDouble(5);
                    if (!reader.IsDBNull(6)) instantlyKilling.IsEnd = reader.GetBoolean(6);
                    if (!reader.IsDBNull(7)) instantlyKilling.AccountId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) instantlyKilling.Name = reader.GetString(8);
                    if (!reader.IsDBNull(9)) instantlyKilling.ImagePath = reader.GetString(9);
                    if (!reader.IsDBNull(10)) instantlyKilling.AccountName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) instantlyKilling.ProductInfo = reader.GetString(11);
                    if (!reader.IsDBNull(12)) instantlyKilling.IsEnable = reader.GetBoolean(12);
                    if (!reader.IsDBNull(13)) instantlyKilling.RobotNum = reader.GetInt32(13);
                    if (!reader.IsDBNull(14)) instantlyKilling.InterfereNum = reader.GetDateTime(14);
                    if (!reader.IsDBNull(15)) instantlyKilling.RobotId = reader.GetString(15);
                    if (!reader.IsDBNull(16)) instantlyKilling.Seconds = reader.GetInt32(16);
                    if (!reader.IsDBNull(17)) instantlyKilling.EndTime = reader.GetDateTime(17);

                    instantlyKilling.MarkOld();
                    instantlyKillinglist.Add(instantlyKilling);
                }
                reader.Close();
            }
            return instantlyKillinglist;
        }