private void cargarIBProducto() { string _ddl = ddlfiltrar.SelectedValue.ToString(); string cod = Request.QueryString["Prod"].ToString(); if (_ddl == "0") { DataSet _cant = _consulta.Com21_consulta_inventario_productos_CV(int.Parse(_ddl), int.Parse(cod)); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } } if (_ddl == "1") { DataSet _cant = _consulta.Com21_consulta_inventario_productos_CV(int.Parse(_ddl), int.Parse(cod)); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } } if (_ddl == "2") { //ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('Error filtrar por compra o venta');", true); cargarRInventario(); } }
private void cargarProPrefacturados() { ServicioCom21.ServicioCom21 _consulta = new ServicioCom21.ServicioCom21(); String idu = Request.QueryString["IDU"].ToString(); String idcod = Request.QueryString["CODUP"].ToString(); DataSet _ds = _consulta.consulta_producto_prefacturado_IdCod(int.Parse(idu), idcod); if (_ds.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _ds.Tables[0]; GvRProductos.DataBind(); int i = 0; foreach (DataRow rs in _ds.Tables[0].Rows) { if (i == 0) { hfact.Value = rs["ActCosto"].ToString(); } i = i + 1; } if (hfact.Value == "1") { pActE.Visible = true; Sumar(_ds, 1); } else { pActE.Visible = false; Sumar(_ds, 2); } } }
private void cargarIBProducto() { string _ddl = txtproducto.Text; DataSet _cant = _consulta.Com21_consulta_inventario_productos_nombre(_ddl); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } }
private void cargarRInventario() { if ((Request.QueryString["Invet"] != null) && (Request.QueryString["Prod"] != null)) { int _ivent = int.Parse(Request.QueryString["Invet"].ToString()); int _prod = int.Parse(Request.QueryString["Prod"].ToString()); DataSet _cat = _consulta.Com21_consulta_inventario_productos_id(_ivent, _prod); if (_cat.Tables[0].Rows.Count > 0) { foreach (DataRow r in _cat.Tables[0].Rows) { lblcantidadini.Text = r["Cantidad"].ToString(); lblprecionini.Text = r["Precio"].ToString().Replace(".", ","); lbltitulo.Text = r["Titulo"].ToString(); lblmarca.Text = r["Marca"].ToString(); lblpreciocompra.Text = r["PrecioCompra"].ToString().Replace(".", ","); lblsubcategoria.Text = r["SubCategoria"].ToString(); lblCategoria.Text = r["Categoria"].ToString(); imgRuta.ImageUrl = r["Ruta"].ToString(); } } if (_cat.Tables[1].Rows.Count > 0) { pInvetS.Visible = true; pInvetN.Visible = false; decimal _totalC = 0; decimal _totalV = 0; foreach (DataRow r in _cat.Tables[1].Rows) { if (r["IdentificadorCV"].ToString() == "Compra") { _totalC = _totalC + decimal.Parse(r["Subtotal"].ToString()); } if (r["IdentificadorCV"].ToString() == "Venta") { _totalV = _totalV + decimal.Parse(r["Subtotal"].ToString()); } } lbltotalC.Text = "$" + Convert.ToString(_totalC); lbltotalV.Text = "$" + Convert.ToString(_totalV); lbltotalCV.Text = "$" + Convert.ToString(_totalC - _totalV); GvRProductos.DataSource = _cat.Tables[1]; GvRProductos.DataBind(); } else { pInvetS.Visible = false; pInvetN.Visible = true; } } }
private void cargarIBCategoria() { int _ddl = int.Parse(ddlCategorias.SelectedValue.ToString()); DataSet _cant = _consulta.Com21_consulta_Resportes(2, _ddl, "0", "0"); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } else { ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('No exiten registro para la categoria: " + ddlCategorias.SelectedItem + "" + "');", true); } }
private void cargarRProductos() { DataSet _cat = _consulta.Com21_consulta_ResportesInicial(); if (_cat.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cat.Tables[0]; GvRProductos.DataBind(); cuerpo_rptV.Visible = false; } else { cuerpo_rpt.Visible = true; GvRProductos.EmptyDataText = "NO EXISTEN PRODUCTOS"; } }
private void cargarRInventario() { DataSet _cat = _consulta.Com21_consulta_inventario_productos(); if (_cat.Tables[0].Rows.Count > 0) { pSi.Visible = true; pNo.Visible = false; GvRProductos.DataSource = _cat.Tables[0]; GvRProductos.DataBind(); } else { pSi.Visible = false; pNo.Visible = true; } }
private void cargarIBPrecio() { String _inicio = ""; String _fin = ""; int _ddl = int.Parse(ddlPrecio.SelectedValue.ToString()); if (ddlPrecio.SelectedValue == "0") { _inicio = "0"; _fin = "500.00"; } if (ddlPrecio.SelectedValue == "1") { _inicio = "500.01"; _fin = "800.00"; } if (ddlPrecio.SelectedValue == "2") { _inicio = "800.01"; _fin = "1000.00"; } if (ddlPrecio.SelectedValue == "3") { _inicio = "1000.01"; _fin = "1500.00"; } if (ddlPrecio.SelectedValue == "4") { _inicio = "1500.01"; _fin = "1500.01"; } DataSet _cant = _consulta.Com21_consulta_Resportes(3, _ddl, _inicio, _fin); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } else { ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('No exiten registro para el rango de precios: " + ddlPrecio.SelectedItem + "" + "');", true); } }
private void cargarRPro() { ServicioCom21.ServicioCom21 _consulta = new ServicioCom21.ServicioCom21(); String _ident = Request.QueryString["Ident"].ToString(); switch (_ident) { case "0": DataSet _cat = _consulta.Com21_consulta_ResportesInicial(); if (_cat.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cat.Tables[0]; GvRProductos.DataBind(); } lblbusqueda.Text = "General"; break; case "1": int _ddl = int.Parse(Request.QueryString["Cant"].ToString()); DataSet _cant = _consulta.Com21_consulta_Resportes(1, _ddl, "0", "0"); if (_cant.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cant.Tables[0]; GvRProductos.DataBind(); } lblbusqueda.Text = "Cantidad"; break; case "2": int _ddlcat = int.Parse(Request.QueryString["Cat"].ToString()); DataSet _cats = _consulta.Com21_consulta_Resportes(2, _ddlcat, "0", "0"); if (_cats.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _cats.Tables[0]; GvRProductos.DataBind(); } lblbusqueda.Text = "Categoria"; break; case "3": String _inicio = ""; String _fin = ""; int _ddls = int.Parse(Request.QueryString["Pre"].ToString()); if (_ddls == 0) { _inicio = "0"; _fin = "500.00"; } if (_ddls == 1) { _inicio = "500.01"; _fin = "800.00"; } if (_ddls == 2) { _inicio = "800.01"; _fin = "1000.00"; } if (_ddls == 3) { _inicio = "1000.01"; _fin = "1500.00"; } if (_ddls == 4) { _inicio = "1500.01"; _fin = "1500.01"; } DataSet _pre = _consulta.Com21_consulta_Resportes(3, _ddls, _inicio, _fin); if (_pre.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _pre.Tables[0]; GvRProductos.DataBind(); } lblbusqueda.Text = "Precio"; break; default: int _ddlmar = int.Parse(Request.QueryString["Mar"].ToString()); DataSet _mar = _consulta.Com21_consulta_Resportes(4, _ddlmar, "0", "0"); if (_mar.Tables[0].Rows.Count > 0) { GvRProductos.DataSource = _mar.Tables[0]; GvRProductos.DataBind(); } lblbusqueda.Text = "Marca"; break; } }