Exemplo n.º 1
0
        public controlPreferenciasAuthSearch()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            bool useLocal = false;

            bool.TryParse(AdministradorPreferencias.Read(PrefsGlobal.AuthUseLocal), out useLocal);
            this.rbLocal.Checked = useLocal;

            bool useRemote = !useLocal;

            this.rbRemote.Checked = useRemote;

            string url = AdministradorPreferencias.Read(PrefsGlobal.AuthDownloadURL);

            this.txURL.Text = url;

            bool useCredentials = false;

            bool.TryParse(AdministradorPreferencias.Read(PrefsGlobal.AuthDownloadUsingCredentials), out useCredentials);
            this.ckCredentials.Checked = useCredentials;
            string login    = AdministradorPreferencias.Read(PrefsGlobal.AuthDownloadWithLogin);
            string password = AdministradorPreferencias.Read(PrefsGlobal.AuthDownloadWithPassword);

            this.txLogin.Text      = login;
            this.txPassword.Text   = password;
            this.lLogin.Enabled    = this.txLogin.Enabled = this.ckCredentials.Checked;
            this.lPassword.Enabled = this.txPassword.Enabled = this.ckCredentials.Checked;

            this.SyncControls(useRemote);
        }
Exemplo n.º 2
0
        public static Collection <DBRelationInfo> QueryViewCatalog(DBSchemaInfo schema)
        {
            string SQL = null;

            object[] aParams = null;
            switch (schema.Source)
            {
            case dbOrigen.ORA:
                SQL = AdministradorPreferencias.Read(PrefsBD.ORACustomViewSchemaQuery);
                if (SQL == null || SQL.Trim() == string.Empty)
                {
                    SQL = AdministradorPreferencias.Read(PrefsBD.ORADefaultViewSchemaQuery);
                }
                aParams = new object[] { schema.Name.Trim() };
                break;

            case dbOrigen.PGSQL:
                SQL = AdministradorPreferencias.Read(PrefsBD.PGSQLCustomViewSchemaQuery);
                if (SQL == null || SQL.Trim() == string.Empty)
                {
                    SQL = AdministradorPreferencias.Read(PrefsBD.PGSQLDefaultViewSchemaQuery);
                }
                aParams = new object[] { DBSettings.PGSQLDb, schema.Name.Trim() };
                break;
            }
            DataSet ds = GetDataSet(schema.Source, SQL, aParams);
            Collection <DBRelationInfo> views = new Collection <DBRelationInfo>();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                views.Add(new DBRelationInfo(schema, (string)r[0], dbRelationType.View));
            }
            return(views);
        }
Exemplo n.º 3
0
        public static TreeNode CrearNodoBaseOrg(BaseOrg baseOrg)
        {
            TreeNode n0;
            TreeNode n00;
            TreeNode n01;

            n0      = new TreeNode();
            n0.Tag  = baseOrg;
            n0.Name = "BASEORG";
            n0.Text = AdministradorPreferencias.Read(PrefsGlobal.OrgAcronym);

            n00      = new TreeNode();
            n00.Tag  = nodosOrdenacion.zonas;
            n00.Name = "ZONAS";
            n00.Text = "Sedes";

            n01      = new TreeNode();
            n01.Tag  = nodosOrdenacion.plantasBase;
            n01.Name = "PLANTASBASE";
            n01.Text = "Plantas";

            n0.Nodes.AddRange(new TreeNode[2] {
                n00, n01
            });

            return(n0);
        }
Exemplo n.º 4
0
        public static Collection <DBSchemaInfo> GetTargetSchemas(dbOrigen who)
        {
            string schemas = null;

            string[] aSchemas = {};
            Collection <DBSchemaInfo> schemaList = new Collection <DBSchemaInfo>();

            switch (who)
            {
            case dbOrigen.ORA:
                schemas = AdministradorPreferencias.Read(PrefsBD.ORATargetSchemas);
                break;

            case dbOrigen.PGSQL:
                schemas = AdministradorPreferencias.Read(PrefsBD.PGSQLTargetSchemas);
                break;
            }

            if (schemas != null && schemas.Trim() != string.Empty)
            {
                aSchemas = schemas.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string s in aSchemas)
                {
                    schemaList.Add(new DBSchemaInfo(who, s.Trim()));
                }
            }
            return(schemaList);
        }
Exemplo n.º 5
0
 void BAceptarClick(object sender, EventArgs e)
 {
     AdministradorPreferencias.Save();
     if (this.Owner == null)
     {
         this.Close();
     }
 }
Exemplo n.º 6
0
 void RbCatalogoColumnasCustomCheckedChanged(object sender, EventArgs e)
 {
     this.txCatalogoColumnasCustom.Enabled = this.rbCatalogoColumnasCustom.Checked;
     if (!this.rbCatalogoColumnasCustom.Checked)
     {
         this.txCatalogoColumnasCustom.Clear();
         AdministradorPreferencias.Update(PrefsBD.ORACustomColumnSchemaQuery, null);
     }
 }
Exemplo n.º 7
0
 public Rijndael()
 {
     _hashAlgorithm      = AdministradorPreferencias.Read(PrefsGlobal.RIJHashAlgorithm);
     _initVector         = AdministradorPreferencias.Read(PrefsGlobal.RIJInitVector);
     _keySize            = int.Parse(AdministradorPreferencias.Read(PrefsGlobal.RIJKeySize));
     _passPhrase         = AdministradorPreferencias.Read(PrefsGlobal.RIJPassPhrase);
     _passwordIterations = int.Parse(AdministradorPreferencias.Read(PrefsGlobal.RIJPasswordIterations));
     _saltValue          = AdministradorPreferencias.Read(PrefsGlobal.RIJSaltValue);
 }
Exemplo n.º 8
0
        public controlPreferenciasORASchemaQuery()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            string esquemas = AdministradorPreferencias.Read(PrefsBD.ORATargetSchemas);
            string tablas   = AdministradorPreferencias.Read(PrefsBD.ORACustomTableSchemaQuery);
            string vistas   = AdministradorPreferencias.Read(PrefsBD.ORACustomViewSchemaQuery);
            string columnas = AdministradorPreferencias.Read(PrefsBD.ORACustomColumnSchemaQuery);

            this.txEsquemas.Text = esquemas;
            if (tablas == string.Empty || tablas == null)
            {
                this.rbCatalogoTablasDefault.Checked = true;
                this.txCatalogoTablasCustom.Enabled  = false;
            }
            else
            {
                this.rbCatalogoTablasCustom.Checked = true;
                this.txCatalogoTablasCustom.Enabled = true;
                this.txCatalogoTablasCustom.Text    = tablas;
            }
            if (vistas == string.Empty || vistas == null)
            {
                this.rbCatalogoVistasDefault.Checked = true;
                this.txCatalogoVistasCustom.Enabled  = false;
            }
            else
            {
                this.rbCatalogoVistasCustom.Checked = true;
                this.txCatalogoVistasCustom.Enabled = true;
                this.txCatalogoVistasCustom.Text    = vistas;
            }
            if (columnas == string.Empty || columnas == null)
            {
                this.rbCatalogoColumnasDefault.Checked = true;
                this.txCatalogoColumnasCustom.Enabled  = false;
            }
            else
            {
                this.rbCatalogoColumnasCustom.Checked = true;
                this.txCatalogoColumnasCustom.Enabled = true;
                this.txCatalogoColumnasCustom.Text    = columnas;
            }
        }
Exemplo n.º 9
0
        //Método estático de conveniencia para generar la url de documento dado un perfil
        public static string GetDefaultRemoteLocation(ProfileType perfil, string perfilPersonalizado, string version)
        {
            string url     = string.Empty;
            string baseUrl = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadURL);

            try
            {
                Uri baseUri = new Uri(baseUrl);
                Uri docUri  = new Uri(baseUri, Root.BuildFormalFileName(perfil, perfilPersonalizado, Loader.Version));
                url = docUri.AbsoluteUri;
            }
            catch
            {
                //Simplemente devolvemos la cadena vacía
            }
            return(url);
        }
Exemplo n.º 10
0
        void BOKClick(object sender, EventArgs e)
        {
            try
            {
                bool checkCredentials = false;
                if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Anonymous, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Normal, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Manager, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Root, Loader.Version))
                {
                    checkCredentials = true;
                }
                bool   useCredentials = false;
                string httpUsr        = string.Empty;
                string httpPwd        = string.Empty;
                if (checkCredentials)
                {
                    bool.TryParse(AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadUsingCredentials), out useCredentials);
                    if (useCredentials)
                    {
                        httpUsr = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadWithLogin);
                        httpPwd = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadWithPassword);
                    }
                }

                this._doc = (Root)XMLUtils.DeserializarDocumento(this.txOrigen.Text.Trim(), httpUsr, httpPwd, typeof(Root));
                this.BindSettings();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 11
