Beispiel #1
0
 public ActionResult AddMedicine(MedicineViewModel medicine)
 {
     if (ModelState.IsValid)
     {
         AutoMapper.Mapper.CreateMap<MedicineViewModel, Medicine>();
         var medicineModel = Mapper.Map<Medicine>(medicine);
         medicineContracts.Add(medicineModel);
         TempData["success"] = "Successfully added the medicine";
         return RedirectToAction("AddMedicine");
     }
     TempData["fail"] = "Failed to add the medicine";
     return View();
 }
 public MedicinesControllerTests()
 {
     medicineController = new MedicinesController();
     medicineViewModel = new MedicineViewModel();
     medicineContracts = new MedicinesContracts();
 }