public IActionResult Index(string filterString) { var doctorDtos = _DoctorManager.GetAllDoctors(filterString); var doctorViewModel = _ViewModelMapper.Map(doctorDtos); return(View(doctorViewModel)); }
public IActionResult Index(int doctorId, int prescriptionId, string filterString) { TempData["PrescriptionId"] = prescriptionId; TempData["DoctorId"] = doctorId; var prescriptionDto = _DoctorManager.GetAllPrescriptionForADoctor(doctorId, null).FirstOrDefault(x => x.Id == prescriptionId); var medicineDtos = _DoctorManager.GetAllMedicineForAPrescription(prescriptionId, filterString); var prescriptionViewModel = _ViewModelMapper.Map(prescriptionDto); prescriptionViewModel.Medicines = _ViewModelMapper.Map(medicineDtos).ToList(); return(View(prescriptionViewModel)); }
public IActionResult Index(int doctorId, string filterString) { TempData["DoctorId"] = doctorId; var doctorDto = _DoctorManager.GetAllDoctors(null).FirstOrDefault(x => x.Id == doctorId); var prescriptionDtos = _DoctorManager.GetAllPrescriptionForADoctor(doctorId, filterString); var doctorViewModel = _ViewModelMapper.Map(doctorDto); doctorViewModel.Prescriptions = _ViewModelMapper.Map(prescriptionDtos).ToList(); return(View(doctorViewModel)); }
// GET: ThemeManagement public ActionResult Index() { var themes = _themeRepository.GetThemes(); var vm = _mapper.Map <List <ThemeListViewModel> >(themes); return(View(vm)); }
public IActionResult Index(int doctorId, string filterString) { TempData["doctorId"] = doctorId; var prescriptionDtos = _doctorService.GetPrescriptionsForDoctor(doctorId, filterString); var doctorDto = _doctorService.GetDoctors(null).FirstOrDefault(x => x.Id == doctorId); var prescrptionVMs = _mapper.Map(prescriptionDtos); var doctorVM = _mapper.Map(doctorDto); doctorVM.Prescriptions = prescrptionVMs; return(View(doctorVM)); }
public Task RenderAsync(CancellationToken cancellationToken = default) { var mapper = new ViewModelMapper(); var viewTasks = Views.Select(async view => { var viewModel = mapper.Map(view, ReferencedObjectTargets); var renderedView = await Formatter.RenderTemplateAsync(viewModel, cancellationToken).ConfigureAwait(false); var databaseName = !IdentifierDefaults.Database.IsNullOrWhiteSpace() ? IdentifierDefaults.Database + " Database" : "Database"; var pageTitle = view.Name.ToVisibleName() + " · View · " + databaseName; var viewContainer = new Container(renderedView, pageTitle, "../"); var renderedPage = await Formatter.RenderTemplateAsync(viewContainer, cancellationToken).ConfigureAwait(false); var outputPath = Path.Combine(ExportDirectory.FullName, view.Name.ToSafeKey() + ".html"); if (!ExportDirectory.Exists) { ExportDirectory.Create(); } using var writer = File.CreateText(outputPath); await writer.WriteAsync(renderedPage.AsMemory(), cancellationToken).ConfigureAwait(false); await writer.FlushAsync().ConfigureAwait(false); }); return(Task.WhenAll(viewTasks)); }
public ValidCandidateCase FillValidPhone(IWebDriver webDriver, EasyAction action, ViewModelMapper mapper) { mapper.Map(Phone(), action); var btnAddPhone = webDriver.FindElement(By.CssSelector("button[ng-click='$ctrl.add();']")); btnAddPhone.Click(); return(this); }
public IActionResult Index(int doctorId, int prescriptionId, string filterString) { DoctorId = doctorId; PrescriptionId = prescriptionId; var medicineDto = mDoctorManager.GetAllMedicineForAPrescription(prescriptionId, filterString); var prescriptionDto = mDoctorManager.GetAllPrescriptionsForADoctor(doctorId, null) .FirstOrDefault(x => x.Id == prescriptionId); var prescriptionViewModel = mViewModelMapper.Map(prescriptionDto); prescriptionViewModel.Medicines = mViewModelMapper.Map(medicineDto); return(View(prescriptionViewModel)); }
public ValidCandidateCase FillValidSkill(IWebDriver webDriver, EasyAction action, ViewModelMapper mapper) { mapper.Map(Skill(), action); var btnAddSkill = webDriver.FindElements(By.XPath("//select[contains(@id, 'Level')]/following-sibling::span//button"))[0]; btnAddSkill.Click(); return(this); }
// GET: Edit event view. public ActionResult Edit(Guid id) { // Check if an id was sent. if (id == Guid.Empty) { return(SiteErrorHandler.GetBadRequestActionResult("<strong>Error:</strong> Invalid calendar event id.", "")); } var entry = _scheduleRepository.GetCalendarEntry(id); if (entry == null) { return(SiteErrorHandler.GetBadRequestActionResult("<strong>Error:</strong> The calendar event could not be found.", "")); } var vm = _mapper.Map <CalendarEventViewModel>(entry); return(View(vm)); }
public void LoadEnvironmentInfo(EnvironmentInfo environmentInfo) { if (environmentInfo == null) { throw new ArgumentNullException("environmentInfo"); } Text = "Environment: " + environmentInfo.Name; environmentPropertiesPropertyGrid.SelectedObject = ViewModelMapper.Map <EnvironmentInfo, EnvironmentInfoInPropertyGridViewModel>(environmentInfo); }
public void Test1() { ViewModelMapper mapper = new ViewModelMapper(); Person p1 = new Person(); p1.FirstName = "Fred"; p1.LastName = "Flintstone"; p1.UserName = "******"; p1.EmailAddress = "*****@*****.**"; PersonViewModel p2 = new PersonViewModel(); mapper.Map<Person, PersonViewModel>(p1, p2); }
public void LoadProjectInfo(ProjectInfo projectInfo) { if (projectInfo == null) { throw new ArgumentNullException("projectInfo"); } Text = "Project: " + projectInfo.Name; lbl_projectType.Text = projectInfo.Type.ToString(); projectPropertiesPropertyGrid.SelectedObject = ViewModelMapper.Map <ProjectInfo, ProjectInfoInPropertyGridViewModel>(projectInfo); }
public async Task <ApplicationUserViewModel> GetUserByUserName(string userName) { try { if (!String.IsNullOrEmpty(userName)) { var result = await _userManager.Users.SingleOrDefaultAsync(usr => usr.UserName.Equals(userName)); var model = ViewModelMapper <ApplicationUserViewModel, ApplicationUser> .Map(result, null); return(model); } //var model = ViewModelMapper<ApplicationUserViewModel, ApplicationUser>.MapObjects(result, null); } catch (Exception ex) { } return(null); }
public IActionResult Index() { var menuItemsDto = _menuItemManager.GetAllMenuItems(); var viewModel = _viewModelMapper.Map(menuItemsDto); return(View(viewModel)); }
public IActionResult Index(string filterString) { var doctorVMs = _mapper.Map(_doctorService.GetDoctors(filterString)); return(View(doctorVMs)); }
public ValidCandidateCase FillValidProfile(EasyAction action, ViewModelMapper mapper) { mapper.Map(Candidate(), action); mapper.Map(Address(), action); return(this); }