Example #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (!valida())
            {
                return;
            }
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string command = "INSERT INTO COMPONENTE(NUMERO_SERIE_PADRE,NUMERO_SERIE_COMPONENTE)";

            command += "VALUES(@NUMERO_SERIE_PADRE,@NUMERO_SERIE_COMPONENTE)";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@NUMERO_SERIE_PADRE", cmbDispositivo1.SelectedItem.ToString());
            comandoInsersion.Parameters.AddWithValue("@NUMERO_SERIE_COMPONENTE", cmbDispositivo2.SelectedItem.ToString());
            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
            }
            connection.Close();
            MessageBox.Show("DISPOSITIVO VINCULADO", "CORRECTO", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public static bool finalizarIncidenciaTecnico(int ID, DateTime fecha, String Tecnico)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string command = "INSERT INTO INCIDENCIA_CONCLUIDA (ID_INCIDENCIA,FECHA_SOLUCION, SOLUCIONADO_POR)";

            command += " VALUES(@ID, @fecha, @Tecnico)";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@ID", ID);
            comandoInsersion.Parameters.AddWithValue("@fecha", fecha);
            comandoInsersion.Parameters.AddWithValue("@Tecnico", Tecnico);
            ActualizarStatusIncidenciaFin(ID);
            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
                return(false);
            }
            connection.Close();
            MessageBox.Show("FINALIZADA EXITOSAMENTE", "Finalización", MessageBoxButtons.OK, MessageBoxIcon.Information);
            return(true);
        }
        public static bool ActualizarStatusIncidenciaFin(int id)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string     command          = "UPDATE INCIDENCIA SET ESTATUS = 1 WHERE ID= @ID";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@ID", id);

            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
                return(false);
            }
            connection.Close();

            return(true);
        }
        private void frmTiempoRespuestaIncidencia_Load(object sender, EventArgs e)
        {
            SqlConnection Connection2 = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection2 == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                return;
            }

            SqlDataReader Lector2 = null;
            string        ID = "", DE = "", TI = "", PR = "", FE = "";
            string        strComandoC2 = "SELECT I.ID,I.Descripcion,T.Descripcion,P.Descripcion, I.FechaInicio, I.Tiempo_Respuesta, I.ID_Stat FROM INCIDENCIA I INNER JOIN PRIORIDAD P ON I.ID_Prioridad=P.ID INNER JOIN TIPO_INCIDENCIA T ON I.ID_Tipo=T.ID WHERE I.ID_Tecnico=" + TecID;

            Lector2 = UsoBD.Consulta(strComandoC2, Connection2);

            if (Lector2 == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Connection2.Close();
                return;
            }
            if (Lector2.HasRows)
            {
                while (Lector2.Read())
                {
                    if (Utileria.IsEmpty(Lector2.GetValue(5).ToString()))
                    {
                        if (Lector2.GetValue(6).ToString() != "1" && Lector2.GetValue(5).ToString() != "5")
                        {
                            ID = Lector2.GetValue(0).ToString();
                            DE = Lector2.GetValue(1).ToString();
                            TI = Lector2.GetValue(2).ToString();
                            PR = Lector2.GetValue(3).ToString();
                            FE = Lector2.GetValue(4).ToString();

                            ListViewItem Registro = new ListViewItem(ID);
                            Registro.SubItems.Add(DE);
                            Registro.SubItems.Add(TI);
                            Registro.SubItems.Add(PR);
                            Registro.SubItems.Add(FE);

                            lvIndicencias.Items.Add(Registro);
                        }
                    }
                }
            }
            Connection2.Close();
        }
        public static bool AgregarDeptoTecnico(String Nombre)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string command = "INSERT INTO DEPARTAMENTO_TECNICO(NOMBRE)";

            command += " VALUES(@Nombre)";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@Nombre", Nombre);

            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
                return(false);
            }
            connection.Close();
            MessageBox.Show("GUARDADO EXITOSAMENTE", "ADMINISTRADOR", MessageBoxButtons.OK, MessageBoxIcon.Information);
            return(true);
        }
Example #6
0
        public static bool AñadirTecnico(String usuario, String password, int departamentoTecnico)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string command = "INSERT INTO TECNICO(USUARIO, PASSWORD, DEPARTAMENTO_TECNICO)";

            command += " VALUES(@Usuario, @password, @departamentoTecnico)";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@Usuario", usuario);
            comandoInsersion.Parameters.AddWithValue("@password", password);
            comandoInsersion.Parameters.AddWithValue("@departamentoTecnico", departamentoTecnico);

            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
                return(false);
            }
            connection.Close();
            MessageBox.Show("GUARDADO EXITOSAMENTE", "ADMINISTRADOR", MessageBoxButtons.OK, MessageBoxIcon.Information);
            return(true);
        }
