コード例 #1
0
        public IViewComponentResult Invoke()
        {
            List <Prescription> prescriptions = (from p in _prescriptionContext.Prescriptions select p).ToList();

            prescriptions = prescriptions.Where(p => p.BillCreated == null).ToList();

            PrescriptionsViewModel vm = new PrescriptionsViewModel
            {
                Prescriptions    = prescriptions,
                IncludeProcessed = false,
            };

            HttpContext.Session.SetString(HomeController.PrescriptionFillValidation, "");
            return(View(vm));
        }
コード例 #2
0
        // GET: Prescriptions
        public async Task <IActionResult> Index(bool includeProcessed)
        {
            List <Prescription> prescriptions = (from p in _prescriptionContext.Prescriptions select p).ToList();

            if (!includeProcessed)
            {
                prescriptions = prescriptions.Where(p => p.BillCreated == null).ToList();
            }
            PrescriptionsViewModel vm = new PrescriptionsViewModel
            {
                Prescriptions    = prescriptions,
                IncludeProcessed = includeProcessed,
            };

            HttpContext.Session.SetString(HomeController.PrescriptionFillValidation, "");
            return(View(vm));
        }
コード例 #3
0
 public PrescriptionsView()
 {
     vm = new PrescriptionsViewModel();
     this.BindingContext = vm;
     InitializeComponent();
 }
コード例 #4
0
 public Prescriptions()
 {
     _viewModel = App.ServiceProvider.GetService <PrescriptionsViewModel>();
     InitializeComponent();
     BindingContext = _viewModel;
 }