Exemplo n.º 1
0
 public TenderController(MyDbContext context)
 {
     MedicineForTenderingService = new MedicineForTenderingService(context);
     TenderService = new TenderService(context);
     MedicineTenderOfferService = new MedicineTenderOfferService(context);
     PharmacyTenderOfferService = new PharmacyTenderOfferService(context);
     SmptServerService          = new SmptServerService();
 }
Exemplo n.º 2
0
        public IActionResult AcceptPharmacyOffer(int offerId, int tenderId)
        {
            TenderOrder tender = PharmacyTenderOfferService.GetPharmacyOffer(offerId, tenderId);

            SmptServerService.SendEMailNotificationForTender(tender.MedicinesWithQuantity, tender.PharmacyName);
            TenderService.CloseTender(tender);
            MedicineTenderOfferService.UpdateMedicineQuantity(offerId);
            return(Ok());
        }
Exemplo n.º 3
0
 public IActionResult GetConcretePharmacyOffer(int offerId, int tenderId)
 {
     return(Ok(PharmacyTenderOfferService.GetPharmacyOffer(offerId, tenderId)));
 }
Exemplo n.º 4
0
 public IActionResult GetPharmacyOffers(int id)
 {
     return(Ok(PharmacyTenderOfferService.GetAllPharmacyOffersForTender(id)));
 }
Exemplo n.º 5
0
 public IActionResult RecieveTenderOffer(TenderOrder tenderOrder)
 {
     PharmacyTenderOfferService.CreateFromTenderOrder(tenderOrder);
     MedicineTenderOfferService.CreateAllMedicineTenderOffers(tenderOrder.MedicinesWithQuantity);
     return(Ok());
 }