Example #1
0
        DMoneda monedaIns = new DMoneda();//creo un nuevo objeto para eviar a datos

        public tbMonedas guardar(tbMonedas moneda)
        {
            try
            {
                tbMonedas buscarMoneda = monedaIns.GetEntity(moneda);
                if (buscarMoneda == null)
                {
                    return(monedaIns.Guardar(moneda));
                }
                else
                {
                    if (buscarMoneda.estado == true)
                    {
                        throw new EntityExistException("moneda");
                    }
                    else
                    {
                        throw new EntityDisableStateException("moneda");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }