public void ObtenerParametros() { opcionesdb opcion = new opcionesdb(); String Nomtabla = "Parametros"; DataTable tabla = opcion.ObtenerTodasTuplas(Nomtabla); DataRow row; for (int i = 0; i < tabla.Rows.Count; i++) { row = tabla.Rows[i]; if (row["Nombre"].ToString() == "IVA") { IVA = Convert.ToDouble(row["Valor"].ToString().Replace(".", ",")); } else if (row["Nombre"].ToString() == "Pago a Cuenta") { PagoACuenta = Convert.ToDouble(row["Valor"].ToString().Replace(".", ",")); } else if (row["Nombre"].ToString() == "Renta") { Renta = Convert.ToDouble(row["Valor"].ToString().Replace(".", ",")); } } }
public void cargarParametros() { this.radGridView2.MasterTemplate.Rows.Clear(); opcionesdb opcione = new opcionesdb(); DataTable tabla = opcione.ObtenerTodasTuplas("Parametros"); DataRow row; for (int f = 0; f < tabla.Rows.Count; f++) { row = tabla.Rows[f]; radGridView2.Rows.AddNew(); int x = radGridView2.Rows.Count; this.radGridView2.Rows[x - 1].Cells[0].Value = row["Nombre"].ToString(); this.radGridView2.Rows[x - 1].Cells[1].Value = row["Valor"].ToString(); } txtnombreparam.Text = ""; txtvalorparam.Text = ""; }
public void cargarSucursales() { this.radGridView3.MasterTemplate.Rows.Clear(); opcionesdb opcione = new opcionesdb(); DataTable tabla = opcione.ObtenerTodasTuplas("Sucursal"); DataRow row; for (int f = 0; f < tabla.Rows.Count; f++) { row = tabla.Rows[f]; radGridView3.Rows.AddNew(); int x = radGridView3.Rows.Count; this.radGridView3.Rows[x - 1].Cells[0].Value = row["CodigoSucursal"].ToString(); this.radGridView3.Rows[x - 1].Cells[1].Value = row["Nombre"].ToString(); } txtCodSucur.Text = ""; txtNombreSucur.Text = ""; }
public void CargarSucursales() { opcionesdb opcionesS = new opcionesdb(); String NombreTabla = "Sucursal"; DataTable tabla = opcionesS.ObtenerTodasTuplas(NombreTabla); List <Item> lista = new List <Item>(); DataRow row; for (int i = 0; i < tabla.Rows.Count; i++) { row = tabla.Rows[i]; lista.Add(new Item(row["Nombre"].ToString(), System.Convert.ToInt32(row["CodigoSucursal"]))); } SucursalList.DisplayMember = "Name"; SucursalList.ValueMember = "Value"; SucursalList.DataSource = lista; }
public void cargarCombox() { //Lineas de codigos en comun para todos los metodos. opcionesdb opciones = new opcionesdb(); String NomTabla = "TipoPrecio"; DataTable tabla = opciones.ObtenerTodasTuplas(NomTabla); List <Item> lista = new List <Item>(); DataRow row; for (int i = 0; i < tabla.Rows.Count; i++) { row = tabla.Rows[i]; lista.Add(new Item(row["TipoPrecio"].ToString(), System.Convert.ToInt32(row["Formula"]))); } radDropDownList1.DisplayMember = "Name"; radDropDownList1.ValueMember = "Value"; radDropDownList1.DataSource = lista; }
public void cargarCombox2() { //this.radGridView1.MasterTemplate.Rows.Clear(); //Lineas de codigos en comun para todos los metodos. opcionesdb opciones = new opcionesdb(); String NomTabla = "Sucursal"; DataTable tabla = opciones.ObtenerTodasTuplas(NomTabla); List <Item> lista = new List <Item>(); DataRow row; for (int i = 0; i < tabla.Rows.Count; i++) { row = tabla.Rows[i]; lista.Add(new Item(row["Nombre"].ToString(), System.Convert.ToInt32(row["CodigoSucursal"]))); } radDropDownList2.DisplayMember = "Name"; radDropDownList2.ValueMember = "Value"; radDropDownList2.DataSource = lista; }
public TipoPrecio[] obtener() { //Lineas de codigos en comun para todos los metodos. opcionesdb opciones = new opcionesdb(); String NomTabla = "TipoPrecio"; //Lineas con detalles especificos por metodo. DataTable tab = new DataTable(); tab = opciones.ObtenerTodasTuplas(NomTabla); int tamanio = tab.Rows.Count; TipoPrecio[] coleccionTipoPrecio = new TipoPrecio[tamanio]; for (int j = 0; j < tamanio; j++) { DataRow row = tab.Rows[j]; TipoPrecio tipoPrec = new TipoPrecio(row["TipoPrecio"].ToString(), row["Formula"].ToString()); coleccionTipoPrecio[j] = tipoPrec; } return(coleccionTipoPrecio); }
public sucursal[] obtenerSucursales() { //Lineas de codigos en comun para todos los metodos. opcionesdb opciones = new opcionesdb(); String NomTabla = "sucursal"; //Lineas con detalles especificos por metodo. DataTable tab = new DataTable(); tab = opciones.ObtenerTodasTuplas(NomTabla); int tamanio = tab.Rows.Count; sucursal[] coleccionSucursales = new sucursal[tamanio]; for (int j = 0; j < tamanio; j++) { DataRow row = tab.Rows[j]; sucursal sucur = new sucursal(row["CodigoSucursal"].ToString(), row["nombre"].ToString()); coleccionSucursales[j] = sucur; } return(coleccionSucursales); }
public proveedor[] obtener() { //Lineas de codigos en comun para todos los metodos. opcionesdb opciones = new opcionesdb(); String NomTabla = "proveedores"; //Lineas con detalles especificos por metodo. DataTable tab = new DataTable(); tab = opciones.ObtenerTodasTuplas(NomTabla); int tamanio = tab.Rows.Count; proveedor[] coleccionProveedores = new proveedor[tamanio]; for (int j = 0; j < tamanio; j++) { DataRow row = tab.Rows[j]; proveedor prove = new proveedor(row["CodigoProvedor"].ToString(), row["Nombre"].ToString()); coleccionProveedores[j] = prove; } return(coleccionProveedores); }
public void registrarInventario(int idCompra) { producto[] pro = Producto; //op.iniciarTransaccion(); String NomTabla = "Inventario"; String codBarra = pro[0].CodigoBarra; String NTabla = "inventario"; DataTable tab = new DataTable(); tab = op.obtenerCorrelativo(NTabla, codBarra); DataRow row; if (tab.Rows.Count == 0) { correlativo = 0; } else { row = tab.Rows[0]; correlativo = System.Convert.ToInt32(row["correlativo"].ToString()) + 1; } DataTable tabe = new DataTable(); tabe = op.ObtenerTodasTuplas("TipoPrecio"); DataRow row2; rowGridView[] tipoPre = Filasprecios1; for (int i = 0; i < pro.Length; i++) { //Vista previa compras //ContardorArray = i; //vCompra = new arrayVistaCompra[pro.Length]; //-------------------- //Lineas con detalles especificos por metodo. Hashtable crit = new Hashtable(); crit.Add("CodigoBarra", pro[i].CodigoBarra); crit.Add("Correlativo", correlativo + i); ViCompra.Add(correlativo + i + "*" + pro[i].CodigoBarra, pro[i].CodigoBarra); // ViCompra.Add("Correlativo", correlativo + i); //vCompra[ContardorArray].CodigoBarra = pro[i].CodigoBarra; //vCompra[ContardorArray].Correlativo = (correlativo + i)+""; crit.Add("Gravado", Costo); crit.Add("id_compra", idCompra); op.InsertarRegistro(NomTabla, crit); // op.CommitTransaccion(); for (int x = 0; x < tipoPre.Length; x++) { Hashtable crity = new Hashtable(); crity.Add("CodigoBarra", pro[i].CodigoBarra); crity.Add("Correlativo", correlativo + i); crity.Add("Gravado", tipoPre[x].Cells1.ToString().Replace(",", ".")); crity.Add("TipoPrecio", tipoPre[x].Cells0); op.InsertarRegistro("Precios", crity); } //for(int x=0; x<3; x++){ // Hashtable crity = new Hashtable(); // crity.Add("CodigoBarra", pro[i].CodigoBarra); // crity.Add("Correlativo", correlativo+i); // row2 = tabe.Rows[x]; // if(x==0){ // crity.Add("Gravado", (Costo+(System.Convert.ToDouble(row2["Formula"])/100) * Costo)); // crity.Add("TipoPrecio", "Maximo"); // }else if(x==1){ // crity.Add("Gravado", (Costo + (System.Convert.ToDouble(row2["Formula"]) / 100) * Costo)); // crity.Add("TipoPrecio", "Minimo"); // }else if(x==2){ // crity.Add("Gravado", (Costo + (System.Convert.ToDouble(row2["Formula"]) / 100) * Costo)); // crity.Add("TipoPrecio", "Normal"); // } // op.InsertarRegistro("Precios", crity); //} } }