Exemplo n.º 1
0
        public IActionResult Search(Search_param _params, int now_page = 1)
        {
            clear_session(); //Sessionのクリア
            if (_params.Start_day.ToString("yyyy") != null)
            {
                HttpContext.Session.SetString("date1", _params.Start_day.ToString("yyyy-MM-dd"));
                ViewBag.date1 = _params.Start_day.ToString("yyyy") == "0001" ? null : HttpContext.Session.GetString("date1");
            }
            else
            {
                ViewBag.date1 = "yyyy-MM-dd";
            }
            if (_params.End_day != null)
            {
                HttpContext.Session.SetString("date2", _params.End_day.ToString("yyyy-MM-dd"));
                ViewBag.date2 = _params.End_day.ToString("yyyy") == "0001" ? null : HttpContext.Session.GetString("date2");
            }
            else
            {
                ViewBag.date2 = "yyyy-MM-dd";
            }
            if (_params.Word != null)
            {
                HttpContext.Session.SetString("freeword", _params.Word);
                ViewBag.freeword = HttpContext.Session.GetString("freeword");
            }
            ViewBag.Check = _params.Check ? true : false;
            if (_params.Check)
            {
                HttpContext.Session.SetString("check", "Checked");
            }
            var          _list          = Search_Target();
            SearchInqury _search_inqury = new SearchInqury(_list, _params.Start_day, _params.End_day, _params.Check, _params.Word);
            var          _result        = _search_inqury.Search_start();

            if (_result.Count() == 0)
            {
                ViewBag.error = " 該当データはありません";
            }
            else
            {
                ViewBag.error = String.Format(" {0}件ヒット", _result.Count().ToString());
            }
            Pagenation pages    = new Pagenation(_result.AsQueryable().AsNoTracking(), 20);
            var        _result2 = pages.Pager(now_page);
            //_srにはページネーションをどこまで出すかをLIST<int>で渡している。
            var _sr = pages.Separate_now(now_page);

            if (_sr.Count() <= 1)  //1件未満の場合はViewでは非表示にする。
            {
                ViewBag.separate = new List <int>();
            }
            else
            {
                ViewBag.separate = _sr;
            }
            ViewBag.now_page = now_page;
            return(View("Index", _result2));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Index(int currentPage = 1, int itemsOnPage = 20)
        {
            var model = await logic.GetAllDataModelAsync();

            // form pagenation model
            var pagenationModel = new Pagenation <UserData>(model, itemsOnPage, currentPage);

            return(View(pagenationModel));
        }
        public async Task <IActionResult> Index(string key, int currentPage = 1, int itemsOnPage = 20)
        {
            int facilityId = Int32.Parse(key);

            ViewData["FacilityId"] = facilityId;
            var model = await logic.GetAllDataModelAsync(facilityId);

            // form pagenation model
            var pagenationModel = new Pagenation <FacilityTechProcessesDataModel>(model, itemsOnPage, currentPage);

            return(View(pagenationModel));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Index(string key, int currentPage = 1, int itemsOnPage = 20)
        {
            int storageId = Int32.Parse(key);

            ViewData["StorageId"] = storageId;
            var model = await logic.GetAllDataModelAsync(storageId);

            // form pagenation model
            var pagenationModel = new Pagenation <ProductsDataModel>(model, itemsOnPage, currentPage);

            return(View(pagenationModel));
        }
Exemplo n.º 5
0
        public IActionResult Index(int now_page = 1)
        {
            clear_session();                  //検索結果Sessionを削除するぜ。
            DateTime _today = DateTime.Today; //今日の日付

            ViewBag.Check = false;
            var _result = from tr in this._context.Tra_Inqury
                          join usr in this._context.Mst_User
                          on tr.Login_Id equals usr.Id
                          //where tr.Start_day == _today
                          where tr.Check_Flag == false
                          where tr.Del_Flag == false
                          orderby tr.Start_day descending
                          orderby tr.Start_Time descending
                          orderby tr.Id descending
                          select new MyList
            {
                Id           = tr.Id,
                Start_day    = tr.Start_day,
                Start_Time   = tr.Start_Time,
                Company_Name = tr.Company_Name,
                Tel_No       = tr.Tel_No,
                User_Name    = usr.User_Name,
                Inqury       = tr.Inqury,
                //Answer = tr.Answer,
                //Tan_Name = tr.Tan_Name,
                //Staff_Flag = tr.Staff_Flag,
                Complate_Flag = tr.Complate_Flag,
                Check_Flag    = tr.Check_Flag
            };
            //ページネーション処理
            Pagenation pages    = new Pagenation(_result.AsNoTracking(), 20);
            var        _result2 = pages.Pager(now_page);
            //_srにはページネーションをどこまで出すかをLIST<int>で渡している。
            var _sr = pages.Separate_now(now_page);

            if (_sr.Count() <= 1)  //1件未満の場合はViewでは非表示にする。
            {
                ViewBag.separate = new List <int>();
            }
            else
            {
                ViewBag.separate = _sr;
            }
            ViewBag.now_page = now_page;
            //ViewBag.date1 = _today;
            //ViewBag.date2 = _today;
            ViewBag.check = true;
            return(View(_result2));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Log(int page = 1)
        {
            List <LogRecord> logRecords = await db.Log.OrderByDescending(p => p.Id).ToListAsync();

            Pagenation <LogRecord> pageLogModel = new Pagenation <LogRecord>();

            pageLogModel.PageSize   = 4;
            pageLogModel.PageNumber = page;
            pageLogModel.TotalItems = logRecords.Count;

            pageLogModel.Items = logRecords.Skip((page - 1) * pageLogModel.PageSize).Take(pageLogModel.PageSize);


            return(View(pageLogModel));
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Index(int currentPage = 1, int itemsOnPage = 20)
        {
            var model = await logic.GetAllDataModelAsync();

            var viewModel = new List <LicensesViewModel>();

            foreach (var item in model)
            {
                viewModel.Add(LicensesDataModelToViewModel(item));
            }
            // form pagenation model
            var pagenationModel = new Pagenation <LicensesViewModel>(viewModel, itemsOnPage, currentPage);

            return(View(pagenationModel));
        }
Exemplo n.º 8
0
        public static Pagenation GetPagenation(string HTML)
        {
            var Pagenationx = new Pagenation();

            HtmlAgilityPack.HtmlDocument Document = new HtmlAgilityPack.HtmlDocument();
            Document.LoadHtml(HTML);

            var HtmlPagenation = Document.DocumentNode.SelectSingleNode("//*[@class=\"woca-pagination\"]");

            var Sayfalar = HtmlPagenation.SelectSingleNode("span[1]").InnerText;

            Pagenationx.bulunan = Convert.ToInt32((Sayfalar.Split('/')[0]).Trim());
            Pagenationx.max     = Convert.ToInt32((Sayfalar.Split('/')[1]).Trim());
            Pagenationx.min     = 1;

            return(Pagenationx);
        }
Exemplo n.º 9
0
        public static Takvim GetTakvim(string HTML)
        {
            var Pagenationx = new Pagenation();

            HtmlAgilityPack.HtmlDocument Document = new HtmlAgilityPack.HtmlDocument();
            Document.LoadHtml(HTML);

            var Table     = Document.DocumentNode.SelectSingleNode("/html/body/main/div[4]/table");
            var Gunler    = Table.SelectNodes("thead/tr/td");
            var Icerikler = Table.SelectNodes("tbody/tr/td");

            var Donut = new Takvim();

            Donut.TakvimListe = new List <TakvimBirGun>();
            for (int i = 0; i < Gunler.Count; i++)
            {
                var Gun    = Gunler[i];
                var Icerik = Icerikler[i].SelectNodes("a");

                var TBirGun = new TakvimBirGun();
                TBirGun.Gün     = Gun.InnerText;
                TBirGun.Diziler = new List <TakvimDizi>();

                foreach (var SIcerik in Icerik)
                {
                    TBirGun.Diziler.Add(new TakvimDizi()
                    {
                        Dizi = SIcerik.InnerText
                    });
                }

                Donut.TakvimListe.Add(TBirGun);
            }

            return(Donut);
        }