Ejemplo n.º 1
0
 public void limpiar()
 {
     Txt_codigo.Clear();
     Txt_descripcion.Clear();
     Txt_producto.Clear();
     Cbo_estado.ResetText();
 }
Ejemplo n.º 2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            string       idmax  = Txt_idproceso.Text;
            string       nombre = txt_para.Text;
            DialogResult resul  = MessageBox.Show("¿Esta seguro que desea eliminar " + nombre + "? ", "Alerta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (resul == DialogResult.Yes)
            {
                if (dgb_produccionProceso.SelectedRows.Count == 1)
                {
                    mo.updateestados("produccion_procesos", "estado", "0", "id_proceso", idmax);
                }
                actualizardatagriew();
                Btn_eliminar.Enabled   = false;
                Btn_actualizar.Enabled = false;
                Btn_insertar.Enabled   = true;
                Btn_Receta.Enabled     = false;
                string limpio = " ";
                Cmb_producto.texto(limpio);
                txt_para.Clear();
                Txt_tiempopp.Clear();
                Txt_descripcion.Clear();
                Txt_idproceso.Text   = mo.idmax("produccion_procesos", "id_proceso");
                txt_para.Enabled     = true;
                Cmb_producto.Enabled = true;
            }
        }
Ejemplo n.º 3
0
        private void Btn_actualizar_Click(object sender, EventArgs e)
        {
            string id    = Txt_idproceso.Text;
            string valor = Txt_tiempopp.Text;


            mo.updateestados("produccion_procesos", "tiempo_pp", valor, "id_proceso", id);


            actualizardatagriew();


            MessageBox.Show("Registro Actualizado con Exito! ");

            Btn_actualizar.Enabled = false;
            Btn_insertar.Enabled   = true;
            Btn_eliminar.Enabled   = false;
            Btn_Receta.Enabled     = false;
            Cmb_producto.Enabled   = true;
            string limpio = " ";

            Cmb_producto.texto(limpio);
            txt_para.Clear();
            Txt_tiempopp.Clear();
            Txt_descripcion.Clear();
            Txt_idproceso.Text = mo.idmax("produccion_procesos", "id_proceso");
        }
Ejemplo n.º 4
0
 public void limpiar()
 {
     Txt_codigoruta.Clear();
     Txt_codigoruta.Focus();
     Txt_nombre.Clear();
     Txt_descripcion.Clear();
 }
