Ejemplo n.º 1
0
        public void MostrarDetalles()
        {
            if (radGridView1.Rows.Count > 0)
            {
                detalleborrador detalle  = new detalleborrador(listSucursal.SelectedValue.ToString());
                opcionesdb      opcion   = new opcionesdb();
                String          NomTabla = "DetalleVenta";
                Hashtable       crit     = new Hashtable();
                Hashtable       reg      = new Hashtable();

                //Obtener Id de Venta
                int    fila = System.Convert.ToInt32(radGridView1.MasterGridViewInfo.CurrentIndex.ToString());
                String id   = radGridView1.Rows[fila].Cells[0].Value.ToString();
                //MessageBox.Show(id);

                //obtenerdetalle
                //Lineas con detalles especificos por metodo.
                reg.Add("CodigoBarra", "CodigoBarra");
                reg.Add("Correlativo", "Correlativo");
                reg.Add("PrecioReal", "PrecioReal");
                reg.Add("PrecioVenta", "PrecioVenta");

                crit.Add("NVenta", id);

                DataTable tabla = opcion.BuscarRegistro(NomTabla, crit, reg);
                detalle.DesabilitarFact();
                detalle.llenarDetalle(tabla);
                detalle.Show();
            }
        }
Ejemplo n.º 2
0
        public void ObtenerTodos()
        {
            detalleborrador detalle = new detalleborrador(listSucursal.SelectedValue.ToString());
            int             filas   = radGridView3.Rows.Count;
            rowGridView     grid    = new rowGridView();
            DataTable       todos   = new DataTable();
            String          ids;
            opcionesdb      opcion   = new opcionesdb();
            String          NomTabla = "DetalleVenta";
            Hashtable       crit     = new Hashtable();
            Hashtable       reg      = new Hashtable();

            //Obtener Id de Venta
            //  int fila = System.Convert.ToInt32(radGridView1.MasterGridViewInfo.CurrentIndex.ToString());
            //  String id = radGridView1.Rows[fila].Cells[0].Value.ToString();
            //MessageBox.Show(id);

            //obtenerdetalle
            //Lineas con detalles especificos por metodo.
            reg.Add("CodigoBarra", "CodigoBarra");
            reg.Add("Correlativo", "Correlativo");
            reg.Add("PrecioReal", "PrecioReal");
            reg.Add("PrecioVenta", "PrecioVenta");

            for (int f = 0; f < filas; f++)
            {
                ids = radGridView3.Rows[f].Cells[0].Value.ToString();
                crit.Add("NVenta", ids);

                DataTable tabla = opcion.BuscarRegistro(NomTabla, crit, reg);
                todos = tabla.Clone();
                for (int a = 0; a < tabla.Rows.Count; a++)
                {
                    todos.ImportRow(tabla.Rows[a]);
                }


                detalle.llenarDetalle(todos);
                tabla.Clear();
                crit.Clear();
            }

            detalle.HabilitarFact();
            detalle.Show();
        }