示例#1
0
        private void button_ingresar_Click(object sender, EventArgs e)
        {
            conexion con = new conexion();

            int iduser = Convert.ToInt32(Conexion.conexion.iduser);

            string sop   = cmb_sop.SelectedValue.ToString();
            string fech  = dt_fech.Text;
            string prod  = cmb_prod.SelectedValue.ToString();
            string descr = text_descr.Text;


            try
            {
                con.Conectar();
                con.inserta_caso(sop, fech, prod, descr, iduser);
                con.Desconectar();

                cmb_sop.Text    = "";
                dt_fech.Text    = "";
                cmb_prod.Text   = "";
                text_descr.Text = "";
                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
示例#2
0
        private void butact_Click(object sender, EventArgs e)
        {
            string idcaso = cmbid.SelectedValue.ToString();
            string estado = "";

            conexion con = new conexion();

            con.Conectar();

            if (chkpend.Checked == true && chkresu.Checked == false)
            {
                estado = "Pendiente";
                con.actualiza_estado(idcaso, estado);
                con.Desconectar();
                actualizatabla();
                chkpend.Checked = false;
            }
            if (chkresu.Checked == true && chkpend.Checked == false)
            {
                estado = "Resuelto";
                con.actualiza_estado(idcaso, estado);
                con.Desconectar();
                actualizatabla();
                chkresu.Checked = false;
            }

            if (chkresu.Checked == true && chkpend.Checked == true)
            {
                chkpend.Checked = false;
                chkresu.Checked = false;
                MessageBox.Show("Solo debe escojer una opcion", "Error");
            }
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            conexion con  = new conexion();
            string   tipo = text_tipo.Text;
            string   area = text_area.Text;

            string costo = text_cost.Text;

            try
            {
                con.Conectar();
                con.inserta_soport(tipo, area, costo);
                con.Desconectar();

                text_tipo.Text = "";
                text_area.Text = "";
                text_cost.Text = "";


                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string nom     = text_nom.Text;
            string dir     = text_dir.Text;
            string tel     = text_tel.Text;
            string puesto  = cmbpuesto.SelectedValue.ToString();
            string soporte = cmbsoporte.SelectedValue.ToString();


            conexion con = new conexion();

            try
            {
                con.Conectar();
                con.inserta_empleado(nom, dir, tel, puesto, soporte);
                con.Desconectar();
                text_nom.Text = "";
                text_dir.Text = "";
                text_tel.Text = "";

                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
示例#5
0
        private void butact_Click(object sender, EventArgs e)
        {
            string iduser = cmbuser.SelectedValue.ToString();
            string estado = "";

            conexion con = new conexion();

            con.Conectar();

            if (chkadmin.Checked == true && chkuser.Checked == false)
            {
                estado = "1";
                con.actualiza_rol(estado, iduser);
                con.Desconectar();
                actualizatabla();
                chkadmin.Checked = false;
                MessageBox.Show("Se actualizo correctamente", "Mensaje");
            }
            if (chkuser.Checked == true && chkadmin.Checked == false)
            {
                estado = "2";
                con.actualiza_rol(estado, iduser);
                con.Desconectar();
                actualizatabla();
                chkuser.Checked = false;
                MessageBox.Show("Se actualizo correctamente", "Mensaje");
            }

            if (chkuser.Checked == true && chkadmin.Checked == true)
            {
                chkadmin.Checked = false;
                chkuser.Checked  = false;
                MessageBox.Show("Solo debe escojer una opcion", "Error");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            conexion con    = new conexion();
            string   nompr  = text_nombrepr.Text;
            string   tipo   = text_tipo.Text;
            string   cant   = text_cantidad.Text;
            string   precio = text_precio.Text;

            try
            {
                con.Conectar();
                con.inserta_producto(nompr, tipo, cant, precio);
                con.Desconectar();


                text_nombrepr.Text = "";
                text_tipo.Text     = "";
                text_cantidad.Text = "";
                text_precio.Text   = "";

                actualiza();

                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
示例#7
0
        private void button1_Click(object sender, EventArgs e)
        {
            conexion con = new conexion();

            string nom  = textbox_puesto.Text;
            string sal  = textbox_salario.Text;
            string perm = textbox_permisos.Text;

            try
            {
                con.Conectar();
                con.inserta_puesto(nom, sal, perm);
                con.Desconectar();

                textbox_puesto.Text   = "";
                textbox_salario.Text  = "";
                textbox_permisos.Text = "";



                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
示例#8
0
        private void btinsertar_Click(object sender, EventArgs e)
        {
            string detalle     = cmbdetalle.SelectedValue.ToString();
            string tipo        = txttipo.Text;
            string descripcion = txttipo.Text;


            conexion con = new conexion();


            con.Conectar();

            con.inserta_det(tipo, descripcion, detalle);
            con.Desconectar();
            cmbdetalle.Text = "";
        }
示例#9
0
        private void btinsertar_Click(object sender, EventArgs e)
        {
            string puesto  = cmbpuesto.SelectedValue.ToString();
            string soporte = cmbsoporte.SelectedValue.ToString();


            conexion con = new conexion();


            con.Conectar();

            con.inserta_detalle(puesto, soporte);
            con.Desconectar();
            cmbpuesto.Text  = "";
            cmbsoporte.Text = "";
        }
示例#10
0
        private void button_recuperar_Click(object sender, EventArgs e)
        {
            string opcion = combobox_opcion.SelectedItem.ToString();
            string campo  = text_informacion.Text;

            conexion con = new conexion();

            try
            {
                con.Conectar();
                con.Correo(opcion, campo);
                con.Desconectar();
                MessageBox.Show("Sus datos se enviaron correctamente");
            }
            catch {
                MessageBox.Show("Error al envaier correo electronico");
            }
        }
示例#11
0
        private void button_registrar_Click(object sender, EventArgs e)
        {
            conexion con  = new conexion();
            string   nom  = text_nombre.Text;
            string   ape  = text_apellido.Text;
            string   cor  = text_correo.Text + "@" + combobox_correo.SelectedItem.ToString();
            string   user = text_user.Text;
            string   pas  = text_pasword.Text;
            string   nac  = dt_fecha.Text;
            string   tel  = text_telefono.Text;
            string   sex  = combobox_sexo.SelectedItem.ToString();



            try
            {
                con.Conectar();
                con.inserta_user(nom, ape, cor, user, pas, nac, tel, sex);
                con.Desconectar();

                text_nombre.Text     = "";
                text_apellido.Text   = "";
                text_correo.Text     = "";
                text_user.Text       = "";
                text_pasword.Text    = "";
                dt_fecha.Text        = "";
                text_telefono.Text   = "";
                combobox_correo.Text = "";
                combobox_sexo.Text   = "";

                MessageBox.Show("Registro exitoso");
            }
            catch
            {
                MessageBox.Show("Error de registro de datos");
            }
        }
示例#12
0
        public void verifica()
        {
            conexion con = new conexion();

            con.Conectar();

            try
            {
                con.consulta_log(text_user.Text, text_pas.Text);

                if (con.id.Equals("1"))
                {
                    VentanaAdmin frm = new VentanaAdmin();
                    frm.Show();
                    this.Hide();
                }


                if (con.id.Equals("2"))
                {
                    VentanaUser frm = new VentanaUser();

                    frm.Show();
                    this.Hide();
                }
            }
            catch
            {
                MessageBox.Show("Error al iniciar session");
                text_user.Text = "";
                text_pas.Text  = "";
            }


            con.Desconectar();
        }