Пример #1
0
 public ActionResult Save(MedicalModel data)
 {
     if (data!=null)
     {
         if (data.MedicineId == 0)
         {
             data.CreatedAt = DateTime.Now;
             data.CreatedBy = (Guid)(Session["AdminSession"]);
         }
         else
         {
             data.UpdatedAt = DateTime.Now;
             data.UpdatedBy = (Guid)(Session["AdminSession"]);
         }
         var medicineService = new MedicineService();
         var medicineData = ConvertModelToCore(data);
         GeneralDatabaseResponse databaseResponse = medicineService.Save(medicineData);
         return new JsonResult {Data = databaseResponse};
     }
     return new JsonResult {Data = GeneralDatabaseResponse.UnsuccessfullTransaction};
 }
Пример #2
0
 public ActionResult GetMedicineDetailsById(int id)
 {
     var medicineService = new MedicineService();
     var medicalModel = ConvertCoreToModel(medicineService.GetAllMedicines().Where(medicine => medicine.MedicineId == id).ToList());
     return new JsonResult { Data = medicalModel };
 }
Пример #3
0
 public ActionResult Medical()
 {
     MedicineService medicineService = new MedicineService();
     List<MedicalModel> medicalModels = ConvertCoreToModel(medicineService.GetAllMedicines());
     return View(medicalModels);
 }
Пример #4
0
 public ActionResult Delete(int id)
 {
     MedicineService medicineService = new MedicineService();
     GeneralDatabaseResponse databaseResponse = medicineService.DeleteMedicine(id);
     return new JsonResult { Data = GeneralDatabaseResponse.SuccessfullDelete };
 }