using System; using System.Web.UI.WebControls; using Extensiones; using System.Data; using static Extensiones.ModExtensiones; using System.Web.UI; public partial class Ventas_RepVencimientosCredito : ClsPaginas { #region PROPIEDADES private int CveLineaAdicional { get { return (ViewState["CveLineaAdicional"] == null) ? 0 : int.Parse(ViewState["CveLineaAdicional"].ToString()); } set { ViewState["CveLineaAdicional"] = (int)value; } } private int CveVenta { get { return (ViewState["CveVenta"] == null) ? 0 : int.Parse(ViewState["CveVenta"].ToString()); } set { ViewState["CveVenta"] =(int) value; } } private int TipoLinea { get { return (ViewState["TipoLinea"] == null) ? 1: int.Parse(ViewState["TipoLinea"].ToString()); } set { ViewState["TipoLinea"] = (int)value; } } private DataTable DTDatosGvD { get { if (ViewState["DTDatosGvD"] == null) { ViewState["DTDatosGvD"] = new DataTable(); } return (DataTable)ViewState["DTDatosGvD"]; } set { ViewState["DTDatosGvD"] = (DataTable)value; } } private string LineaAdicionalComprobante { get { if(ViewState["LineaAdicionalComprobante"] == null) { ViewState["LineaAdicionalComprobante"] = ""; } return ViewState["LineaAdicionalComprobante"].ToString(); } set { ViewState["LineaAdicionalComprobante"] = value; } } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InicializaValores(); CargaDatos(); } } private void InicializaValores() { txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth().ToShortDateString(); txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString(); DdlClientes.setEsWebService(true); DdlClientes.Attributes.Add("data-metodo", "getcliente"); DdlClientes.SelectedText = "Todos"; DdlClientes.SelectedValue = "-1"; DdlSubProyectos.Items.Insert(0, new ListItem("Todos", "-1")); DdlSubProyectos.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa); DdlSubProyectos.DataBind(); } protected void BtnConsultar_Click(object sender, EventArgs e) { CargaDatos(); } private void CargaDatos() { DTDatosGvD = new DataTable(); LnkDescargaExcel.Visible = false; ClsVentas objVentas = new ClsVentas(); if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), DdlTipoLinea.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), -1, DdlSubProyectos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)) { GvD.DataSource = objVentas.DtResultados; if (objVentas.DtResultados.Rows.Count > 0) { DTDatosGvD = objVentas.DtResultados; LnkDescargaExcel.Visible = true; UpAcciones.Update(); } } objVentas.Dispose(); GvD.DataBind(); UpLineasAdicionales.Update(); } protected void LnkDescargaExcel_Click(object sender, EventArgs e) { GridView gvTemp = GvD; //gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString()); gvTemp.ExportToExcelGembox("RepVencimientos", UsuarioActual, "Rep Vencimientos de líneas", AnchoImagen: 150); } public override void VerifyRenderingInServerForm(Control control) { } }