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)); }
// 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)); }
public PrescriptionsView() { vm = new PrescriptionsViewModel(); this.BindingContext = vm; InitializeComponent(); }
public Prescriptions() { _viewModel = App.ServiceProvider.GetService <PrescriptionsViewModel>(); InitializeComponent(); BindingContext = _viewModel; }