0
        public static Collection <DBColumnInfo> QueryColumnCatalog(DBRelationInfo relation)
        {
            string SQL = null;

            object[] aParams = null;
            switch (relation.Schema.Source)
            {
            case dbOrigen.ORA:
                SQL = AdministradorPreferencias.Read(PrefsBD.ORACustomColumnSchemaQuery);
                if (SQL == null || SQL.Trim() == string.Empty)
                {
                    SQL = AdministradorPreferencias.Read(PrefsBD.ORADefaultColumnSchemaQuery);
                }
                aParams = new object[] { relation.Schema.Name.Trim(), relation.Name.Trim() };
                break;

            case dbOrigen.PGSQL:
                SQL = AdministradorPreferencias.Read(PrefsBD.PGSQLCustomColumnSchemaQuery);
                if (SQL == null || SQL.Trim() == string.Empty)
                {
                    SQL = AdministradorPreferencias.Read(PrefsBD.PGSQLDefaultColumnSchemaQuery);
                }
                aParams = new object[] { DBSettings.PGSQLDb, relation.Schema.Name.Trim(), relation.Name.Trim() };
                break;
            }

            DataSet ds = GetDataSet(relation.Schema.Source, SQL, aParams);
            Collection <DBColumnInfo> columns = new Collection <DBColumnInfo>();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                string length = (r[2] == System.DBNull.Value) ? string.Empty : r[2].ToString();
                columns.Add(new DBColumnInfo(relation, (string)r[0], (string)r[1], length));
            }
            return(columns);
        }
Exemplo n.º 12
0
        public void CargarDatos()
        {
            string ambito = string.Empty;

            if (this._uge.GetType() == typeof(BaseOrg))
            {
                ambito = AdministradorPreferencias.Read(PrefsGlobal.OrgName);
            }
            else if (this._uge.GetType() == typeof(Zona))
            {
                ambito = (this._uge as Zona).Denominacion;
            }
            else if (this._uge.GetType() == typeof(Edificio))
            {
                ambito = (this._uge as Edificio).Denominacion;
            }
            else if (this._uge.GetType() == typeof(PlantaBase))
            {
                ambito = string.Format("{0} en {1}", (this._uge as PlantaBase).Planta.ToString(),
                                       AdministradorPreferencias.Read(PrefsGlobal.OrgName));
            }
            else if (this._uge.GetType() == typeof(PlantaZona))
            {
                ambito = (this._uge as PlantaZona).Planta.ToString() + " en " + (this._uge as PlantaZona).Zona.Denominacion;
            }
            else if (this._uge.GetType() == typeof(PlantaEdificio))
            {
                ambito = (this._uge as PlantaEdificio).Denominacion;
            }

            this.Text = string.Format("SIGUANETDesktop TreeDATA ({0}) - {1}", ambito, this._tituloForm);

            this.nodoBaseOrg.Tag = new BaseOrg();
            int i = 0;

            if (this._consulta != null)
            {
                if (this._consulta is List <Estancia> )
                {
                    EventoInicioModulo((this._consulta as List <Estancia>).Count);
                    foreach (Estancia e in (List <Estancia>) this._consulta)
                    {
                        TreeNode NodoPlanta   = GUIUtils.obtenerNodoPlanta(e, nodoBaseOrg);
                        TreeNode nodoEstancia = new TreeNode(e.Codigo);
                        nodoEstancia.Tag = e;
                        NodoPlanta.Nodes.Add(nodoEstancia);
                        EventoPasoModulo(++i);
                    }
                }
                else if (this._consulta is List <Ubicacion> )
                {
                    EventoInicioModulo((this._consulta as List <Ubicacion>).Count);
                    foreach (Ubicacion u in (List <Ubicacion>) this._consulta)
                    {
                        TreeNode NodoPlanta    = GUIUtils.obtenerNodoPlanta(u.Estancia, nodoBaseOrg);
                        TreeNode nodoUbicacion = new TreeNode(u.Persona.ToString());
                        nodoUbicacion.Tag = u;
                        NodoPlanta.Nodes.Add(nodoUbicacion);
                        EventoPasoModulo(++i);
                    }
                }
            }

            this.twNavegador.Nodes.Add(this.nodoBaseOrg);
            if (this._ds != null)
            {
                if (this._ds.Tables.Count > 0)
                {
                    this.dg.DataSource    = this._ds.Tables[0];
                    this.tslNumFilas.Text = string.Format("{0} registros", this._ds.Tables[0].Rows.Count);
                }
            }
        }
Exemplo n.º 13
0
 void TxURLTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsGlobal.AuthDownloadURL, this.txURL.Text.Trim());
 }
Exemplo n.º 14
0
        public void CargarDatos()
        {
            string ambito = string.Empty;

            if (this._uge.GetType() == typeof(BaseOrg))
            {
                ambito = AdministradorPreferencias.Read(PrefsGlobal.OrgName);
            }
            else if (this._uge.GetType() == typeof(Zona))
            {
                ambito = (this._uge as Zona).Denominacion;
            }
            else if (this._uge.GetType() == typeof(Edificio))
            {
                ambito = (this._uge as Edificio).Denominacion;
            }
            else if (this._uge.GetType() == typeof(PlantaBase))
            {
                ambito = string.Format("{0} en {1}", (this._uge as PlantaBase).Planta.ToString(),
                                       AdministradorPreferencias.Read(PrefsGlobal.OrgName));
            }
            else if (this._uge.GetType() == typeof(PlantaZona))
            {
                ambito = (this._uge as PlantaZona).Planta.ToString() + " en " + (this._uge as PlantaZona).Zona.Denominacion;
            }
            else if (this._uge.GetType() == typeof(PlantaEdificio))
            {
                ambito = (this._uge as PlantaEdificio).Denominacion;
            }

            this.Text = string.Format("SIGUANETDesktop TreeMAP ({0}) - {1}", ambito, this._tituloForm);

            this.cbPaletaDinamica.DataSource    = Enum.GetNames(typeof(TipoPaleta));
            this.cbPaletaDinamica.SelectedItem  = Enum.GetName(typeof(TipoPaleta), TipoPaleta.predeterminada);
            this.cbPaletaDinamica.DropDownStyle = ComboBoxStyle.DropDownList;
            this.tpLeyenda.Enabled     = false;
            this.tpPDF.Enabled         = false;
            this.tsbPDFLeyenda.Checked = this.PDFLeyenda;

            if (this._ds != null)
            {
                if (this._ds.Tables.Count > 0)
                {
                    this.dg.DataSource    = this._ds.Tables[0];
                    this.tslNumFilas.Text = string.Format("{0} registros", this._ds.Tables[0].Rows.Count);
                }
            }

            this.listInfo.GridLines = true;

            this.listInfo.Groups.Add(this._lvgGeneral);
            this.listInfo.Groups.Add(this._lvgLugar);
            this.listInfo.Groups.Add(this._lvgAdscripcion);
            this.listInfo.Groups.Add(this._lvgUso);
            this.listInfo.Groups.Add(this._lvgOcupacion);
            this.listInfo.Groups.Add(this._lvgPersonal);

            this.listInfo.Items.Add(this._lviCodEstancia);
            this.listInfo.Items.Add(this._lviDenoEstancia);
            this.listInfo.Items.Add(this._lviSuperficie);

            this.listInfo.Items.Add(this._lviCodZona);
            this.listInfo.Items.Add(this._lviNomZona);
            this.listInfo.Items.Add(this._lviCodEdificio);
            this.listInfo.Items.Add(this._lviNomEdificio);
            this.listInfo.Items.Add(this._lviPlanta);

            this.listInfo.Items.Add(this._lviCodDpto);
            this.listInfo.Items.Add(this._lviNomDpto);

            this.listInfo.Items.Add(this._lviCodActividad);
            this.listInfo.Items.Add(this._lviDescriActividad);

            this.listInfo.Items.Add(this._lviNumOcupantes);

            this._lviCodEstancia.Group     = this._lvgGeneral;
            this._lviDenoEstancia.Group    = this._lvgGeneral;
            this._lviSuperficie.Group      = this._lvgGeneral;
            this._lviCodZona.Group         = this._lvgLugar;
            this._lviNomZona.Group         = this._lvgLugar;
            this._lviCodEdificio.Group     = this._lvgLugar;
            this._lviNomEdificio.Group     = this._lvgLugar;
            this._lviPlanta.Group          = this._lvgLugar;
            this._lviCodDpto.Group         = this._lvgAdscripcion;
            this._lviNomDpto.Group         = this._lvgAdscripcion;
            this._lviCodActividad.Group    = this._lvgUso;
            this._lviDescriActividad.Group = this._lvgUso;
            this._lviNumOcupantes.Group    = this._lvgOcupacion;

            this.toolStrip1.Enabled = false;

            this.Mapa              = new SharpMap.Map(this.miVMapa.Size);
            this.Mapa.BackColor    = Color.White;
            this.Mapa.MapRendered += new SharpMap.Map.MapRenderedEventHandler(MapRender);

            this.nodoBaseOrg.Tag = new BaseOrg();
            int i = 0;

            if (this._consulta == null)
            {
                List <PlantaEdificio> lpe = null;
                if (this._uge is BaseOrg)
                {
                    lpe = (this._uge as BaseOrg).ObtenerPlantasEdificio();
                }
                else if (this._uge is PlantaBase)
                {
                    lpe = (this._uge as PlantaBase).ObtenerPlantasEdificio();
                }
                else if (this._uge is Zona)
                {
                    lpe = (this._uge as Zona).ObtenerPlantasEdificio();
                }
                else if (this._uge is Edificio)
                {
                    lpe = (this._uge as Edificio).ObtenerPlantas();
                }
                else if (this._uge is PlantaZona)
                {
                    lpe = (this._uge as PlantaZona).ObtenerPlantasEdificio();
                }
                else if (this._uge is PlantaEdificio)
                {
                    lpe = new List <PlantaEdificio>();
                    lpe.Add((PlantaEdificio)this._uge);
                }
                if (lpe != null)
                {
                    EventoInicioModulo(lpe.Count);
                    foreach (PlantaEdificio pe in lpe)
                    {
                        TreeNode NodoEdificio = GUIUtils.obtenerNodoEdificio(pe, nodoBaseOrg);
                        TreeNode nodoPlanta   = new TreeNode(pe.Codigo);
                        nodoPlanta.Tag = pe;
                        NodoEdificio.Nodes.Add(nodoPlanta);
                        EventoPasoModulo(++i);
                    }
                }
            }
            else if (this._consulta is List <Estancia> )
            {
                EventoInicioModulo((this._consulta as List <Estancia>).Count);
                foreach (Estancia e in (List <Estancia>) this._consulta)
                {
                    TreeNode NodoPlanta   = GUIUtils.obtenerNodoPlanta(e, nodoBaseOrg);
                    TreeNode nodoEstancia = new TreeNode(e.Codigo);
                    nodoEstancia.Tag = e;
                    NodoPlanta.Nodes.Add(nodoEstancia);
                    EventoPasoModulo(++i);
                }
            }
            else if (this._consulta is List <Ubicacion> )
            {
                EventoInicioModulo((this._consulta as List <Ubicacion>).Count);
                foreach (Ubicacion u in (List <Ubicacion>) this._consulta)
                {
                    TreeNode NodoPlanta    = GUIUtils.obtenerNodoPlanta(u.Estancia, nodoBaseOrg);
                    TreeNode nodoUbicacion = new TreeNode(u.Persona.ToString());
                    nodoUbicacion.Tag = u;
                    NodoPlanta.Nodes.Add(nodoUbicacion);
                    EventoPasoModulo(++i);
                }
            }
            this.twNavegador.Nodes.Add(this.nodoBaseOrg);
        }
