示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (txtUsuario.Text == "")
            {
                MessageBox.Show(" Ingrese su Usuario");
            }
            if (txtContraseña.Text == "")
            {
                MessageBox.Show(" Ingrese la contraseña");
            }
            if (txtUsuario.Text != "" && txtContraseña.Text != "")
            {
                IWorkspace pWorkspace = WorkgroupArcSdeWorkspaceFromPropertySet();
                IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;
                ITable pTable = pFeatureWorkspace.OpenTable("TLOB.F03_USUARIOS");

                Table_To_DataTable tabla = new Table_To_DataTable();
                bool autentifiacion = tabla.autentificacion(pTable, txtUsuario.Text, txtContraseña.Text);
                if (autentifiacion)
                {
                    FrmConsulta Consulta = new FrmConsulta();
                    Consulta.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Usuario ó Contraseña invalidos");
                }
            }
        }
示例#2
0
        public void copiaImagen(string fileToCopy, string Filename)
        {
            try
            {
                NetworkCredential writeCredentials = new NetworkCredential("usr-siger", "we3nya$i");
                using (new NetworkConnection(@"\\172.25.1.204\siger\imagenes\", writeCredentials))
                {

                    System.IO.File.Copy(fileToCopy, Filename, true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error conectandose al servidor de imagenes" + ex.Message);
            }
            try
            {

                IGPUtilities pGputilities = new GPUtilitiesClass();
                Table_To_DataTable tabla = new Table_To_DataTable();
                IWorkspace pWorkspace = WorkgroupArcSdeWorkspaceFromPropertySet();
                IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;
                ITable pTable = pFeatureWorkspace.OpenTable("TLOB.F03DES_DSCRG");
                tabla.registrarUsuario(pTable, Convert.ToInt32(dataGridViewResultados.SelectedRows[0].Cells[2].Value));
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error actualizando base de datos" + ex.Message);
            }
            lblProceso.Text = "Descarga Terminada";
            btnDescargar.Enabled = true;

        }
示例#3
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            IGPUtilities pGputilities = new GPUtilitiesClass();
            string Query;
            IWorkspace pWorkspace = WorkgroupArcSdeWorkspaceFromPropertySet();
            IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;
            ITable pTable=pFeatureWorkspace.OpenTable("TLOB.F03IMG_IMGN_100K");
            //ITable pTable = pGputilities.OpenTableFromString(@"E:\SICAT\TELEOBSERVACION\TeleObservacion.mdb\F03IMG_IMGN_100K");
            if (cbxTipoRadar!= null)
            {
                    Query = ConsutaExtent(txtLongitudMax.Text, txtLongitudMin.Text, txtLatitudMin.Text, txtLatitudMax.Text, cbxTipo.Text, txtNombre.Text, dateTimeFecha, groupBox2.Controls["cbxTipoRadar"].Text, groupBox2.Controls["txbIdentificador"].Text,"","");
            }
            else if (txbPath != null)
            {
                    Query = ConsutaExtent(txtLongitudMax.Text, txtLongitudMin.Text, txtLatitudMin.Text, txtLatitudMax.Text, cbxTipo.Text, txtNombre.Text, dateTimeFecha, "", "", groupBox2.Controls["txbPath"].Text, groupBox2.Controls["txbRow"].Text);
            }
            else
            {
                    Query = ConsutaExtent(txtLongitudMax.Text, txtLongitudMin.Text, txtLatitudMin.Text, txtLatitudMax.Text, cbxTipo.Text, txtNombre.Text, dateTimeFecha, "", "", "", "");
            }
            Table_To_DataTable pDataTable = new Table_To_DataTable();
            DataTable Tabla = pDataTable.ConvertITable(pTable, Query);
            dataGridViewResultados.DataSource = Tabla;
            dataGridViewResultados.Update();

           

        }