Пример #1
0
        public KundeDto InsertKunde(KundeDto kunde)
        {
            WriteActualMethod();
            KundeManager km = new KundeManager();

            return(km.Insert(kunde.ConvertToEntity()).ConvertToDto());
        }
Пример #2
0
        public override async Task <KundeDto> Insert(KundeDto request, ServerCallContext context)
        {
            KundeManager manager  = new KundeManager();
            Kunde        kunde    = request.ConvertToEntity();
            Kunde        newKunde = await manager.Insert(kunde);

            return(newKunde.ConvertToDto());
        }
        public void SaveKunde(Window window)
        {
            if (!CheckFields())
            {
                Kunde.Geburtsdatum = Geburtsdatum;
                Kunde.Vorname      = Vorname;
                Kunde.Nachname     = Nachname;

                Kunde = kundeManager.Insert(Kunde);

                DialogResult?.Invoke(true);
            }
        }
Пример #4
0
        public void InsertKundeTest()
        {
            KundeManager kundeManager = new KundeManager();
            Kunde        kunde        = new Kunde {
                Nachname = "Später", Vorname = "Peter", Geburtsdatum = new DateTime(1976, 03, 27)
            };
            Kunde insertedKunde = kundeManager.Insert(kunde);

            Assert.AreEqual(5, insertedKunde.Id);
            Kunde getKunde = kundeManager.Kunde(5);

            Assert.AreEqual("Später", getKunde.Nachname);
        }
Пример #5
0
        public override async Task <KundeDto> Insert(KundeDto request, ServerCallContext context)
        {
            try
            {
                KundeManager manager = new KundeManager();
                Kunde        kunde   = await manager.Insert(request.ConvertToEntity());

                KundeDto result = kunde.ConvertToDto();
                return(result);
            }
            catch (OptimisticConcurrencyException <Auto> e)
            {
                throw new RpcException(new Status(StatusCode.Aborted, e.Message));
            }
        }
        public void AddKunde(KundeDto kunde)
        {
            WriteActualMethod();
            IAutoReservationResultCallback cb = _createCallbackChannel();

            try
            {
                Kunde insertedKunde = kundeManager.Insert(kunde.ConvertToEntity());
                cb.SendKunde(insertedKunde.ConvertToDto());
            }
            catch (DatabaseChangeException ex)
            {
                cb.SendFault(new CommunicationFault {
                    Exception = ex.Message
                });
            }
        }
 public void InsertKunde(KundeDto kundeToBeInserted)
 {
     WriteActualMethod();
     kundeManager.Insert(kundeToBeInserted.ConvertToEntity());
 }
Пример #8
0
        public override async Task <KundeDto> Insert(KundeDto request, ServerCallContext context)
        {
            Kunde result = await ClientManager.Insert(request.ConvertToEntity());

            return(result.ConvertToDto());
        }