Ejemplo n.º 1
0
        private ObservableCollection <Puerto> CargarTablaXML()
        {
            try
            {
                Infrastructure.Aspect.CheckSUM.GenerarChekSum x_CargarTabla = new Infrastructure.Aspect.CheckSUM.GenerarChekSum(Infrastructure.Aspect.CheckSUM.GenerarChekSum.PathAppPublic, UsuarioPuertos);
                System.Data.DataTable dtTabla = x_CargarTabla.CargarXML(new Infrastructure.Aspect.CheckSUM.CHKS_Tablas()
                {
                    CHKS_Tabla = "COM_Puerto"
                });
                ObservableCollection <Puerto> ListPuerto = new ObservableCollection <Puerto>();

                if (dtTabla != null)
                {
                    ListPuerto = new ObservableCollection <Entities.Puerto>();
                    foreach (System.Data.DataRow iRow in dtTabla.Rows)
                    {
                        Entities.Puerto _tipos = new Entities.Puerto();
                        Infrastructure.Aspect.BusinessEntity.BusinessEntityLoader <Entities.Puerto> Loader = new Infrastructure.Aspect.BusinessEntity.BusinessEntityLoader <Entities.Puerto>();
                        Loader.LoadEntity(iRow, _tipos);
                        ListPuerto.Add(_tipos);
                    }
                }
                else
                {
                    return(SelectAll());
                }
                return(ListPuerto);
            }
            catch (Exception)
            { throw; }
        }
Ejemplo n.º 2
0
        private void GenerarXML()
        {
            try
            {
                System.Data.DataTable dt_xml = new System.Data.DataTable();
                ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL> _listFilters = new ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL>();
                dt_xml = GetDT("CHKSSS_ObtenerTablas", _listFilters);

                Infrastructure.Aspect.CheckSUM.GenerarChekSum x_generar = new Infrastructure.Aspect.CheckSUM.GenerarChekSum("", UsuarioParametros);
                if (x_generar.CompararObjetos(dt_xml))
                {
                    Boolean IfCambio = false;
                    foreach (Infrastructure.Aspect.CheckSUM.CHKS_Tablas iTablas in x_generar.ListTablas)
                    {
                        _listFilters = new ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL>();
                        if (iTablas.Cambio)
                        {
                            System.Data.DataSet ds_xml = GetDS(iTablas.CHKS_Procedure, _listFilters);
                            x_generar.GenerarXML(iTablas, ds_xml);
                            IfCambio = true;
                        }
                    }
                    if (IfCambio)
                    {
                        x_generar.GenerarTablaCheckSUM();
                    }
                }
            }
            catch (Exception)
            { throw; }
        }
Ejemplo n.º 3
0
        private ObservableCollection <Tipos> CargarTablaXML(String x_tipo_codtabla)
        {
            try
            {
                Infrastructure.Aspect.CheckSUM.GenerarChekSum x_CargarTabla = new Infrastructure.Aspect.CheckSUM.GenerarChekSum(Infrastructure.Aspect.CheckSUM.GenerarChekSum.PathAppPublic, UsuarioTipos);
                System.Data.DataTable dtTabla = x_CargarTabla.CargarXML(new Infrastructure.Aspect.CheckSUM.CHKS_Tablas()
                {
                    CHKS_Tabla = "Tipos"
                });
                ObservableCollection <Tipos> ListTipos = new ObservableCollection <Tipos>();

                if (dtTabla != null)
                {
                    ListTipos = dtTabla.ToObservableCollection <Tipos>().Where(tipo => tipo.TIPO_CodTabla == x_tipo_codtabla).ToObservableCollection();
                }
                else
                {
                    return(SelectAllByTipoCodTabla(x_tipo_codtabla));
                }
                return(ListTipos);
            }
            catch (Exception)
            { throw; }
        }