protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { vencido.Text = "Vencido : " + Math.Round(Convert.ToDouble(ReporteRNegocio.vencidos_total(" and tipo_doc in ('IN') ")), MidpointRounding.AwayFromZero).ToString("N0"); } }
protected void Page_Load(object sender, EventArgs e) { Page.Form.Attributes.Add("enctype", "multipart/form-data"); if (!IsPostBack) { List <string> u_negocio = ReporteRNegocio.trae_app(User.Identity.Name).Split(',').ToList(); bool correcto_app = false; foreach (string u_ne in u_negocio) { if (u_ne.Trim() == "13") { correcto_app = true; } } if (!correcto_app) { Response.Redirect("MENU.aspx"); } CargarComboUsuario(); CargarComboProducto(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "temp", "<script language='javascript'>superfiltro();</script>", false); ScriptManager.RegisterStartupScript(Page, this.GetType(), "temp", "<script language='javascript'>CacheItems();</script>", false); } ScriptManager.RegisterStartupScript(Page, this.GetType(), "temp", "<script language='javascript'>CacheItems();</script>", false); }
protected void btn_quitar_agendado_Click(object sender, EventArgs e) { string delete = ""; foreach (GridViewRow dtgItem in this.G_DETALLE_ESTIMADOS_FACTURAS.Rows) { CheckBox Sel = ((CheckBox)G_DETALLE_ESTIMADOS_FACTURAS.Rows[dtgItem.RowIndex].FindControl("chkAccept")); bool valor = Sel.Checked; if (valor) { string num_factura = G_DETALLE_ESTIMADOS_FACTURAS.Rows[dtgItem.RowIndex].Cells[4].Text; delete += ReporteRNegocio.delete_fecha_cobro(num_factura); } else { } } if (!delete.Contains("ERROR")) { cont_filas = 0; sum_dolar = 0; sum_pesos = 0; DataTable auss = ReporteRNegocio.facturas_gestionadas(CB_DIAS_ELEGIDOS.SelectedValue.ToString()); G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss; total_filas = auss.Rows.Count; G_DETALLE_ESTIMADOS_FACTURAS.DataBind(); } else { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mant_AN2ww", "<script language='javascript'>alert('Error al borrar');</script>", false); } }
protected void chk_vend_CheckedChanged(object sender, EventArgs e) { if (txt_cod_usuario.Text != "" && ReporteRNegocio.grupos_usuario_v_report(txt_cod_usuario.Text).Trim() != "") { string grupo = ReporteRNegocio.grupos_usuario_v_report(txt_cod_usuario.Text).Trim(); if (grupo.Contains("Abarrotes") || grupo.Contains("Granos")) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>muestra_check();</script>", false); } cargar_unidad_negocio_vend(grupo); cargar_grupo_vend(grupo); cargar_pantallas_vend(grupo); DIV222.Attributes["style"] = "display:block;"; l_pantallas.Text = ""; DIV2_3.Attributes["style"] = "margin-right: 0px; margin-left: 0px; display:block;"; DIV555.Attributes["style"] = "display:none;"; } else { ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>registre_vended();</script>", false); chk_vend.Checked = false; DIV2_3.Attributes["style"] = "display:none;"; DIV222.Attributes["style"] = "display:none;"; DIV555.Attributes["style"] = "display:block;"; } }
protected void G_CONTACTOS_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Eliminar") { string rutcontact = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[2].Text); ReporteRNegocio.delete_contacto1(rutcontact, rutCliente); B_carga_contactos_Click1(sender, e); div_crear_contacto.Visible = false; } if (e.CommandName == "Editar") { h3_titulo.InnerText = "Editar Contacto"; btn_nuevo.Visible = false; div_crear_contacto.Visible = true; string id = t_rut_cont.Text = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[2].Text); string nomcontact = t_nom_cont.Text = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[3].Text); string corrcontact = t_corr_cont.Text = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[4].Text); string numcontact = t_num_cont.Text = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[5].Text); string descrip = t_descrip.Value = (G_CONTACTOS.Rows[Convert.ToInt32(e.CommandArgument)].Cells[6].Text).Replace(" ", ""); t_rut_cont.Enabled = false; //ReporteRNegocio.update_contactos(rutcontact, CB_CLIENTE.SelectedValue.Trim()); //B_carga_contactos_Click1(sender, e); } ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>chosen_upd();</script>", false); }
protected void G_PRODUCTOS_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Producto") { vendedor = G_PRODUCTOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[0].ToString(); cliente = G_PRODUCTOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[1].ToString(); string grupos_del_usuario = ""; grupos_del_usuario = agregra_comillas(ReporteRNegocio.grupos_usuario(User.Identity.Name.ToString())); if (grupos_del_usuario == "") { grupos_del_usuario = agregra_comillas(ReporteRNegocio.grupos_usuario_v_report(User.Identity.Name.ToString())); } header_sum2 = true; cont_det = 1; DataTable aux = ReporteRNegocio.listar_prod_client(G_PRODUCTOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[0].ToString(), G_PRODUCTOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[1].ToString(), PERIODOS, grupos_del_usuario); G_DET_PRODUCTOS.DataSource = aux; productos = aux; G_DET_PRODUCTOS.DataBind(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>CLICK_MODAL();</script>", false); ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script> new Tablesort(document.getElementById('ContentPlaceHolder_Contenido_G_PRODUCTOS')); </script>", false); } }
protected void btn_estimado_Click(object sender, EventArgs e) { string ponbr = ""; string invtid = ""; string ok_insert = ""; foreach (GridViewRow dtgItem in this.G_INFORME_TOTAL_VENDEDOR.Rows) { CheckBox Sel = ((CheckBox)G_INFORME_TOTAL_VENDEDOR.Rows[dtgItem.RowIndex].FindControl("chkAccept")); bool valor = Sel.Checked; if (valor) { invtid = G_INFORME_TOTAL_VENDEDOR.DataKeys[dtgItem.RowIndex].Values[0].ToString().Trim(); ponbr = G_INFORME_TOTAL_VENDEDOR.DataKeys[dtgItem.RowIndex].Values[1].ToString().Trim(); string ok = ReporteRNegocio.insert_compra_sys(invtid, ponbr, t_ob_cobro.Value); if (ok == "OK") { ok_insert += "OK"; } else { ok_insert += "Error"; } } } Button1_Click(sender, e); ScriptManager.RegisterStartupScript(Page, this.GetType(), "teasd11Q21mp", "<script language='javascript'> var elem3 = document.getElementById(\"<%=carga_2.ClientID%>\"); elem3.style.display = \"none\";</script>", false); }
public static string llena_cheques() { string vencidos = ReporteRNegocio.vencidos_total(" and tipo_doc in ('IN', 'DM') "); string estimado = ReporteRNegocio.estimados_total(" and tipo_doc in ('IN','DM') "); DataTable rangos_vencidos = ReporteRNegocio.trae_rangos(); DataTable rangos_factu_che = ReporteRNegocio.trae_fact_cheque_dm(); DataTable rangos_abarrotes_y_granos = ReporteRNegocio.trae_abarr_y_granos(); DataTable rangos_clase_cliente = ReporteRNegocio.trae_clase_clientes(); //TOTALES RANGOS FECHAS string series = " [{ name: '$ ', colorByPoint: true, data: " + " [{ " + string_data_rangos(rangos_vencidos) + " }] " + " }] "; //double round = Math.Round(Convert.ToDouble(r[0].ToString()), MidpointRounding.AwayFromZero); series += "& [{ name: '$ ', colorByPoint: true, data: [{ name: 'Vencidos', y: " + Math.Round(Convert.ToDouble(vencidos), MidpointRounding.AwayFromZero).ToString() + ", }, { name: 'NoVencido', y: " + Math.Round(Convert.ToDouble(estimado), MidpointRounding.AwayFromZero).ToString() + ", " + " }] " + " }] "; //FACTURAS Y CHEQUES series += "& [{ name: '$ ', colorByPoint: true, data: " + " [{ " + string_data_rangos(rangos_factu_che) + " }] " + " }] "; //ABARROTES Y GRANOS series += "& [{ name: '$ ', colorByPoint: true, data: " + " [{ " + string_data_rangos(rangos_abarrotes_y_granos) + " }] " + " }] "; //CLASES DE CLIENTES (SALMONERA, ABARROTES, HUEVOS... ETC) series += "& [{ name: '$ ', colorByPoint: true, data: " + " [{ " + string_data_rangos_sin_color(rangos_clase_cliente) + " }] " + " }] "; return(series); }
private void cargar_bodegas() { DateTime t = DateTime.Now; DateTime t2 = DateTime.Now; t = new DateTime(t.Year, t.Month, 1); string DESDE = t.ToShortDateString(); string HASTA = t2.ToShortDateString(); DESDE = DESDE.Replace("-", "/"); HASTA = HASTA.Replace("-", "/"); string where = " where FechaFactura >= CONVERT(datetime,'" + DESDE + "', 103) " + " and FechaFactura <= CONVERT(datetime,'" + HASTA + "',103) and user1 in (" + grupos + ")"; DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.carga_grupos(DESDE, HASTA, grupos); dtv = dt.DefaultView; d_grupos_usuario.DataSource = dtv; d_grupos_usuario.DataTextField = "user1"; d_grupos_usuario.DataValueField = "user1"; //d_vendedor_.SelectedIndex = -1; d_grupos_usuario.DataBind(); }
public static List <app> APP_POR_UNIDAD(string u_negocio) { DataTable dt = new DataTable(); if (u_negocio == "") { u_negocio = "-1"; } string where = " where cod_unineg in (" + u_negocio + ") "; try { dt = ReporteRNegocio.carga_app_unidad(where); ////dt.Rows.Add(new Object[] { "-1", "-- Todos --" }); DataView dv = dt.DefaultView; dv.Sort = "cod_app"; dt = dv.ToTable(); } catch { } //} var query = from item in dt.AsEnumerable() where 1 == 1 select new app { cod_app = Convert.ToString(item["cod_app"]), nom_app = Convert.ToString(item["nom_app"]) }; return(query.ToList <app>()); }
protected void btn_excel_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=COMPRAS_OBS" + DateTime.Now.ToShortDateString() + ".xls"); Response.Charset = ""; // If you want the option to open the Excel file without saving than // comment out the line below Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); G_EXCEL.DataSource = ReporteRNegocio.excel_gama(Session["where_excel"].ToString()); G_EXCEL.DataBind(); G_EXCEL.Columns[0].Visible = false; G_EXCEL.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); Response.End(); }
protected void b_Click(object sender, ImageClickEventArgs e) { string grupos_del_usuario = ""; grupos_del_usuario = agregra_comillas(ReporteRNegocio.grupos_usuario(User.Identity.Name.ToString())); if (grupos_del_usuario == "") { grupos_del_usuario = agregra_comillas(ReporteRNegocio.grupos_usuario_v_report(User.Identity.Name.ToString())); } DataTable dt; DataView dtv = new DataView(); //cargar_combo_Grupo(dt, dtv); string es_vend = ReporteRNegocio.esvendedor(User.Identity.Name.ToString()); if (es_vend != "2") { string where = " where "; where += " user1 in (" + grupos_del_usuario + ")"; cargar_combo_VENDEDOR(ReporteRNegocio.listar_ALL_vendedores(where), dtv); cargar_combo_clientes(ReporteRNegocio.listar_ALL_cliente2(where), dtv); } else { string where = " where "; where += " user1 in (" + grupos_del_usuario + ")"; cargar_combo_VENDEDOR(ReporteRNegocio.listar_ALL_vendedores(where + " and codvendedor = '" + USER + "' "), dtv); cargar_combo_clientes(ReporteRNegocio.listar_ALL_cliente2(where + " and codvendedor = '" + USER + "' "), dtv); } }
protected void Page_Load(object sender, EventArgs e) { //Page.RegisterRedirectOnSessionEndScript(); page = this.Page; if (!IsPostBack) { string facturas = Request.QueryString["F"]; Txt_num_doc.Text = facturas; List <string> u_negocio = ReporteRNegocio.trae_app(User.Identity.Name).Split(',').ToList(); bool correcto_app = false; foreach (string u_ne in u_negocio) { if (u_ne.Trim() == "24" || u_ne.Trim() == "43") { correcto_app = true; } } if (!correcto_app) { Response.Redirect("MENU.aspx"); } if (Session["SW_PERMI"].ToString() == "1") { //titulo.InnerHtml = "<i class='fa fa-file-o fa-3x'></i> <a class='h1' href='reportes.aspx?s=1'>Abarrotes</a>"; titulo2.HRef = "reportes.aspx?s=1"; titulo2.InnerText = "Abarrotes"; } else if (Session["SW_PERMI"].ToString() == "2") { //titulo.InnerHtml = "<i class='fa fa-file-o fa-3x'></i> <a class='h1' href='reportes.aspx?s=2'>Granos</a>"; titulo2.HRef = "reportes.aspx?s=2"; titulo2.InnerText = "Granos"; } USER = User.Identity.Name.ToString(); l_usuario_.Text = USER; DateTime t = DateTime.Now; DateTime t2 = DateTime.Now; //////t = new DateTime(t.Year, t.Month - 6, 1); txt_desde.Text = ReporteRNegocio.CALCULA_DESDE(t.Month, t.Year); txt_hasta.Text = t2.ToShortDateString(); string es_vendedor = ReporteRNegocio.esvendedor(USER); if (es_vendedor == "2") { btn_excel.Visible = false; btn_excel2.Visible = false; } else { btn_excel.Visible = true; btn_excel2.Visible = true; } ImageClickEventArgs ex = new ImageClickEventArgs(1, 2); b_Click(sender, ex); } }
public static List <PRODUCTO> PRODUCTO_POR_BODEGA(string bodega) { DataTable dt = new DataTable(); string bodega1 = agregra_comillas2(bodega); string where = ""; if (bodega1 != "") { where = " and siteid in(" + bodega1 + ") "; } else { bodega1 = ""; } //{ try { dt = ReporteRNegocio.listar_ALL_productos_stock(where, HttpContext.Current.Session["clase"].ToString()); ////dt.Rows.Add(new Object[] { "-1", "-- Todos --" }); DataView dv = dt.DefaultView; dv.Sort = "descr"; dt = dv.ToTable(); } catch { } //} var query = from item in dt.AsEnumerable() where 1 == 1 select new PRODUCTO { COD_PROD = Convert.ToString(item["invtid"]), NOM_PROD = Convert.ToString(item["descr"]) }; return(query.ToList <PRODUCTO>()); }
public static string guardar_solo_kg(string sw, string tipo, string valor) { DataTable dt = new DataTable(); string respt = ""; try { string oka = ReporteRNegocio.guardar_valor_equivale( sw, tipo, valor ); if (oka == "OK") { respt = "ok"; } else { respt = "error"; } } catch { } //} return(respt); }
protected void guarda_Click(object sender, EventArgs e) { string es_su_pass = ReporteRNegocio.es_su_pass(USER); clsCrypto.CL_Crypto encriptador = new clsCrypto.CL_Crypto("Somos los mas solomon de quillota 2015"); string contrasena = encriptador.EncryptData(pass_antigua.Value.ToUpper()); if (es_su_pass != contrasena) { mensaje_pass.Text = "Contraseña actual errónea, reingrese"; } else { usuarioEntity us = new usuarioEntity(); us.cod_usuario = USER.ToUpper(); usuarioBO.encontrar(ref us); clsCrypto.CL_Crypto encriptador2 = new clsCrypto.CL_Crypto("Somos los mas solomon de quillota 2015"); string contrasena2 = encriptador2.EncryptData(pass_nueva.Value.ToUpper()); us.clave = contrasena2; us.activado = "true"; us.tipo_usuario = ReporteRNegocio.es_su_tipo(USER); if (usuarioBO.actualizar(us, USER) == "OK") { mensaje_pass.Text = "Contraseña cambiada ! "; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <string> u_negocio = ReporteRNegocio.trae_u_negocio(User.Identity.Name).Split(',').ToList(); bool correcto_app = false; foreach (string u_ne in u_negocio) { if (u_ne.Trim() == "3") { correcto_app = true; } } if (!correcto_app) { Response.Redirect("MENU.aspx"); } //titulo.InnerHtml = "<i class='fa fa-file-o fa-3x'></i> <a class='h1' href='MENU_FINANZAS.aspx?'>Finanzas</a>"; titulo2.InnerHtml = "Finanzas"; if (Session["contraseña"] == null) { Response.Redirect("Acceso.aspx"); } Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now); Response.Cache.SetNoServerCaching(); Response.Cache.SetNoStore(); } }
protected void Button1_Click(object sender, EventArgs e) { string produc = agregra_comillas(l_vendedores.Text); string desde = txt_desde.Text; string hasta = txt_hasta.Text; string where3 = " where cod >= 1000 and cod <= 9000 "; if (desde != "") { where3 += " and convert(datetime, u.[F.Recib], 103) >= convert(datetime, '" + desde + "', 103) "; } if (hasta != "") { where3 += " and convert(datetime, u.[F.Recib], 103) <= convert(datetime, '" + hasta + "', 103) "; } if (produc != "") { where3 += " and u.cod in (" + produc + ")"; } div_report.Visible = true; DataTable dt2 = ReporteRNegocio.lista_costosimpot(where3); sub_dolar = 0; G_INFORME_TOTAL_VENDEDOR.DataSource = dt2; G_INFORME_TOTAL_VENDEDOR.DataBind(); JQ_Datatable(); }
private void cargar_vendedores() { DateTime t = DateTime.Now; DateTime t2 = DateTime.Now; t = new DateTime(t.Year, t.Month, 1); string DESDE = t.ToShortDateString(); string HASTA = t2.ToShortDateString(); DESDE = DESDE.Replace("-", "/"); HASTA = HASTA.Replace("-", "/"); string where = " where user1 in (" + grupos + ")"; DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.listar_ALL_vendedores(where); DataView dv = dt.DefaultView; dv.Sort = "nom_vend"; dtv = dt.DefaultView; d_vendedor_.DataSource = dtv; d_vendedor_.DataTextField = "nom_vend"; d_vendedor_.DataValueField = "cod_vend"; //d_vendedor_.SelectedIndex = -1; d_vendedor_.DataBind(); }
protected void b_Click(object sender, ImageClickEventArgs e) { DataTable dt; DataView dtv = new DataView(); cargar_combo_bodega(ReporteRNegocio.listar_ALL_cliente2(""), dtv); cargar_combo_producto(ReporteRNegocio.listar_ALL_productos_stock("", Session["clase"].ToString()), dtv); cargar_bodegas(); }
public static List <VENDEDOR> VENDEDOR_POR_GRUPO(string grupos, string desde, string hasta, string usuario) { DataTable dt = new DataTable(); string grupos_ = agregra_comillas2(grupos); string es_vendedor = ReporteRNegocio.esvendedor(usuario); string where = " where FechaFactura >= CONVERT(datetime,'" + desde + "', 103) " + " and FechaFactura <= CONVERT(datetime,'" + hasta + "',103) "; if (es_vendedor == "2") { where += " and codvendedor in ('" + usuario + "')"; } if (!grupos_.Contains("'-1'") && grupos_ != "" && !grupos_.Contains("'-- Todos --'")) { where += " and user1 in (" + grupos_ + ")"; } if (grupos_.Contains("'-- Todos --'") && es_vendedor == "2") { where += " and user1 in (" + agregra_comillas2(ReporteRNegocio.grupos_usuario_v_report(USER)) + ")"; } else if (grupos_.Contains("'-- Todos --'")) { where += " and user1 in (" + agregra_comillas2(ReporteRNegocio.grupos_usuario(USER)) + ")"; } if (grupos == "") { where += " and 1=1 "; } try { dt = ReporteRNegocio.listar_ALL_vendedores(where); ////dt.Rows.Add(new Object[] { "-1", "-- Todos --" }); DataView dv = dt.DefaultView; dv.Sort = "nom_vend"; dt = dv.ToTable(); } catch { } var query = from item in dt.AsEnumerable() where 1 == 1 select new VENDEDOR { cod_vendedor = Convert.ToString(item["cod_vend"]), nom_vendedor = Convert.ToString(item["nom_vend"]) }; return(query.ToList <VENDEDOR>()); }
protected void btn_informe_Click(object sender, EventArgs e) { div_report.Visible = true; G_INFORME_TOTAL_VENDEDOR.Visible = true; G_INFORME_TOTAL_VENDEDOR.DataSource = ReporteRNegocio.trae_log_fich_(); G_INFORME_TOTAL_VENDEDOR.DataBind(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script> new Tablesort(document.getElementById('ContentPlaceHolder_Contenido_G_INFORME_TOTAL_VENDEDOR')); </script>", false); }
protected void btn_informe_Click(object sender, EventArgs e) { string bodega = agregra_comillas(l_grupos.Text); string productos = agregra_comillas(l_vendedores.Text); string where = " and 1=1"; if (bodega != "") { where += " and bodega in (" + agregra_comillas(bodega) + ")"; } if (productos != "") { where += " and producto in (" + agregra_comillas(productos) + ") "; } div_report.Visible = true; G_INFORME_TOTAL_VENDEDOR.Visible = true; G_INFORME_TOTAL_VENDEDOR.DataSource = ReporteRNegocio.productos_compras(where); G_INFORME_TOTAL_VENDEDOR.DataBind(); string where2 = " and 1=1"; if (l_grupos.Text != "") { where2 += " and siteid in (" + agregra_comillas(l_grupos.Text) + ")"; } DataTable dt = new DataTable(); try { dt = ReporteRNegocio.listar_ALL_productos_stock(where2, HttpContext.Current.Session["clase"].ToString()); //dt.Rows.Add(new Object[] { "-1", "-- Todos --" }); DataView dv3 = dt.DefaultView; dv3.Sort = "descr"; dt = dv3.ToTable(); d_producto.DataSource = dt; d_producto.DataTextField = "descr"; d_producto.DataValueField = "invtid"; d_producto.DataBind(); foreach (ListItem item in d_producto.Items) { if (l_vendedores.Text.Contains(item.Value.ToString())) { item.Selected = true; } } } catch { } ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeees", "<script> new Tablesort(document.getElementById('ContentPlaceHolder_Contenido_G_INFORME_TOTAL_VENDEDOR')); </script>", false); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List <string> u_negocio = ReporteRNegocio.trae_app(User.Identity.Name).Split(',').ToList(); bool correcto_app = false; foreach (string u_ne in u_negocio) { if (u_ne.Trim() == "47") { correcto_app = true; } } if (!correcto_app) { Response.Redirect("MENU.aspx"); } if (Session["SW_PERMI"].ToString() == "1") { //titulo.InnerHtml = "<i class='fa fa-file-o fa-3x'></i> <a class='h1' href='reportes.aspx?s=1'>Abarrotes</a>"; titulo2.HRef = "reportes.aspx?s=1"; titulo2.InnerText = "Abarrotes"; cargar_productos_SP("Abarrotes"); } else if (Session["SW_PERMI"].ToString() == "2") { //titulo.InnerHtml = "<i class='fa fa-file-o fa-3x'></i> <a class='h1' href='reportes.aspx?s=2'>Granos</a>"; titulo2.HRef = "reportes.aspx?s=2"; titulo2.InnerText = "Granos"; cargar_productos_SP("Granos"); } string es_vend = ReporteRNegocio.esvendedor(User.Identity.Name.ToString()); if (es_vend != "2") { Session["codvendedor"] = ""; } else { Session["codvendedor"] = " and codvendedor = '" + User.Identity.Name.ToString() + "'"; } txt_desde.Text = DateTime.Now.AddDays(-1).ToShortDateString(); txt_hasta.Text = DateTime.Now.AddDays(-1).ToShortDateString(); cargar_vendedor_SP(); cargar_estado_SP(); cargar_clientes_SP(); } }
private void cargar_vendedor_SP() { DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.VM_listaVendedor(Session["codvendedor"].ToString(), ""); dtv = dt.DefaultView; d_vendedor.DataSource = dtv; d_vendedor.DataTextField = "nombrevendedor"; d_vendedor.DataValueField = "codvendedor"; d_vendedor.DataBind(); }
private void cargar_productos_SP(string depto) { DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.VM_productos(depto, ""); dtv = dt.DefaultView; d_producto.DataSource = dtv; d_producto.DataTextField = "NOMBRE_COMPLETO"; d_producto.DataValueField = "codproducto"; d_producto.DataBind(); }
private void cargar_estado_SP() { DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.VM_estados_2(""); dtv = dt.DefaultView; d_estado_sp.DataSource = dtv; d_estado_sp.DataTextField = "descestadodocumento"; d_estado_sp.DataValueField = "descestadodocumento"; d_estado_sp.DataBind(); }
private void cargar_clientes_SP() { DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.VM_clientes(" where 1=1 " + Session["codvendedor"], ""); dtv = dt.DefaultView; d_cliente.DataSource = dtv; d_cliente.DataTextField = "nombre"; d_cliente.DataValueField = "rut"; d_cliente.DataBind(); }
private void cargar_usuarios() { ScriptManager.RegisterStartupScript(Page, this.GetType(), "teeee", "<script language='javascript'>vaciar_editar();</script>", false); DataTable dt; dt = ReporteRNegocio.cargar_usuarios(); G_usuarios.DataSource = dt; G_usuarios.DataBind(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "teewqqwwqee", "<script> new Tablesort(document.getElementById('ContentPlaceHolder_Contenido_G_usuarios')); </script>", false); }
private void cargar_bodegas() { DataTable dt; DataView dtv = new DataView(); dt = ReporteRNegocio.listar_bodegas_vm(); dtv = dt.DefaultView; d_bodega.DataSource = dtv; d_bodega.DataTextField = "codbodega"; d_bodega.DataValueField = "codbodega"; //d_vendedor_.SelectedIndex = -1; d_bodega.DataBind(); }