Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Lgestioncliente c     = new Lgestioncliente();
            DataTable       tabla = new DataTable();

            if (consultageneral.Text == "" || txtdatoconsulta.Text == "")
            {
                MessageBox.Show("los campos de usuario deben contener datos", "Error de consulta", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (consultageneral.Text == "Nombre")
            {
                tabla = c.cespecificon(txtdatoconsulta.Text);
                dataGridView1.DataSource = tabla;
            }

            else if (consultageneral.Text == "Cedula")
            {
                tabla = c.cespecificoc(txtdatoconsulta.Text);
                dataGridView1.DataSource = tabla;
            }

            else if (consultageneral.Text == "Cargo")
            {
                if (txtdatoconsulta.Text == "")
                {
                    MessageBox.Show("los campos de usuario deben contener datos", "Error de consulta", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Error cargo no existe", "Error de consulta", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
 private void registrar_Click(object sender, EventArgs e)
 {
     if (txtnomcliente.Text == "" || txtidentificacion.Text == "" || txttelefono.Text == "" || txtdireccion.Text == "" || txtcelular.Text == "" || txtemail.Text == "")
     {
         MessageBox.Show("los campos de usuario deben contener datos", "Error de actualizacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         if (txttel2.Text == "")
         {
             q = "0";
         }
         else
         {
             q = txttel2.Text;
         }
         Lgestioncliente actu = new Lgestioncliente();
         string          g    = actu.M(txtnomcliente.Text, txtidentificacion.Text, txttelefono.Text, txtdireccion.Text, txtcelular.Text, txtemail.Text, q, cmbestado.Text);
         if (g == "1")
         {
             MessageBox.Show("Cliente actualizado con exito", "Informacion de actualizacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show("Cliente no actualizado", "Informacion de actualizacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Desea eliminar el usuario?", "eliminar usuario", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                Lgestioncliente eliminar = new Lgestioncliente();
                string          cedul    = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                string          exito    = eliminar.elimi(cedul);


                if (exito == "1")
                {
                    MessageBox.Show("usuario eliminado con exito, para poder activarlo por favor consultelo y actualice el usuario", "informe de eliminacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 4
0
        private void registrar_Click(object sender, EventArgs e)
        {
            Lgestioncliente reg        = new Lgestioncliente();
            string          registrado = reg.d(nombre);

            if (cllocrra.Text == "Calle")
            {
                principio = "CL.";
            }
            if (cllocrra.Text == "Carrera")
            {
                principio = "Cra.";
            }

            string direccion = principio + " " + "+" + txtdireccion.Text + "+" + "%23" + bunifuCustomTextbox1.Text;

            if (txtnomcliente.Text == "" || txtidentificacion.Text == "" || txttelefono.Text == "" || txtdireccion.Text == "" || txtcelular.Text == "" || txtemail.Text == "")
            {
                MessageBox.Show("los campos de usuario deben contener datos", "Error de acceso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txttel2.Text == "")
            {
                q = "0";
            }
            else
            {
                q = txttel2.Text;
            }

            Lgestioncliente regis = new Lgestioncliente();
            string          g     = regis.registrarcliente(txtnomcliente.Text, txtidentificacion.Text, txttelefono.Text, direccion, txtcelular.Text, txtemail.Text, q, registrado);

            if (g == "1")
            {
                MessageBox.Show("Cliente registrado con exito", "Informacion de registro", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtnomcliente.Text     = "";
                txtidentificacion.Text = "";
                txttelefono.Text       = "";
                txtdireccion.Text      = "";
                txtcelular.Text        = "";
                txtemail.Text          = "";
                txttel2.Text           = "";
            }
            else
            {
                MessageBox.Show("cliente no registrado", "Informacion de registro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 5
0
        private void Pclientes_Load(object sender, EventArgs e)
        {
            if (cargos == "admi")
            {
            }
            else if (cargos == "caje")
            {
                pictureBox1.BackColor = Color.FromArgb(138, 131, 98);
            }
            else
            {
                pictureBox1.BackColor = Color.FromArgb(99, 129, 125);
            }

            Lgestioncliente f     = new Lgestioncliente();
            DataTable       tabla = new DataTable();

            tabla = f.cgeneral();
            dataGridView1.DataSource = tabla;
        }
Ejemplo n.º 6
0
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            if (cmb1.Text == "" || comboBox1.Text == "")
            {
                MessageBox.Show("los datos no pueden ir vacios");
            }
            else
            {
                string h;
                if (label4.Text == "Cliente - Nombres y apellidos" || txt4.Text == "")
                {
                    h = "1";
                }
                else
                {
                    h = txt4.Text;
                }

                Lgestioncliente reg        = new Lgestioncliente();
                string          registrado = reg.d(nombre);
                string          a          = DateTime.Now.ToString("dd/MM/yyyy");
                Lgestionventa   factura    = new Lgestionventa();
                string          c          = factura.nfactura(a.ToString(), Iva.Text, cantidadvendida.ToString(), Compra.Text, "2", registrado, h);

                if (c == "1")
                {
                    for (f = 0; f < dgv1.Rows.Count; f++)
                    {
                        Lgestionventa detalles = new Lgestionventa();
                        detalles.detallesv(dgv1.Rows[f].Cells[0].Value.ToString(), label2.Text, dgv1.Rows[f].Cells[3].Value.ToString(), dgv1.Rows[f].Cells[4].Value.ToString(), dgv1.Rows[f].Cells[2].Value.ToString());
                    }
                    MessageBox.Show("factura de venta exitosa");
                    numericUpDown1.Value = 0;
                    dgv1.Rows.Clear();
                    Iva.Text    = "0";
                    Compra.Text = "0";
                }


                //reportes
                ConjuntoDaros            datos   = new ConjuntoDaros();
                ConjuntoDaros.FacturaRow columna = datos.Factura.NewFacturaRow();

                columna.Cantidad   = cantidadvendida.ToString();
                columna.Fecha      = DateTime.Now.ToString();
                columna.IvaTotal   = Compra.Text;
                columna.TotalValor = Iva.Text;
                columna.Usuario    = registrado;
                datos.Factura.Rows.Add(columna);

                //llenado de detalles

                for (int n = 0; n < dgv1.Rows.Count; n++)
                {
                    ConjuntoDaros.DetallesRow columna1 = datos.Detalles.NewDetallesRow();
                    columna1.CodFactura       = label2.Text;
                    columna1.Nproducto        = dgv1.Rows[n].Cells[1].Value.ToString();
                    columna1.UnidadesVendidas = dgv1.Rows[n].Cells[4].Value.ToString();
                    columna1.ValorIva         = dgv1.Rows[n].Cells[2].Value.ToString();
                    columna1.ValorUnidad      = dgv1.Rows[n].Cells[3].Value.ToString();
                    columna1.TotalProducto    = dgv1.Rows[n].Cells[5].Value.ToString();
                    datos.Detalles.Rows.Add(columna1);
                }

                Form1 mostrar = new Form1();
                mostrar.Nuevo = datos;
                mostrar.Show();
            }
        }