public void SetDataDefault()
        {
            Task.Factory.StartNew(async() =>
            {
                _ListSliderImage.Add(new VideoInfoFormatter()
                {
                    Name = "Item 1", UrlThumbnail = "girl_640_360.jpg"
                });
                _ListSliderImage.Add(new VideoInfoFormatter()
                {
                    Name = "Item 2", UrlThumbnail = "girl_640_360.jpg"
                });
                _ListSliderImage.Add(new VideoInfoFormatter()
                {
                    Name = "Item 3", UrlThumbnail = "girl_640_360.jpg"
                });
                _ListSliderImage.Add(new VideoInfoFormatter()
                {
                    Name = "Item 4", UrlThumbnail = "girl_640_360.jpg"
                });
                _ListSliderImage.Add(new VideoInfoFormatter()
                {
                    Name = "Item 5", UrlThumbnail = "girl_640_360.jpg"
                });
                await Task.Delay(2000);
            });

            Task.Factory.StartNew(() =>
            {
                ListVideo.AddRange(InitListView());
            });
        }
        public async Task <IActionResult> MakePayment([FromBody] Transaction transaction, string ip, int pid)
        {
            var json = JsonConvert.SerializeObject(transaction);

            var uri           = "http://localhost:63385/transactions/new";
            var stringContent = new StringContent(json, System.Text.UnicodeEncoding.UTF8, "application/json");

            var client = new HttpClient();

            client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            var response = await client.PostAsync(uri, stringContent);

            var content = await response.Content.ReadAsStringAsync();

            var rsp  = new { message = "" };
            var data = JsonConvert.DeserializeAnonymousType(content, rsp);

            if (data.message.Contains("Transaction will be added to Block") && ip != null)
            {
                //successfull and unlock the video
                await this.HubContext.Clients.All.SendAsync(ip, pid, ListVideo.Videoes().First(x => x.Id == pid).URL);

                VideoOwned.AddUser(ip, pid);
            }

            return(Ok(data));
        }
예제 #3
0
        public async Task <IActionResult> ApiCall(string ip, int id)
        {
            await this.HubContext.Clients.All.SendAsync(ip, id, ListVideo.Videoes().First(x => x.Id == Convert.ToInt32(id)).URL);

            VideoOwned.AddUser(ip, id);
            return(Content("successfull"));
        }
예제 #4
0
        public IActionResult Index()
        {
            var lstVideo = ListVideo.Videoes();

            ViewBag.Videoes = lstVideo;
            return(View());
        }
예제 #5
0
        public ActionResult Details(string se)
        {
            PostCategory2Controller.se = null;
            if (WebYoutube.Session.User.Email != null && WebYoutube.Session.User.Id != 0)
            {
                //lay ra email, info ng dung
                ViewBag.ViewBagEmail = WebYoutube.Session.User.Email;
                Data.DTO.PeopleInfomationDTO Infomation = new PeopleInfomationDTO();
                Infomation         = dao.Infomation(WebYoutube.Session.User.Email);
                ViewBag.Infomation = Infomation;

                //lay ra list video cua ng dung
                IEnumerable <Data.DTO.PeopleListVideoDTO> ListVideo;
                ListVideo         = dao.ListVideo(WebYoutube.Session.User.Id, se);
                ViewBag.ListVideo = ListVideo.ToList();

                // count like dis comment
                ViewBag.ListCount = dao.ListCount();

                return(View(ListVideo));
            }
            else
            {
                return(View());
            }
        }
예제 #6
0
        private void Update_ListView_Main()
        {
            ListView_Main.Items.Clear();
            var l = Program.Videos.Where(x => x.IsSynced());

            foreach (var v in l)
            {
                var lv = new ListVideo(v);
                lv.SubItems.Clear();
                lv.Text = v.FilePath;
                lv.SubItems.Add(v.GameProfile.Name);
                ListView_Main.Items.Add(lv);
            }

            Button_Process.Enabled = ListView_Main.Items.Count > 0;
        }
예제 #7
0
        public ListVideo2ViewModel()
        {
            NextPageCommand     = new RelayCommand <object>((p) => { return(CurPage < TotalPage ? true : false); }, (p) => { CurPage++; ListVideoShow = new ObservableCollection <VideoInfo>(ListVideo.OrderBy(v => v.Id).Skip((CurPage - 1) * PageSize).Take(PageSize).ToList()); });
            PreviousPageCommand = new RelayCommand <object>((p) => { return(CurPage > 1 ? true : false); }, (p) => { CurPage--; ListVideoShow = new ObservableCollection <VideoInfo>(ListVideo.OrderBy(v => v.Id).Skip((CurPage - 1) * PageSize).Take(PageSize).ToList()); });
            LastPageCommand     = new RelayCommand <object>((p) => { return(CurPage < TotalPage ? true : false); }, (p) => { CurPage = TotalPage; ListVideoShow = new ObservableCollection <VideoInfo>(ListVideo.OrderBy(v => v.Id).Skip((CurPage - 1) * PageSize).Take(PageSize).ToList()); });
            FirstPageCommand    = new RelayCommand <object>((p) => { return(CurPage > 1 ? true : false); }, (p) => { CurPage = 1; ListVideoShow = new ObservableCollection <VideoInfo>(ListVideo.OrderBy(v => v.Id).Skip((CurPage - 1) * PageSize).Take(PageSize).ToList()); });

            PageSize = 3;
            CurPage  = 1;
        }