Ejemplo n.º 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};
 }
Ejemplo n.º 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 };
 }
Ejemplo n.º 3
0
 public ActionResult Medical()
 {
     MedicineService medicineService = new MedicineService();
     List<MedicalModel> medicalModels = ConvertCoreToModel(medicineService.GetAllMedicines());
     return View(medicalModels);
 }
Ejemplo n.º 4
0
 public ActionResult Delete(int id)
 {
     MedicineService medicineService = new MedicineService();
     GeneralDatabaseResponse databaseResponse = medicineService.DeleteMedicine(id);
     return new JsonResult { Data = GeneralDatabaseResponse.SuccessfullDelete };
 }