Exemple #1
0
        public IActionResult Index()
        {
            _ = new List <CtVet1b>();
            int reportDtYear  = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtYear").Value);
            int reportDtMonth = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtMonth").Value);

            string idRo = User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value;

            string repMoFilter = Request.Query.FirstOrDefault(p => p.Key == "repMO").Value.ToString();
            string divFilter   = Request.Query.FirstOrDefault(p => p.Key == "KIDdiv").Value.ToString();
            string spcFilter   = Request.Query.FirstOrDefault(p => p.Key == "KIDspc").Value.ToString();
            string disFilter   = Request.Query.FirstOrDefault(p => p.Key == "KIDdis").Value.ToString();

            List <CtVet1b> vet1aList = CtVet1bDAL.GetAll_CtVet1bF(
                User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value,
                reportDtYear,
                reportDtMonth,
                repMoFilter,
                divFilter,
                spcFilter,
                disFilter
                ).ToList();

            ViewBag.Page    = "CtVet1b";
            ViewBag.RepList = spDAL.ReportToToday();

            ViewBag.repMOList = FilterTools.repMOList(reportDtYear,
                                                      reportDtMonth,
                                                      repMoFilter);
            ViewBag.KIDdivList = FilterTools.KIDdivList(idRo, divFilter);
            ViewBag.KIDspcList = FilterTools.KIDspcList(spcFilter);
            ViewBag.KIDdisList = FilterTools.KIDdisList(disFilter);

            return(View(vet1aList));
        }
        public IActionResult Index()
        {
            _ = new List <BioPrep>();
            //string v = Request.Query.Count
            string repMoFilter   = Request.Query.FirstOrDefault(p => p.Key == "repMO").Value.ToString();
            string VetPrepFilter = Request.Query.FirstOrDefault(p => p.Key == "VetPrep").Value.ToString();

            int reportDtYear  = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtYear").Value);
            int reportDtMonth = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtMonth").Value);
            //if(Request.Query.Count==0)
            List <BioPrep> BioPrepList = BioPrepDAL.GetAll_BioPrepF(
                User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value,
                reportDtYear,
                reportDtMonth,
                repMoFilter,
                VetPrepFilter
                ).ToList();

            ViewBag.Page    = "BioPrep";
            ViewBag.RepList = spDAL.ReportToToday();

            //SelectList l = FilterTools.repMOList(reportDtYear,reportDtMonth);
            //foreach(var i in l)
            //    if(i.Value == repMoFilter) {i.Selected = true;break;}

            ViewBag.repMOList = FilterTools.repMOList(reportDtYear, reportDtMonth, repMoFilter);

            //SelectList vpl = FilterTools.VetPrepList(VetPrepFilter);
            //foreach(var it in vpl)
            //    if(it.Value.Trim() == VetPrepFilter.Trim()){it.Selected = true; break;}
            //ViewBag.VetPrepList = vpl;
            ViewBag.VetPrepList = FilterTools.VetPrepList(VetPrepFilter);
            ViewBag.RepList     = spDAL.ReportToToday();
            return(View(BioPrepList));
        }