예제 #1
0
 public BiopsyIndexViewModel BiopsyToIndexModel(Biopsy biopsy)
 {
     return new BiopsyIndexViewModel()
     {
         Id = biopsy.Id,
         PatientId = biopsy.PatientId
     };
 }
예제 #2
0
        public async Task<ActionResult> Create([Bind(Include = "Id,PatientId")] BiopsyCreateModel biopsyModel)
        {
            if (ModelState.IsValid)
            {
                var biopsy = new Biopsy()
                {
                    Id = biopsyModel.Id,
                    PatientId = biopsyModel.PatientId
                };
                await _biopsyStore.AddBiopsyAsync(biopsy);
                return RedirectToAction("Index");
            }

            SetPatientsOnModel(biopsyModel);
            return View(biopsyModel);
        }
예제 #3
0
 private SelectListItem BiopsyToSelectListItem(Biopsy biopsy)
 {
     return new SelectListItem() { Value = biopsy.Id, Text = biopsy.Id + (biopsy.PatientId ?? string.Empty) };
 }