protected void G_PRODUCTOS_COTIZADOS_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Print") { string id_producto = (G_PRODUCTOS_COTIZADOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[0].ToString()); string nom_producto = (G_PRODUCTOS_COTIZADOS.DataKeys[Convert.ToInt32(e.CommandArgument)].Values[1].ToString()); 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(); G_DET_COTIZACIONES.DataSource = db.consultar("select * from V_CTZ_LOG_COTIZACION2 where producto = '" + id_producto + "' " + filtro_fecha + " "); G_DET_COTIZACIONES.DataBind(); LBL_CTZDET_VENDEDOR.Text = "Producto: " + nom_producto; up_modal_detcotizacion.Update(); ScriptManager.RegisterStartupScript(this, typeof(Page), "abremodaldetcotizaciones", "<script>javascript:abremodaldetcotizaciones();</script>", false); } } catch (Exception ex) { } }
public void llenardetallecotizaciones() { 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) "; } G_DET_COTIZACIONES.DataSource = ctz_log_cotizacionBO.GetAll(" where cod_vendedor = '" + T_VENDEDOR.Text + "' " + filtro_fecha + " "); G_DET_COTIZACIONES.DataBind(); up_modal_detcotizacion.Update(); } catch (Exception ex) { } }
protected void B_LLENARDETALLECOTIZACIONES_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) "; } G_DET_COTIZACIONES.DataSource = ctz_log_cotizacionBO.GetAll(" where cod_vendedor = '" + T_COD_VENDEDOR.Text + "' " + filtro_fecha + " "); G_DET_COTIZACIONES.DataBind(); LBL_CTZDET_VENDEDOR.Text = "Vendedor: " + T_NOMBRE_VENDEDOR.Text; up_modal_detcotizacion.Update(); ScriptManager.RegisterStartupScript(this, typeof(Page), "abremodaldetcotizaciones", "<script>javascript:abremodaldetcotizaciones();</script>", false); } catch (Exception ex) { } }