protected void b_llenar_clte_cotizados_Click(object sender, EventArgs e) { try { string filtro_fecha = ""; if (T_FECHA_DESDE.Text != "") { filtro_fecha += " and convert(date, fecha_envio, 103) >= convert(date, '" + Convert.ToDateTime(T_FECHA_DESDE.Text).ToString("dd/MM/yyyy") + "',103) "; } if (T_FECHA_HASTA.Text != "") { filtro_fecha += " and convert(date, fecha_envio, 103) <= convert(date, '" + Convert.ToDateTime(T_FECHA_HASTA.Text).ToString("dd/MM/yyyy") + "',103) "; } DBUtil db = new DBUtil(); string sql_query = ""; sql_query += " select distinct rut_cliente, [nombre cliente], isnull(nombre_usuario,'NO ASIGNADO') as 'nombre_usuario', count(1) as contador " + " from V_CTZ_LOG_COTIZACION where rut_cliente <> '0' and cod_vendedor = '" + T_VENDEDOR.Text + "' " + filtro_fecha + " " + " group by rut_cliente, [nombre cliente], nombre_usuario " + " order by contador desc "; ScriptManager.RegisterStartupScript(this, typeof(Page), "asdfasvfsad", "<script>javascript:abremodaldetclientes();</script>", false); TITULO_COTIZADO_NOCOTIZADO.InnerHtml = "<h4 class='modal-title' id='myModalLabel18'><b>Clientes Cotizados</b></h4>"; G_COTIZADOS_NOCOTIZADOS.DataSource = db.consultar(sql_query); G_COTIZADOS_NOCOTIZADOS.DataBind(); up_modal_clte_cotizados.Update(); } catch (Exception ex) { } }
protected void b_llenar_clte_cotizados2_Click(object sender, EventArgs e) { try { string filtro_fecha = ""; if (T_FECHA_DESDE.Text != "") { filtro_fecha += " and convert(date, fecha_envio, 103) >= convert(date, '" + Convert.ToDateTime(T_FECHA_DESDE.Text).ToString("dd/MM/yyyy") + "',103) "; } if (T_FECHA_HASTA.Text != "") { filtro_fecha += " and convert(date, fecha_envio, 103) <= convert(date, '" + Convert.ToDateTime(T_FECHA_HASTA.Text).ToString("dd/MM/yyyy") + "',103) "; } DBUtil db = new DBUtil(); string sql_query = ""; sql_query += " select distinct rutcliente as 'rut_cliente', [nombre cliente], isnull([nombre vendedor],'NO ASIGNADO') as 'nombre_usuario', 0 as contador from V_CTZ_GESTION_VENTAS_FIN " + " where codvendedor = '" + CB_VENDEDORES.SelectedValue + "' " + " and rutcliente not in (select rut_cliente from CTZ_LOG_ENVIADAS where cod_vendedor = '" + CB_VENDEDORES.SelectedValue + "' " + filtro_fecha + ") "; ScriptManager.RegisterStartupScript(this, typeof(Page), "asdfasvfsad", "<script>javascript:abremodaldetclientes();</script>", false); TITULO_COTIZADO_NOCOTIZADO.InnerHtml = "<h4 class='modal-title' id='myModalLabel18'><b>Clientes No Cotizados</b></h4>"; G_COTIZADOS_NOCOTIZADOS.DataSource = db.consultar(sql_query); G_COTIZADOS_NOCOTIZADOS.DataBind(); up_modal_clte_cotizados.Update(); } catch (Exception ex) { } }