Ejemplo n.º 1
0
        public async Task<ActionResult> CcaInterface()
        {
            // Look up all ccas associated with this provider

            // Send to form to edit these ccas
            var userId = User.Identity.GetUserId();
            var providerUser = await db.ProviderUsers.FirstOrDefaultAsync(m => m.UserId == userId).ConfigureAwait(false);

            var ccas = await db.CCAs.Where(m => m.ProviderID == providerUser.ProviderID).ToListAsync().ConfigureAwait(false);

            ProviderCcaVmList vmList = new ProviderCcaVmList();

            // Create list of viewmodels populated from ccas
            vmList.CcaList = await GetCcaViewModelList(ccas).ConfigureAwait(false);

            vmList.BulkEdit = new BulkEditViewModel();
            
            var provider = await db.Providers.FindAsync(providerUser.ProviderID).ConfigureAwait(false);
            ViewBag.SchoolName = provider.Name;

            
            var statusList = await db.CourseCompletionStatus.ToListAsync().ConfigureAwait(false);;

            statusList.Insert(0, new CourseCompletionStatus { ID=0, Status = "Select Status" });

            vmList.BulkEdit.CourseCompletionStatusList = statusList.Select(f => new SelectListItem
            {
                Value = f.ID.ToString(),
                Text = f.Status
            });

            // Send to form to edit these ccas
            return View(vmList);

        }
Ejemplo n.º 2
0
        public async Task<ActionResult> CcaInterface(ProviderCcaVmList rowsToEdit)
        {

            TempData["RowsToEdit"] = rowsToEdit; 
                

            // Send updated rows to cca controller 
            return RedirectToAction("SaveBulkUpdate","CCAs");

        }