Exemplo n.º 15
0
 void CkUseLocalCopyCheckedChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsGlobal.SGDUseLocalCopy, this.ckUseLocalCopy.Checked.ToString());
 }
Exemplo n.º 16
0
 void TxCatalogoColumnasCustomTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsBD.ORACustomColumnSchemaQuery, this.txCatalogoColumnasCustom.Text.Trim());
 }
Exemplo n.º 17
0
 void TxCatalogoVistasCustomTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsBD.PGSQLCustomViewSchemaQuery, this.txCatalogoVistasCustom.Text.Trim());
 }
Exemplo n.º 18
0
 void TxEsquemasTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsBD.ORATargetSchemas, this.txEsquemas.Text.Trim());
 }
Exemplo n.º 19
0
 void TxPasswordTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsGlobal.AuthDownloadWithPassword, this.txPassword.Text.Trim());
 }
Exemplo n.º 20
0
 void TxLoginTextChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsGlobal.AuthDownloadWithLogin, this.txLogin.Text.Trim());
 }
Exemplo n.º 21
0
 void CkCredentialsCheckedChanged(object sender, EventArgs e)
 {
     AdministradorPreferencias.Update(PrefsGlobal.AuthDownloadUsingCredentials, this.ckCredentials.Checked.ToString());
     this.lLogin.Enabled    = this.txLogin.Enabled = this.ckCredentials.Checked;
     this.lPassword.Enabled = this.txPassword.Enabled = this.ckCredentials.Checked;
 }
Exemplo n.º 22
0
 private void SyncPrefs()
 {
     AdministradorPreferencias.Update(PrefsGlobal.AuthUseLocal, this.rbLocal.Checked.ToString());
     AdministradorPreferencias.Update(PrefsGlobal.AuthUseRemote, this.rbRemote.Checked.ToString());
     SyncControls(this.rbRemote.Checked);
 }