コード例 #1
0
ファイル: AgentController.cs プロジェクト: john-pham/hapgo
        public async Task<JsonResult> Search()
        {
            using (var svc = new Services.DataProvider("agent"))
            {
                var list = await svc.Get<IList<Models.Agent>>();

                return Json(list);
            }
        }
コード例 #2
0
ファイル: OverviewController.cs プロジェクト: john-pham/hapgo
        public async Task<JsonResult> GetAssets()
        {
            using (var svc = new Services.DataProvider("report/assets"))
            {
                var item = await svc.Get<Models.RejectionCounter>();

                return Json(item);
            }
        }
コード例 #3
0
        public async Task <JsonResult> Search()
        {
            using (var svc = new Services.DataProvider("bookmaker"))
            {
                var list = await svc.Get <IList <Models.Bookmaker> >();

                return(Json(list));
            }
        }
コード例 #4
0
ファイル: OverviewController.cs プロジェクト: john-pham/hapgo
        public async Task <JsonResult> GetAssets()
        {
            using (var svc = new Services.DataProvider("report/assets"))
            {
                var item = await svc.Get <Models.RejectionCounter>();

                return(Json(item));
            }
        }
コード例 #5
0
        public async Task <JsonResult> Search()
        {
            using (var svc = new Services.DataProvider("maintenance"))
            {
                var list = await svc.Get <IList <Models.Maintenance> >();

                return(Json(list));
            }
        }
コード例 #6
0
ファイル: OverviewController.cs プロジェクト: john-pham/hapgo
        private async Task<Models.RejectionRate> command(Guid agentId)
        {
            using (var svc = new Services.DataProvider("report", new Dictionary<string, object> { { "id", agentId } }))
            {
                var item = await svc.Get<Models.RejectionRate>();
                item.ID = agentId;

                return item;
            }
        }
コード例 #7
0
 public async Task <JsonResult> Update(Guid id, string url)
 {
     using (var svc = new Services.DataProvider("bookmaker", new Dictionary <string, object> {
         { "id", id },
         { "url", url }
     }))
     {
         return(Json(await svc.Put <bool>()));
     }
 }
コード例 #8
0
 public async Task<JsonResult> Update(Guid id, string url)
 {
     using (var svc = new Services.DataProvider("bookmaker", new Dictionary<string, object> {
         { "id", id },
         { "url", url}
     }))
     {
         return Json(await svc.Put<bool>());
     }
 }
コード例 #9
0
        public async Task <JsonResult> Search(int page = 0, int size = 8)
        {
            using (var svc = new Services.DataProvider("rejection", new Dictionary <string, object> {
                { "page", page },
                { "size", size }
            }))
            {
                var list = await svc.Get <Models.Pagination <Models.Rejection> >();

                return(Json(list));
            }
        }
コード例 #10
0
ファイル: BetlistController.cs プロジェクト: john-pham/hapgo
        public async Task<JsonResult> Search(DateTime? date, int page = 0, int size = 8)
        {
            using (var svc = new Services.DataProvider("betlist", new Dictionary<string, object> {
                { "page", page },
                { "size", size }
            }))
            {
                var list = await svc.Get<Models.Pagination<Models.Event>>();

                return Json(list);
            }
        }
コード例 #11
0
ファイル: OverviewController.cs プロジェクト: john-pham/hapgo
        private async Task <Models.RejectionRate> command(Guid agentId)
        {
            using (var svc = new Services.DataProvider("report", new Dictionary <string, object> {
                { "id", agentId }
            }))
            {
                var item = await svc.Get <Models.RejectionRate>();

                item.ID = agentId;

                return(item);
            }
        }
コード例 #12
0
ファイル: CreationTest.cs プロジェクト: Zhartaevem/GZipTest
        public void Test()
        {
            // Arrange
            int workBlockSize = 1000000;

            int processorCount = Environment.ProcessorCount;

            string dataDirectory = AppDomain.CurrentDomain.BaseDirectory.Split("bin")[0] + "/Data/sample-2mb-text-file.txt";

            // Act
            using (Services.DataProvider dataProvider = new Services.DataProvider(dataDirectory, workBlockSize, processorCount * workBlockSize))
            {
                // Assert
                Assert.IsType <Services.DataProvider>(dataProvider);
            }
        }
コード例 #13
0
        public void Test()
        {
            // Arrange
            int workBlockSize = 1;

            int processorCount = Environment.ProcessorCount;

            string dataDirectory = AppDomain.CurrentDomain.BaseDirectory.Split("bin")[0] + "/Data/sample-2mb-text-file.txt";

            DataPart[] initialBuffer = new DataPart[processorCount];

            // Act
            using (Services.DataProvider dataProvider = new Services.DataProvider(dataDirectory, workBlockSize, processorCount * workBlockSize))
            {
                long readBytesCount = dataProvider.GetData(initialBuffer);

                // Assert
                Assert.Equal(processorCount * workBlockSize, readBytesCount);
            }
        }
コード例 #14
0
        public async Task <JsonResult> Create(Models.MaintenanceMode mode)
        {
            var from = DateTime.Now;
            var to   = from.AddMinutes(15);

            using (var svc = new Services.DataProvider("maintenance", new Dictionary <string, object> {
                { "mode", (byte)mode }
            }))
            {
                return(Json(await svc.Post <bool>()));
            }

            //using (var svc = new Services.DataProvider("maintenance"))
            //{
            //    return Json(await svc.Post<bool>(new
            //    {
            //        from = from,
            //        to = to
            //    }));
            //}
        }
コード例 #15
0
        public async Task<JsonResult> Create(Models.MaintenanceMode mode)
        {
            var from = DateTime.Now;
            var to = from.AddMinutes(15);

            using (var svc = new Services.DataProvider("maintenance", new Dictionary<string, object> {
                { "mode", (byte)mode }
            }))
            {
                return Json(await svc.Post<bool>());
            }

            //using (var svc = new Services.DataProvider("maintenance"))
            //{
            //    return Json(await svc.Post<bool>(new
            //    {
            //        from = from,
            //        to = to
            //    }));
            //}
        }