Ejemplo n.º 5
0
        private void Btn_insertar_Click(object sender, EventArgs e)
        {
            string producto    = Cmb_producto.texto2();
            string para        = txt_para.Text;
            string descripcion = Txt_descripcion.Text;
            string tiempo      = Txt_tiempopp.Text;
            int    existe      = Cmb_producto.existe(producto);

            if (para != "" && descripcion != "" && tiempo != "")
            {
                if (existe == -1)
                {
                    MessageBox.Show("El Producto seleccionados no es valido ", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }

                else
                {
                    string yaingresado = Cmb_producto.ObtenerIndif();

                    string sql2 = "SELECT id_producto FROM produccion_procesos where estado = 1 and id_producto = '" + yaingresado + "' ";

                    string resultado;

                    resultado = mo.consulta(sql2);


                    if (resultado == " ")
                    {
                        string idproceso = Txt_idproceso.Text;
                        string idprod    = Cmb_producto.ObtenerIndif();


                        string sql = "INSERT INTO produccion_procesos (id_proceso, id_producto, nombre, descripcion_proceso, tiempo_pp, estado) VALUES ( " + idproceso + " , '" + idprod + "' , '" + para + "' , '" + descripcion + "' , '" + tiempo + "' , 1 );";
                        mo.insertar(sql);

                        actualizardatagriew();
                        MessageBox.Show("Registro Realizado con Exito ");

                        string limpio = " ";
                        Cmb_producto.texto(limpio);

                        Txt_idproceso.Text = mo.idmax("produccion_procesos", "id_proceso");
                        Txt_descripcion.Clear();
                        Txt_tiempopp.Clear();
                        txt_para.Clear();
                    }

                    else
                    {
                        MessageBox.Show("Este registro ya fue ingresado solo puede modificar su configuracion o eliminarlo e ingresar uno nuevo  ", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
            }
            else
            {
                MessageBox.Show("Por favor llene los campos correspondientes para un registro correcto ", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Ejemplo n.º 6
0
        private void Btn_Agregar_Click(object sender, EventArgs e)
        {
            Frm_Metas des = new Frm_Metas();

            //
            Txt_codigoMeta.Clear();
            Txt_nombreMeta.Clear();
            Cob_tipoMeta.Items.Clear();
            Txt_descripcion.Clear();
            Cob_completado.Items.Clear();
            //
            try
            {
                OdbcDataReader meta = logic.InsertarMeta(Txt_nombreMeta.ToString(), Cob_tipoMeta.ToString(), Txt_descripcion.ToString(),
                                                         Cob_completado.ToString(), Txt_fechaMeta.ToString(), Nud_puntajeMeta.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Mensaje de error: ", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //
            if (Dgv_vistaMeta.Rows.Count > 0)
            {
                foreach (DataGridViewRow row in Dgv_vistaMeta.Rows)
                {
                    try
                    {
                        OdbcDataReader aptos = logic.InsertarMeta(Txt_nombreMeta.ToString(), Cob_tipoMeta.ToString(),
                                                                  Txt_descripcion.ToString(), Cob_completado.ToString(), Txt_fechaMeta.ToString(),
                                                                  Nud_puntajeMeta.ToString());
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString(), "Mensaje de error: ", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                MessageBox.Show("Se han guardado.");

                Txt_empleadoMeta.Text = des.Dgv_vistaMeta.Rows[des.Dgv_vistaMeta.CurrentRow.Index].
                                        Cells[0].Value.ToString();
                Txt_nombreMeta.Text = des.Dgv_vistaMeta.Rows[des.Dgv_vistaMeta.CurrentRow.Index].
                                      Cells[1].Value.ToString();
                Nud_puntajeMeta.Text = des.Dgv_vistaMeta.Rows[des.Dgv_vistaMeta.CurrentRow.Index].
                                       Cells[2].Value.ToString();
            }
            else
            {
                MessageBox.Show("No se han llenado los campos.");
            }
            //SUMA DE LA COLUMNA DEL DATA GRID
            const int columna = 2;

            foreach (DataGridViewRow row in Dgv_vistaMeta.Rows)
            {
                suma += (int)row.Cells[columna].Value;
            }
        }
 private void button4_Click(object sender, EventArgs e)
 {
     Txt_cantidad.Clear();
     Txt_descripcion.Clear();
     Txt_estacion.Clear();
     Txt_estandar.Clear();
     Txt_produccion.Clear();
     cb_no.ResetText();
     cb_si.ResetText();
 }
Ejemplo n.º 8
0
        //Factura Sindy Batz
        private void button1_Click(object sender, EventArgs e)
        {
            cont++;
            try
            {
                int p, c, d; int a = 0;
                int iIdPago = Convert.ToInt32(Cmb_formaPago.SelectedValue);

                OdbcDataAdapter sda   = new OdbcDataAdapter("select count(*) from examenes where iIdExamen= '" + Txt_codigof.Text + "'", conexion.ObtenerConexion());
                DataTable       datos = new DataTable();
                sda.Fill(datos);

                OdbcDataAdapter sda2   = new OdbcDataAdapter("select ex.iIdExamen, ex.sDescripcion,ex.fPrecio from examenes ex where ex.iIdExamen = '" + Txt_codigof.Text + "'", conexion.ObtenerConexion());
                DataTable       datos2 = new DataTable();
                sda2.Fill(datos2);

                c = Convert.ToInt32(Txt_cantidadf.Text);
                p = Convert.ToInt32(datos2.Rows[0][2].ToString());
                d = Convert.ToInt32(Txt_descuentof.Text);

                subtotal   = c * p;
                descuento  = ((subtotal * d) / 100);
                total      = subtotal - descuento;
                acumulado  = acumulado + subtotal;  //Subtotal
                descTotal  = descTotal + descuento; //Total descuento
                acumulado1 = acumulado1 + total;    //Total
                a          = a + cont;

                if (datos.Rows[0][0].ToString() == "1")
                {
                    Dgb_facturaf.Rows.Add(datos2.Rows[0][0].ToString(), Txt_cantidadf.Text, Txt_descripcion.Text, datos2.Rows[0][2].ToString(), subtotal.ToString(), Txt_descuentof.Text, total.ToString());
                    Lbl_subFf.Text   = acumulado.ToString();
                    Lbl_desc.Text    = descTotal.ToString();
                    Lbl_totalFf.Text = acumulado1.ToString();

                    proGuardarDatosDetalleFactura();

                    Txt_codigof.ResetText();
                    Txt_cantidadf.ResetText();
                    Txt_descripcion.ResetText();
                    Txt_preciouf.ResetText();
                    Txt_descuentof.ResetText();
                }
                else
                {
                    MessageBox.Show("No existe producto");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se pudo agregar.", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
            }
        }