/Docs/07-Implementacion/Source/trunk/EDUAR_Regular/EDUAR/EDUAR_UI/Private/Reports/PrintReport.aspx.cs

http://blpm.googlecode.com/ · C# · 110 lines · 79 code · 8 blank · 23 comment · 3 complexity · 6353874514145f72e958a9c36fdd5f52 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using EDUAR_UI.Shared;
  8. using System.Data;
  9. using EDUAR_UI.Utilidades;
  10. using System.Text;
  11. using System.IO;
  12. using EDUAR_Entities;
  13. using EDUAR_BusinessLogic.Common;
  14. namespace EDUAR_UI
  15. {
  16. public partial class PrintReport : EDUARBasePage
  17. {
  18. #region --[Propiedades]--
  19. /// <summary>
  20. /// Gets or sets the dt reporte.
  21. /// </summary>
  22. /// <value>
  23. /// The dt reporte.
  24. /// </value>
  25. public DataTable dtReporte
  26. {
  27. get
  28. {
  29. if (Session["dtReporte"] == null)
  30. Session["dtReporte"] = new DataTable();
  31. return (DataTable)Session["dtReporte"];
  32. }
  33. set { Session["dtReporte"] = value; }
  34. }
  35. /// <summary>
  36. /// Gets or sets the titulo reporte.
  37. /// </summary>
  38. /// <value>
  39. /// The titulo reporte.
  40. /// </value>
  41. public string tituloReporte
  42. {
  43. get
  44. {
  45. return Session["tituloReporte"].ToString();
  46. }
  47. }
  48. /// <summary>
  49. /// Gets or sets the filtros aplicados.
  50. /// </summary>
  51. /// <value>
  52. /// The filtros aplicados.
  53. /// </value>
  54. public string filtrosAplicados
  55. {
  56. get
  57. {
  58. return Session["filtrosAplicados"].ToString();
  59. }
  60. }
  61. #endregion
  62. #region --[Eventos]--
  63. /// <summary>
  64. /// Handles the Load event of the Page control.
  65. /// </summary>
  66. /// <param name="sender">The source of the event.</param>
  67. /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
  68. protected void Page_Load(object sender, EventArgs e)
  69. {
  70. try
  71. {
  72. btnImprimir.Attributes.Add("onClick", "Imprimir();");
  73. btnVolver.Attributes.Add("onClick", "Cerrar();");
  74. if (!Page.IsPostBack)
  75. {
  76. Persona usuario = new Persona();
  77. usuario.username = ObjSessionDataUI.ObjDTUsuario.Nombre;
  78. BLPersona objBLPersona = new BLPersona(usuario);
  79. objBLPersona.GetPersonaByEntidad();
  80. usuario = objBLPersona.Data;
  81. gvwReporte = UIUtilidades.GenerarGrilla(gvwReporte, dtReporte);
  82. lblTitulo.Text = "EDU@R 2.0";
  83. lblInforme.Text = tituloReporte;
  84. lblFecha.Text = DateTime.Now.ToShortDateString() + " "
  85. + DateTime.Now.Hour.ToString().PadLeft(2, '0') + ":" + DateTime.Now.Minute.ToString().PadLeft(2, '0');
  86. lblUsuario.Text = "- Usuario: " + usuario.apellido + " " + usuario.nombre;
  87. lblFiltro.Text = filtrosAplicados.Replace("\n", "<br />");
  88. gvwReporte.AllowPaging = false;
  89. gvwReporte.PageSize = 1000;
  90. gvwReporte.DataSource = dtReporte.DefaultView;
  91. gvwReporte.DataBind();
  92. udpReporte.Update();
  93. }
  94. }
  95. catch (Exception ex)
  96. { throw ex; }
  97. }
  98. #endregion
  99. #region --[Métodos Privados]--
  100. #endregion
  101. }
  102. }