예제 #1
0
        public PaymentCheckDTO VersementCheque([FromBody] PaymentCheckDTO c)
        {
            //-- INSTANTIATION
            PaymentCheckDTO paymentCheckDTO = new PaymentCheckDTO();

            //-- END INSTANTIATION

            try
            {
                Cheque cheque = _chequeRepository.VersementCheque(c);
                //-- GETTING DATA FROM DAO AND TRANSFER IT TO DTO
                paymentCheckDTO.BankName           = cheque.BankName;
                paymentCheckDTO.CINProprietaire    = cheque.CINProprietaire;
                paymentCheckDTO.DateV              = cheque.DateV;
                paymentCheckDTO.IdC                = cheque.idC;
                paymentCheckDTO.Montant            = cheque.Montant;
                paymentCheckDTO.NomProprietaire    = cheque.NomProprietaire;
                paymentCheckDTO.NumeroC            = cheque.NumeroC;
                paymentCheckDTO.PrenomProprietaire = cheque.PrenomProprietaire;

                paymentCheckDTO.CodeCompte   = cheque.Compte.CodeCompte;
                paymentCheckDTO.DateCreation = cheque.Compte.DateCreation;
                paymentCheckDTO.Decouvert    = cheque.Compte.Decouvert;
                paymentCheckDTO.Solde        = cheque.Compte.Solde;
                paymentCheckDTO.Taux         = cheque.Compte.Taux;
                paymentCheckDTO.Type         = cheque.Compte.Type;

                paymentCheckDTO.MessageResult = "Operation Payment Check Done Successfully";
                //-- END GETTING DATA FROM DAO AND TRANSFER IT TO DTO
            }
            catch (NullReferenceException Exception)
            {
                paymentCheckDTO.MessageResult = Exception.Message;
            }
            return(paymentCheckDTO);
        }