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 Core.Business.InstantlyKilling TestKill(long Id)
        {
            IList<Core.Business.InstantlyKilling> instantlyKillinglist = new List<Core.Business.InstantlyKilling>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

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

            SqlDataReader reader = sql.ExecuteSqlReader(StrSQL);

            if (reader != null && !reader.IsClosed && 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);

                reader.Close();
                return instantlyKilling;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Ejemplo n.º 4
0
        public Core.Business.InstantlyKilling Select(Int64 id)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectInstantlyKilling);

            if (reader != null && !reader.IsClosed && 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);

                reader.Close();
                return instantlyKilling;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Ejemplo n.º 5
0
        public Core.Business.InstantlyKilling GetIKLastByLogInstanceId()
        {
            IList<Core.Business.InstantlyKilling> instantlyKillinglist = new List<Core.Business.InstantlyKilling>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            SqlDataReader reader = sql.ExecuteSPReader("[USP_GetInstantlyKilling_By_LogInstanceId]");

            if (reader != null && !reader.IsClosed && 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);

                reader.Close();
                return instantlyKilling;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            CY.UME.Core.Business.InstantlyKillingSingleton iks = CY.UME.Core.Business.InstantlyKillingSingleton.Instance;

            long uid = CY.Utility.Common.ConvertUtility.ConvertToInt(context.Request.QueryString["uid"], -1);
            float Integral = CY.Utility.Common.ConvertUtility.ConvertToInt(context.Request.QueryString["Integral"], -1);
            int times = CY.Utility.Common.ConvertUtility.ConvertToInt(context.Request.QueryString["Times"], 0);

            if (uid == -1 || Integral == -1)
            {
                context.Response.Write("{ success:false,msg:'参数错误' }");
                return;
            }

            ik = iks.Instantlykilling;

            CY.UME.Core.Business.Account account = CY.UME.Core.Business.Account.Load(uid);
            if (account != null)
            {
                CY.UME.Core.Business.InstantlyKillingLog IKLog = new CY.UME.Core.Business.InstantlyKillingLog();
                if (Core.Business.CreditHistory.ChangeCredit(account, ik.Integral, ik.Name))
                {// 减积分

                    Random R = new Random();
                    iks.Second = R.Next(1, ik.TotalTime);

                    IKLog.InstanceId = ik.Id;
                    IKLog.AccountId = account.Id;
                    IKLog.AccountName = account.Name;
                    IKLog.DateCreated = DateTime.Now;
                    //IKLog.Count = CY.UME.Core.Business.InstantlyKillingLog.GetIKCountByInstansIdAndAccountId(ik.Id, uid);
                    IKLog.Integral = Integral;

                    IKLog.Save();

                    context.Response.Write("{ success:true,msg:'竟拍成功',Name:'" + account.Name + "' ,CreatTime:'" + IKLog.DateCreated + "' }");
                    if (times == iks.Num)
                    {
                        lock (iks)
                        {
                            if (times == iks.Num)
                            {
                                CY.UME.Core.Business.InstantlyKillingSingleton.ReStartCountDownTiming();
                                iks.Num++;
                                iks.Name = account.Name;
                                iks.AccountId = account.Id;
                                iks.BidTime = IKLog.DateCreated;
                            }
                        }
                    }

                    return;
                }
                else
                {
                    context.Response.Write("{ success:false,msg:'竟拍失败:您的积分已经不够本次竟拍了-_-!',Name:'" + account.Name + "' ,CreatTime:'" + IKLog.DateCreated + "' }");
                    return;
                }
            }
            else
            {
                context.Response.Write("{ success:false,msg:'竟拍失败,您的网速太慢了-_-!' }");
                return;
            }
        }