//Insertar campos en tabla detalle lista de precios public void InsertarDetalle1(string nombrelista, string box1, string box2, string box3, string precio) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcCommand command = sc.InsertarDetalle1(nombrelista, box1, box2, box3, precio); command.ExecuteNonQuery(); }
//Insertar campos en tabla encabezado lista public void insertarencabezado1(string fecha_creacion) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcCommand command = sc.Insertarencabezadosentencia1(fecha_creacion); command.ExecuteNonQuery(); }
//llenar data public DataTable consultaId() { sentencia_lista_precio sn = new sentencia_lista_precio(); OdbcDataAdapter datos = sn.consultarQuery(); DataTable dtDatos = new DataTable(); datos.Fill(dtDatos); return(dtDatos); }
//Carga datos al combobox de Tabla codigo producto public void CargarTabla3(ComboBox comboBox) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla3(); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow row = dataTable.Rows[i]; comboBox.Items.Add(Convert.ToInt32(row["KidProducto"])); } } }
//mostrar el descuento de la lista de precios según tipo de lista public void CargarTexto2(TextBox box, string tabla) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla5(tabla); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow rows = dataTable.Rows[i]; string cam = rows["descuento_lista_precios"].ToString(); box.Text = cam; } } }
//Carga datos al combobox de Tabla tipo de listas public void CargarTabla2(ComboBox comboBox, List <int> tipolistaprecios) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla2(); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow row = dataTable.Rows[i]; tipolistaprecios.Add(Convert.ToInt32(row["Kidtipo_lista_precios"])); comboBox.Items.Add(row["nombre_lista_precios_detalle"].ToString()); } } }
//id de tipo lista public void BuscarIdTipoLista(TextBox box, string tabla) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla12(tabla); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow rows = dataTable.Rows[i]; tabla = rows["Kidtipo_lista_precios"].ToString(); box.Text = tabla; } } }
//cargar de fecha inicio según id public void CargarFechaInicio2(TextBox box, string cam) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla9(cam); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow rows = dataTable.Rows[i]; cam = rows["Fecha_inicio_listaprecios"].ToString(); box.Text = cam; } } }
//carga el nombre del tipo de lista según el id del tipo de lista public void CargarTipoLista2(TextBox box, string cam) { sentencia_lista_precio sc = new sentencia_lista_precio(); OdbcDataAdapter odbcDataAdapter = sc.ObtenerTabla7(cam); DataTable dataTable = new DataTable(); odbcDataAdapter.Fill(dataTable); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow rows = dataTable.Rows[i]; cam = rows["nombre_lista_precios_detalle"].ToString(); box.Text = cam; } } }