Beispiel #1
0
        public void SendMedicineToCenter(MedicineStockInCenter aMedicineStockInCenter)
        {
            MedicineStockInCenter medicineStockInCenter = aCenterGateway.FindInCenter(aMedicineStockInCenter);

            if (medicineStockInCenter == null)
            {
                aMedicineDBGateway.InsertInCenter(aMedicineStockInCenter);
            }
            else
            {
                aMedicineDBGateway.UpdateInCenter(aMedicineStockInCenter);
            }
        }
        public string SendMedicineToCenter(MedicineStockInCenter aMedicineStockInCenter)
        {
            if (aMedicineStockInCenter.CenterId != 0)
            {
                MedicineStockInCenter medicineStockInCenter = aCenterGateway.FindInCenter(aMedicineStockInCenter);

                if (medicineStockInCenter == null)
                {
                    aMedicineDBGateway.InsertInCenter(aMedicineStockInCenter);
                    return("Success.");
                }
                else
                {
                    medicineStockInCenter.Quantity = aMedicineStockInCenter.Quantity;
                    aMedicineDBGateway.UpdateInCenter(medicineStockInCenter);
                    return("Succes.");
                }
            }
            else
            {
                return("Failed");
            }
        }