Exemple #1
0
        public int InsertarPF(int idcliente, int id, int tipo, int dias, double capitalinicial, double tasa, double interes)
        {
            PlazoFijo PF = new PlazoFijo(idcliente, id, tipo, dias, capitalinicial, tasa, interes);

            TransactionResult resultado = mapper.Insert(PF);

            if (resultado.IsOk)
            {
                return(resultado.Id);
            }
            else
            {
                throw new Exception("Ha habido un erro al crear Plazo fijo" + resultado.Error);
            }
        }
Exemple #2
0
        public int Insert(PlazoFijo plazoFijo)
        {
            string reglas = Reglas(plazoFijo);

            if (!string.IsNullOrEmpty(reglas))
            {
                throw new PlazoFijoException(reglas);
            }
            else
            {
                TransactionResult resultado = PlazoFijoMapper.Insert(plazoFijo);
                if (resultado.IsOk)
                {
                    RecargarLista();
                    return(resultado.Id);
                }
                else
                {
                    throw new PlazoFijoException(resultado.Error);
                }
            }
        }