Example #7
0
        public static bool ActualizarDepartamentoTecnico(String usuario, int departamentoTecnico)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string     command          = "UPDATE TECNICO SET DEPARTAMENTO_TECNICO = @departamentoTecnico WHERE USUARIO= @Usuario";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@Usuario", usuario);
            comandoInsersion.Parameters.AddWithValue("@departamentoTecnico", departamentoTecnico);
            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
                return(false);
            }
            connection.Close();
            MessageBox.Show("ACTUALIZADO EXITOSAMENTE", "TECNICO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            return(true);
        }
Example #8
0
        public bool AgregarDetalle(int ClaveFact, int ClaveArt, int Cant)
        {
            string        strConexion = Rutinas.GetConnectionString();
            SqlConnection Con         = UsoBD.ConectaBD(strConexion);

            if (Con == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return(false);
            }
            SqlDataReader Lector = null;

            string strComandoC = "exec InsertarDetalleFactura " + ClaveFact + "," + ClaveArt + "," + Cant;

            Lector = UsoBD.Consulta(strComandoC, Con);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Con.Close();
                return(false);
            }
            Con.Close();
            return(false);
        }
Example #9
0
        private void btnAutorizar_Click(object sender, EventArgs e)
        {
            SqlConnection connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (connection == null)
            {
                foreach (SqlError item in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(item.Message);
                }
            }
            string     command          = "UPDATE CAMBIO_COMPONENTE SET APROBADO=1 WHERE ID = @id ";
            SqlCommand comandoInsersion = new SqlCommand(command, connection);

            comandoInsersion.Parameters.AddWithValue("@id", cmbCambio.SelectedItem.ToString());
            try
            {
                comandoInsersion.ExecuteNonQuery();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
                connection.Close();
            }
            connection.Close();
            MessageBox.Show("ACTUALIZADO EXITOSAMENTE", "JEFE", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
Example #10
0
        public bool validaUsuario(string nombre)
        {
            bool          encontro = false;
            String        Conexion = Utileria.GetConnectionString();
            SqlConnection Conecta  = UsoBD.ConectaBD(Conexion);

            if (Conecta == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
            }
            string        Query  = "SELECT USUARIO FROM ADMINISTRADOR WHERE USUARIO = " + "'" + nombre + "'";
            SqlDataReader Lector = null;

            Lector = UsoBD.Consulta(Query, Conecta);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL REALIZAR LA CONSULTA");
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
            }
            if (Lector.HasRows)
            {
                encontro = true;
            }
            Conecta.Close();
            return(encontro);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (Utileria.IsEmpty(txtDesc.Text))
            {
                MessageBox.Show("NO SE ACEPTAN CAMPOS VACIOS EN LA DESCRIPCIÓN DEL PROBLEMA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Utileria.IsEmpty(txtSol.Text))
            {
                MessageBox.Show("NO SE ACEPTAN CAMPOS VACIOS EN LA SOLUCIÓN DEL PROBLEMA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Utileria.IsEmpty(txtTime.Text))
            {
                MessageBox.Show("NO SE ACEPTAN CAMPOS VACIOS EN EL TIEMPO DE SOLUCIÓN DEL PROBLEMA", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return;
            }


            string strComando = "INSERT INTO PROBLEMAS_CONOCIDOS(Descripcion,Solucion,Tiempo)";

            strComando += " VALUES(@Descripcion,@Solucion,@Tiempo)";

            SqlCommand Insert = new SqlCommand(strComando, Connection);

            Insert.Parameters.AddWithValue("@Descripcion", txtDesc.Text);
            Insert.Parameters.AddWithValue("@Solucion", txtSol.Text);
            Insert.Parameters.AddWithValue("@Tiempo", txtTime.Text);

            try
            {
                Insert.ExecuteNonQuery();
            }
            catch (SqlException Ex)
            {
                foreach (SqlError item in Ex.Errors)
                {
                    MessageBox.Show(item.Message);
                }

                Connection.Close();
                return;
            }
            MessageBox.Show("SOLUCION A PROBLEMA CONOCIDO AGREGADO EXITOSAMENTE", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Connection.Close();
        }
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (lvDetalleFactura.SelectedItems.Count == 0)
            {
                MessageBox.Show("NO HA SELECCIONADO NINGUN DETALLE DE FACTURA", "SIN SELECCIONAR", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DialogResult R = MessageBox.Show("¿DESEA ELIMINAR EL DETALLE SELECCIONADO?", "CONFIRMAR", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (R == DialogResult.Yes)
            {
                string Fac, Art, Cant, Pre;
                for (int i = 0; i < lvDetalleFactura.Items.Count; i++)
                {
                    if (lvDetalleFactura.SelectedItems.Contains(lvDetalleFactura.Items[i]))
                    {
                        Fac  = lvDetalleFactura.Items[i].SubItems[0].Text;
                        Art  = lvDetalleFactura.Items[i].SubItems[1].Text;
                        Cant = lvDetalleFactura.Items[i].SubItems[3].Text;
                        Pre  = lvDetalleFactura.Items[i].SubItems[4].Text;

                        string        strConexion = Rutinas.GetConnectionString();
                        SqlConnection Con         = UsoBD.ConectaBD(strConexion);

                        if (Con == null)
                        {
                            MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS");

                            foreach (SqlError E in UsoBD.ESalida.Errors)
                            {
                                MessageBox.Show(E.Message);
                            }
                            return;
                        }
                        SqlDataReader Lector = null;

                        string strComandoC = "EXEC EliminaDetalleFactura " + Fac + "," + Art + "," + Cant + "," + Pre;

                        Lector = UsoBD.Consulta(strComandoC, Con);
                        if (Lector == null)
                        {
                            MessageBox.Show("ERROR AL HACER LA CONSULTA");
                            foreach (SqlError E in UsoBD.ESalida.Errors)
                            {
                                MessageBox.Show(E.Message);
                            }

                            Con.Close();
                            return;
                        }
                        Con.Close();
                        lvDetalleFactura.Items[i].Remove();
                        MessageBox.Show("LA ELIMINACION DEL DETALLE DE FACTURA SE HA REALIZADO CORRECTAMENTE", "ELIMINACION REALIZADA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
            }
        }
Example #13
0
        private void cmbDepartamentos_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection conn = UsoBD.ConectaBD(ConexionBD.strCon);

            if (conn == null)
            {
                MessageBox.Show("Imposible conectar con la BD");
                foreach (SqlError err in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(err.Message);
                }
                return;
            }
            else
            {
                string strCommando = "SELECT emp_id, emp_nom, emp_apar, emp_amar, emp_dom, emp_sueldoD, bon_total, departamento FROM EMPLEADOS" +
                                     " inner join BONOS on EMPLEADOS.emp_id=BONOS.empleado";
                SqlDataReader lector = null;
                try
                {
                    lector = UsoBD.Consulta(strCommando, conn);
                }
                catch (SqlException ex)
                {
                    MessageBox.Show("Error al realizar consulta");
                    foreach (SqlError err in ex.Errors)
                    {
                        MessageBox.Show(err.Message);
                    }
                    conn.Close();
                    return;
                }
                if (lector.HasRows)
                {
                    while (lector.Read())
                    {
                        string dep = lector.GetValue(7).ToString();
                        if (cmbDepartamentos.SelectedItem.ToString() == dep)
                        {
                            DataGridViewRow fila = new DataGridViewRow();
                            fila.CreateCells(dataGridViewNomina);
                            fila.Cells[0].Value = lector.GetValue(0).ToString();
                            fila.Cells[1].Value = lector.GetValue(1).ToString();
                            fila.Cells[2].Value = lector.GetValue(2).ToString();
                            fila.Cells[3].Value = lector.GetValue(3).ToString();
                            fila.Cells[4].Value = lector.GetValue(4).ToString();
                            fila.Cells[5].Value = lector.GetValue(5).ToString();
                            fila.Cells[6].Value = lector.GetValue(6).ToString();


                            dataGridViewNomina.Rows.Add(fila);
                        }
                    }
                }
                conn.Close();
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            DialogResult Result = MessageBox.Show("¿DESEA AGREGAR ESTE ELEMENTO?", "PREGUNTA", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (Result == DialogResult.No)
            {
                return;
            }

            int IDCI = 0;

            if (Utileria.IsEmpty(txtDescripcion.Text))
            {
                MessageBox.Show("NO SE ACEPTAN CAMPOS VACIOS EN LA DESCRIPCION", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return;
            }

            SqlDataReader Lector      = null;
            string        strComandoC = "SELECT ID FROM CI WHERE NumSerie LIKE '" + lbl.Text + "'";

            Lector = UsoBD.Consulta(strComandoC, Connection);

            if (Lector == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Connection.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    IDCI = Convert.ToInt32(Lector.GetValue(0).ToString());
                }
            }
            Connection.Close();
            AdmIn.AddInCI(txtDescripcion.Text, maskDate.Text, IDCI, Tipo, IDEmp);
        }
        private void cmbArticulos_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbArticulos.SelectedIndex == 0)
            {
                lblDescripcion.Text = "";
                lblMarca.Text       = "";
                lblPrecio.Text      = "";
                lblCantidad.Text    = "";
            }
            else
            {
                string strConexion = Rutinas.GetConnectionString();

                SqlConnection Con = UsoBD.ConectaBD(strConexion);
                if (Con == null)
                {
                    MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS");

                    foreach (SqlError E in UsoBD.ESalida.Errors)
                    {
                        MessageBox.Show(E.Message);
                    }
                    return;
                }
                SqlDataReader Lector = null;

                string Desc = cmbArticulos.SelectedItem.ToString();

                string strComando = "SELECT Descripcion,Marca,Precio,Cantidad FROM Articulo WHERE Descripcion LIKE'" + Desc + "'";

                Lector = UsoBD.Consulta(strComando, Con);

                if (Lector == null)
                {
                    MessageBox.Show("ERROR AL HACER LA CONSULTA");
                    foreach (SqlError E in UsoBD.ESalida.Errors)
                    {
                        MessageBox.Show(E.Message);
                    }

                    Con.Close();
                    return;
                }
                if (Lector.HasRows)
                {
                    while (Lector.Read())
                    {
                        lblDescripcion.Text = Lector.GetValue(0).ToString();
                        lblMarca.Text       = Lector.GetValue(1).ToString();
                        lblPrecio.Text      = Lector.GetValue(2).ToString();
                        lblCantidad.Text    = Lector.GetValue(3).ToString();
                    }
                }
                Con.Close();
            }
        }
        private void frmBajaEmpleado_Load(object sender, EventArgs e)
        {
            SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                return;
            }

            SqlDataReader Lector = null;
            string        NA = "", EM = "", CE = "", DI = "", RO = "";
            string        strComandoC = "SELECT E.Nombre,Email,Celular,Direccion,R.Nombre FROM EMPLEADO E INNER JOIN ROL R ON E.ID_Rol=R.ID WHERE Estatus=1";

            Lector = UsoBD.Consulta(strComandoC, Connection);

            if (Lector == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Connection.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    NA = Lector.GetValue(0).ToString();
                    EM = Lector.GetValue(1).ToString();
                    CE = Lector.GetValue(2).ToString();
                    DI = Lector.GetValue(3).ToString();
                    RO = Lector.GetValue(3).ToString();

                    ListViewItem Registro = new ListViewItem(NA);
                    Registro.SubItems.Add(EM);
                    Registro.SubItems.Add(CE);
                    Registro.SubItems.Add(DI);
                    Registro.SubItems.Add(RO);

                    lvEmpleados.Items.Add(Registro);
                }
            }
            Connection.Close();
        }
        private void btnAprobar_Click(object sender, EventArgs e)
        {
            if (lvIndicencias.SelectedItems.Count == 0)
            {
                MessageBox.Show("NO HA SELECCIONADO NINGUNA INCIDENCIA", "SIN SELECCIONAR", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                int PrioID = 0, Stat = 3;

                SqlConnection Connection  = UsoBD.ConectaBD(Utileria.GetConnectionString());

                if (Connection == null)
                {
                    MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                    foreach (SqlError E in UsoBD.ESalida.Errors)
                    {
                        MessageBox.Show(E.Message);
                    }

                    return;
                }
                SqlDataReader Lector      = null;
                string        strComandoC = "SELECT ID FROM PRIORIDAD WHERE Descripcion LIKE '" + cmbPrioridad.SelectedItem.ToString() + "'";

                Lector = UsoBD.Consulta(strComandoC, Connection);
                if (Lector == null)
                {
                    MessageBox.Show("ERROR AL HACER LA CONSULTA");
                    foreach (SqlError E in UsoBD.ESalida.Errors)
                    {
                        MessageBox.Show(E.Message);
                    }

                    Connection.Close();
                    return;
                }
                if (Lector.HasRows)
                {
                    while (Lector.Read())
                    {
                        PrioID = Convert.ToInt32(Lector.GetValue(0).ToString());
                    }
                }
                Connection.Close();

                AdmIn.UpdatePrioridad(InID, PrioID);
                AdmIn.UpdateStatus(InID, Stat);
                MessageBox.Show("INCIDENCIA APROBADA EXITOSAMENTE", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #18
0
        private void cmbClaveFactura_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbClaveFactura.SelectedIndex < 0)
            {
                return;
            }
            string        claveFactura = cmbClaveFactura.SelectedItem.ToString();
            string        strConexion  = Rutinas.GetConnectionString();
            SqlConnection Con          = UsoBD.ConectaBD(strConexion);

            if (Con == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return;
            }

            SqlDataReader Lector = null;

            string strComando = "select p.clave,p.Nombre,f.monto,format(f.fecha,'dd/MM/yyyy') from Factura f inner join Proveedor p on f.provedor=p.Clave where f.clave =" + claveFactura;

            Lector = UsoBD.Consulta(strComando, Con);

            if (Lector == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Con.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    txtClaveProveedor.Text = Lector.GetValue(0).ToString();
                    txtProveedor.Text      = Lector.GetValue(1).ToString();
                    txtImporte.Text        = Lector.GetValue(2).ToString();
                    txtFecha.Text          = Lector.GetValue(3).ToString();
                }
            }
            Con.Close();
            int factura = int.Parse(claveFactura);

            txtCantDetalles.Text = String.Format("" + mD.DetallesPorFactura(factura));
        }
Example #19
0
        private void frmConsultaDias_Load(object sender, EventArgs e)
        {
            SqlConnection conn = UsoBD.ConectaBD(ConexionBD.strCon);

            if (conn == null)
            {
                MessageBox.Show("Imposible conectar con la BD");
                foreach (SqlError err in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(err.Message);
                }
                return;
            }
            else
            {
                string strCommando = "SELECT emp_id, emp_nom, emp_apar, emp_amar, departamento, dias_Cantidad FROM EMPLEADOS " +
                                     "inner join EMPLEADO_DIAS on EMPLEADOS.emp_id=EMPLEADO_DIAS.emp_id " +
                                     "inner join DIAS on DIAS.dias_id=EMPLEADO_DIAS.dias_id";
                SqlDataReader lector = null;
                try
                {
                    lector = UsoBD.Consulta(strCommando, conn);
                }
                catch (SqlException ex)
                {
                    MessageBox.Show("Error al realizar consulta");
                    foreach (SqlError err in ex.Errors)
                    {
                        MessageBox.Show(err.Message);
                    }
                    conn.Close();
                    return;
                }
                if (lector.HasRows)
                {
                    while (lector.Read())
                    {
                        DataGridViewRow fila = new DataGridViewRow();
                        fila.CreateCells(dataGridViewNomina);
                        fila.Cells[0].Value = lector.GetValue(0).ToString();
                        fila.Cells[1].Value = lector.GetValue(1).ToString();
                        fila.Cells[2].Value = lector.GetValue(2).ToString();
                        fila.Cells[3].Value = lector.GetValue(3).ToString();
                        fila.Cells[4].Value = lector.GetValue(4).ToString();
                        fila.Cells[5].Value = lector.GetValue(5).ToString();


                        dataGridViewNomina.Rows.Add(fila);
                    }
                }
                conn.Close();
            }
        }
        private void frmVerProblemasConocidos_Load(object sender, EventArgs e)
        {
            SqlConnection Connection2 = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection2 == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                return;
            }

            SqlDataReader Lector2 = null;
            string        ID = "", DE = "", SO = "", TM = "";
            string        strComandoC2 = "SELECT * FROM PROBLEMAS_CONOCIDOS";

            Lector2 = UsoBD.Consulta(strComandoC2, Connection2);

            if (Lector2 == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Connection2.Close();
                return;
            }
            if (Lector2.HasRows)
            {
                while (Lector2.Read())
                {
                    ID = Lector2.GetValue(0).ToString();
                    DE = Lector2.GetValue(1).ToString();
                    SO = Lector2.GetValue(2).ToString();
                    TM = Lector2.GetValue(3).ToString();

                    ListViewItem Registro = new ListViewItem(ID);
                    Registro.SubItems.Add(DE);
                    Registro.SubItems.Add(SO);
                    Registro.SubItems.Add(TM);

                    lvInci.Items.Add(Registro);
                }
            }
            Connection2.Close();
        }
Example #21
0
        private void frmAutorizaCambios_Load(object sender, EventArgs e)
        {
            SqlConnection Connection2 = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection2 == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                return;
            }

            SqlDataReader Lector2 = null;
            string        FE = "", IN = "", DE = "", ID = "";
            string        strComandoC2 = "SELECT C.ID,I.Descripcion,C.Descripcion,C.FechaSol FROM CAMBIOS C INNER JOIN INCIDENCIA I ON C.IDInc=I.ID WHERE C.Estatus=1 ORDER BY C.FechaSol ";

            Lector2 = UsoBD.Consulta(strComandoC2, Connection2);

            if (Lector2 == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Connection2.Close();
                return;
            }
            if (Lector2.HasRows)
            {
                while (Lector2.Read())
                {
                    ID = Lector2.GetValue(0).ToString();
                    IN = Lector2.GetValue(1).ToString();
                    DE = Lector2.GetValue(2).ToString();
                    FE = Lector2.GetValue(3).ToString();

                    ListViewItem Registro = new ListViewItem(ID);
                    Registro.SubItems.Add(IN);
                    Registro.SubItems.Add(DE);
                    Registro.SubItems.Add(FE);

                    lvCam.Items.Add(Registro);
                }
            }
            Connection2.Close();
        }
        private void frmConsultarConlcuidasTecnico_Load(object sender, EventArgs e)
        {
            string        Conexion = Utileria.GetConnectionString();
            SqlConnection Conecta  = UsoBD.ConectaBD(Conexion);

            if (Conecta == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            string        Query  = "SELECT * FROM VW_IncidenciasConcluidas WHERE  SOLUCIONADO_POR= " + "'" + usuario + "'";
            SqlDataReader Lector = null;

            Lector = UsoBD.Consulta(Query, Conecta);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL REALIZAR CONSULTA");
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            if (Lector.HasRows)
            {
                dgvIncidencias.Rows.Clear();
                while (Lector.Read())
                {
                    string ID           = Lector.GetValue(0).ToString();
                    string Dispositivo  = Lector.GetValue(1).ToString();
                    string Marca        = Lector.GetValue(2).ToString();
                    string Modelo       = Lector.GetValue(3).ToString();
                    string Ubicado      = Lector.GetValue(4).ToString();
                    string Incidencia   = Lector.GetValue(5).ToString();
                    string Reporto      = Lector.GetValue(6).ToString();
                    string FechaRep     = Lector.GetValue(7).ToString();
                    string FechaSol     = Lector.GetValue(8).ToString();
                    string Estatus      = Lector.GetValue(9).ToString();
                    string Soluciono    = Lector.GetValue(10).ToString();
                    string tipoSolucion = Lector.GetValue(11).ToString();

                    dgvIncidencias.Rows.Add(ID, Dispositivo, Marca, Modelo, Ubicado, Incidencia, Reporto, FechaRep, FechaSol, Estatus, Soluciono, tipoSolucion);
                }
            }
            Conecta.Close();
        }
        private void cmbIncidencias_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbIncidencias.SelectedIndex == -1)
            {
                return;
            }

            string ID = cmbIncidencias.SelectedItem.ToString();

            string        Conexion = Utileria.GetConnectionString();
            SqlConnection Conecta  = UsoBD.ConectaBD(Conexion);

            if (Conecta == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            string        Query  = "SELECT * FROM VW_Incidencias WHERE ID = " + "'" + ID + "'";
            SqlDataReader Lector = null;

            Lector = UsoBD.Consulta(Query, Conecta);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL REALIZAR CONSULTA");
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    txtDispositivo.Text = Lector.GetValue(1).ToString();
                    txtMarca.Text       = Lector.GetValue(2).ToString();
                    txtModelo.Text      = Lector.GetValue(3).ToString();
                    txtUbicado.Text     = Lector.GetValue(4).ToString();
                    txtIncidencia.Text  = Lector.GetValue(5).ToString();
                    txtReporto.Text     = Lector.GetValue(6).ToString();
                    txtFecha.Text       = Lector.GetValue(7).ToString();
                    txtEstatus.Text     = Lector.GetValue(8).ToString();
                }
            }
            Conecta.Close();
        }
        private void cmbArticulo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbArticulo.SelectedIndex < 0)
            {
                return;
            }
            string descripcion = cmbArticulo.SelectedItem.ToString();

            string        strConexion = Rutinas.GetConnectionString();
            SqlConnection Con         = UsoBD.ConectaBD(strConexion);

            if (Con == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return;
            }

            SqlDataReader Lector = null;

            string strComando = "SELECT * from articulo where descripcion = '" + descripcion + "'";

            Lector = UsoBD.Consulta(strComando, Con);

            if (Lector == null)
            {
                MessageBox.Show("ERROR AL HACER LA CONSULTA");
                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }

                Con.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    txtClaveArt.Text   = Lector.GetValue(0).ToString();
                    txtPrecio.Text     = Lector.GetValue(3).ToString();
                    txtExistencia.Text = Lector.GetValue(4).ToString();
                    Con.Close();
                    return;
                }
            }
            Con.Close();
        }
        private void btnSelectTec_Click(object sender, EventArgs e)
        {
            int ID = 0;

            for (int i = 0; i < lvInci.Items.Count; i++)
            {
                if (lvInci.SelectedItems.Contains(lvInci.Items[i]))
                {
                    ID = Convert.ToInt32(lvInci.Items[i].SubItems[0].Text);

                    SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

                    if (Connection == null)
                    {
                        MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                        foreach (SqlError E in UsoBD.ESalida.Errors)
                        {
                            MessageBox.Show(E.Message);
                        }

                        return;
                    }
                    SqlDataReader Lector      = null;
                    string        strComandoC = "SELECT Descripcion,Solucion,Tiempo FROM PROBLEMAS_CONOCIDOS WHERE ID=" + ID;

                    Lector = UsoBD.Consulta(strComandoC, Connection);
                    if (Lector == null)
                    {
                        MessageBox.Show("ERROR AL HACER LA CONSULTA");
                        foreach (SqlError E in UsoBD.ESalida.Errors)
                        {
                            MessageBox.Show(E.Message);
                        }

                        Connection.Close();
                        return;
                    }
                    if (Lector.HasRows)
                    {
                        while (Lector.Read())
                        {
                            txtDesc.Text = Lector.GetValue(0).ToString();
                            txtSol.Text  = Lector.GetValue(1).ToString();
                            txtTime.Text = Lector.GetValue(2).ToString();
                        }
                    }
                    Connection.Close();
                }
            }
        }
        public bool AddCI(string Nombre, string Descripcion, string NumSerie, string FechaAdqui, int LocID, int EncaID, int ProvID)
        {
            SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

            if (Connection == null)
            {
                MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                foreach (SqlError E in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(E.Message);
                }
                return(false);
            }


            string strComando = "INSERT INTO CI(Nombre,Descripcion,NumSerie,FechaAdquisicion,ID_Localizacion,ID_Encargado,ID_Proveedor,Estatus)";

            strComando += " VALUES(@Nombre,@Descripcion,@NumSerie,@FechaAdqui,@LocID,@EncaID,@ProvID,@Estatus)";

            SqlCommand Insert = new SqlCommand(strComando, Connection);

            Insert.Parameters.AddWithValue("@Nombre", Nombre.Trim());
            Insert.Parameters.AddWithValue("@Descripcion", Descripcion.Trim());
            Insert.Parameters.AddWithValue("@NumSerie", NumSerie.Trim());
            Insert.Parameters.AddWithValue("@FechaAdqui", FechaAdqui.Trim());
            Insert.Parameters.AddWithValue("@LocID", LocID);
            Insert.Parameters.AddWithValue("@EncaID", EncaID);
            Insert.Parameters.AddWithValue("@ProvID", ProvID);
            Insert.Parameters.AddWithValue("@Estatus", 1);


            try
            {
                Insert.ExecuteNonQuery();
            }
            catch (SqlException Ex)
            {
                foreach (SqlError item in Ex.Errors)
                {
                    MessageBox.Show(item.Message);
                }

                Connection.Close();
                return(false);
            }
            MessageBox.Show("ELEMENTO AGREGADO EXITOSAMENTE", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Connection.Close();
            AddUpCI(Nombre, Descripcion, NumSerie, FechaAdqui, LocID, EncaID, ProvID);
            return(true);
        }
        private void cmbNombre_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbProveedores.SelectedIndex < 0)
            {
                return;
            }
            string        Conexion = Rutinas.GetConnectionString();
            SqlConnection Conecta  = UsoBD.ConectaBD(Conexion);

            if (Conecta == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            string        Nom    = cmbProveedores.SelectedItem.ToString();
            string        Query  = "select Clave,RFC,Domicilio,Saldo from Proveedor where Nombre = " + "'" + Nom + "'";
            SqlDataReader Lector = null;

            Lector = UsoBD.Consulta(Query, Conecta);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL REALIZAR CONSULTA");
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    string Clave     = Lector.GetValue(0).ToString();
                    string RFC       = Lector.GetValue(1).ToString();
                    string Domicilio = Lector.GetValue(2).ToString();
                    string Saldo     = Lector.GetValue(3).ToString();

                    txtClave.Text     = Clave;
                    txtRFC.Text       = RFC;
                    txtDomicilio.Text = Domicilio;
                    txtSueldo.Text    = Saldo;
                }
            }
            Conecta.Close();
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            SqlConnection conn = UsoBD.ConectaBD(ConexionBD.strCon);

            if (conn == null)
            {
                MessageBox.Show("Imposible conectar con la BD");
                foreach (SqlError err in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(err.Message);
                }
                return;
            }
            else
            {
                string strCommand = "INSERT INTO EMPLEADOS(emp_id,emp_nom,emp_apar,emp_amar,amp_dom,emp_sueldoD,departamento,emp_encargado)";
                strCommand += "VALUES (@id,@nom,@apat,@amat,@dom,@sue,@dep,@enc)";
                SqlCommand cmd = new SqlCommand(strCommand, conn);

                int     id     = Convert.ToInt32(txtClave.Text);
                string  nom    = txtNombre.Text;
                string  apat   = txtApPat.Text;
                string  amat   = txtApMat.Text;
                string  dom    = txtDomicilio.Text;
                decimal s      = Convert.ToDecimal(txtSueldo.Text);
                decimal sue    = Convert.ToDecimal(string.Format("{0:0.00}", s));
                int     dep    = Convert.ToInt32(cmbDepartamentos.SelectedItem);
                char    enc    = chkEncargado.Checked ? '1' : '0';
                int     encarg = Convert.ToByte(enc);

                cmd.Parameters.AddWithValue("@id", id);
                cmd.Parameters.AddWithValue("@nom", nom);
                cmd.Parameters.AddWithValue("@apat", apat);
                cmd.Parameters.AddWithValue("@amat", amat);
                cmd.Parameters.AddWithValue("@dom", dom);
                cmd.Parameters.AddWithValue("@sue", sue);
                cmd.Parameters.AddWithValue("@dep", dep);
                cmd.Parameters.AddWithValue("@enc", encarg);

                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (SqlException ez)
                {
                    MessageBox.Show(ez.Message);
                    return;
                }
                MessageBox.Show("Empleado Guardado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void cmbDispositivos_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbDispositivos.SelectedIndex == -1)
            {
                return;
            }

            string        Conexion = Utileria.GetConnectionString();
            SqlConnection Conecta  = UsoBD.ConectaBD(Conexion);

            if (Conecta == null)
            {
                MessageBox.Show("NO SE PUDO CONECTAR A LA BASE DE DATOS", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            string Numero_serie = cmbDispositivos.SelectedItem.ToString();
            string Query        = "SELECT M.NOMBRE,D.MODELO,D.DESCRIPCION,A.DESCRIPCION FROM DISPOSITIVO D";

            Query += " INNER JOIN MARCA M ON D.MARCA = M.ID";
            Query += " INNER JOIN AULA A ON A.ID = D.AULA";
            Query += " WHERE NUMERO_SERIE = '" + Numero_serie + "'";
            SqlDataReader Lector = null;

            Lector = UsoBD.Consulta(Query, Conecta);
            if (Lector == null)
            {
                MessageBox.Show("ERROR AL REALIZAR CONSULTA");
                foreach (SqlError Error in UsoBD.ESalida.Errors)
                {
                    MessageBox.Show(Error.Message);
                }
                Conecta.Close();
                return;
            }
            if (Lector.HasRows)
            {
                while (Lector.Read())
                {
                    txtMarca.Text  = Lector.GetValue(0).ToString();
                    txtModelo.Text = Lector.GetValue(1).ToString();
                    txtDescr.Text  = Lector.GetValue(2).ToString();
                    txtAula.Text   = Lector.GetValue(3).ToString();
                }
            }
            Conecta.Close();
        }
        private void btnActualizar_Click(object sender, EventArgs e)
        {
            string Dep   = cmbDepartamentos.SelectedItem.ToString();
            int    DepID = AdmDep.GetID(Dep);
            string Nom   = txtNombre.Text;

            if (!(Utileria.IsEmpty(Nom)))
            {
                SqlConnection Connection = UsoBD.ConectaBD(Utileria.GetConnectionString());

                if (Connection == null)
                {
                    MessageBox.Show("ERROR DE CONEXIÓN CON LA BASE DE DATOS");

                    foreach (SqlError E in UsoBD.ESalida.Errors)
                    {
                        MessageBox.Show(E.Message);
                    }
                    return;
                }
                string strComando = "UPDATE DEPARTAMENTO SET Nombre=@Nombre WHERE ID=@ID";

                SqlCommand Update = new SqlCommand(strComando, Connection);

                Update.Parameters.AddWithValue("@Nombre", Nom);
                Update.Parameters.AddWithValue("@ID", DepID);

                try
                {
                    Update.ExecuteNonQuery();
                }
                catch (SqlException Ex)
                {
                    foreach (SqlError item in Ex.Errors)
                    {
                        MessageBox.Show(item.Message);
                    }

                    Connection.Close();
                    return;
                }
                Connection.Close();
            }
            if (cmbEncargado.SelectedIndex >= 0)
            {
                string Enc   = cmbEncargado.SelectedItem.ToString();
                int    EncID = AdmEmp.GetIDByName(Enc);
                AdmDep.UpdateEnc(EncID, DepID);
            }
            MessageBox.Show("DEPARTAMENTO ACTUALIZADO EXITOSAMENTE", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }