Exemple #1
0
        public void donatieS(float sumaDonata, int idDonator, int cazId)
        {
            Donatie d = new Donatie(sumaDonata, idDonator, cazId);

            try
            {
                validatorDonatii.valideaza(d);
            }
            catch (Exception e)
            {
            }
            donatiiDBRepository.save(d);
            notifyAllAngajatiDonatie();
        }
Exemple #2
0
        /*   public void login(Angajat angajat, ITeledonObserver client)
         * {
         *     if (angajat != null)
         *     {
         *         if (loggedClients.ContainsKey(angajat.username))
         *             throw new TeledonException("User already logged!");
         *         loggedClients.Add(angajat.username, client);
         *     }
         *     else throw new TeledonException("Authentication failed.");
         * }*/

        public void donatieS(CazDTO caz, string numeDonator, string adresa, string nrTel, float sumaDonata)
        {
            lock (this)
            {
                handleDonatori(numeDonator, nrTel, adresa);
                Int32   id    = getDonator(numeDonator, nrTel).Id;
                Int32   cazId = getCazId(caz);
                Donatie d     = new Donatie(sumaDonata, id, cazId);

                try
                {
                    validatorDonatii.valideaza(d);
                }
                catch (Exception e)
                {
                }

                donatiiDBRepository.save(d);
                float s = caz.SumaAdunata;
                s += sumaDonata;
                caz.SumaAdunata = s;
                notifyAllAngajatiDonatie();
            }
        }