Esempio n. 1
0
 internal int ObtenerConsecutivo(int OrganizacionId)
 {
     try
     {
         int result = 0;
         Logger.Info();
         var parameters = AuxChequeraDAL.ObtenerParametrosConsecutivo(OrganizacionId);
         var ds         = Retrieve("Chequera_ObtenerConsecutivo", parameters);
         if (ValidateDataSet(ds))
         {
             result = MapChequeraDAL.ObtenerConsecutivo(ds);
         }
         return(result);
     }
     catch (SqlException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (DataException ex)
     {
         Logger.Error(ex);
         throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
     }
 }
Esempio n. 2
0
        internal List <ChequeraInfo> ObtenerPorFiltro(ChequeraInfo info)
        {
            List <ChequeraInfo> result = null;

            try
            {
                Logger.Info();
                var parameters = AuxChequeraDAL.ObtenerParametros(info);

                DataSet ds = Retrieve("Chequera_ObtenerPorFiltro", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapChequeraDAL.ObtenerTodos(ds);
                }
            }
            catch (SqlException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (DataException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
            return(result);
        }
Esempio n. 3
0
        internal ChequeraInfo ObtenerDetalleChequera(int chequera, int organizacion)
        {
            ChequeraInfo result = null;

            try
            {
                Logger.Info();
                var     parameters = AuxChequeraEtapasDAL.ObtenerParametros(chequera, organizacion);
                DataSet ds         = Retrieve("Chequera_ObtenerDetalle", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapChequeraDAL.ObtenerPorChequera(ds);
                }
            }
            catch (SqlException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (DataException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
            return(result);
        }
Esempio n. 4
0
        internal int Guardar(ChequeraInfo info)
        {
            try
            {
                Logger.Info();
                var xml =
                    new XElement("ROOT",
                                 new XElement("Chequera",
                                              new XElement("ChequeraId", info.ChequeraId),
                                              new XElement("NumeroChequera", info.NumeroChequera),
                                              new XElement("ChequeIDInicial", info.ChequeInicial),
                                              new XElement("ChequeIDFinal", info.ChequeFinal),
                                              new XElement("OrganizacionId", info.CentroAcopio.OrganizacionID),
                                              new XElement("BancoId", info.Banco.BancoID),
                                              new XElement("Activo", info.ChequeraEtapas.EtapaId),
                                              new XElement("UsuarioCreacionID", info.UsuarioCreacionID)));

                var parametros = new Dictionary <string, object>
                {
                    { "@XmlChequera", xml.ToString() },
                };

                DataSet ds     = Retrieve("Chequera_Guardar", parametros);
                int     result = 0;
                if (ValidateDataSet(ds))
                {
                    var folio = MapChequeraDAL.ObtenerFolio(ds);
                    if (folio > 0)
                    {
                        result = folio;
                    }
                }
                return(result);
            }
            catch (SqlException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (DataException ex)
            {
                Logger.Error(ex);
                throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex);
            }
        }