+
Cod.ARTICOLO
<%: CodArticolo %>
diff --git a/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs b/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
index 7254386..6a378e6 100644
--- a/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
+++ b/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
@@ -23,6 +23,24 @@ namespace C_TRACK.WebUserControls
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAddNew;
+ ///
+ /// Controllo divExport.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divExport;
+
+ ///
+ /// Controllo hlExport.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.HyperLink hlExport;
+
///
/// Controllo divArticolo.
///
diff --git a/C-TRACK/WebUserControls/mod_periodo.ascx b/C-TRACK/WebUserControls/mod_periodo.ascx
index 7782f88..c0bff5c 100644
--- a/C-TRACK/WebUserControls/mod_periodo.ascx
+++ b/C-TRACK/WebUserControls/mod_periodo.ascx
@@ -1,18 +1,10 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_periodo.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_periodo" %>
-
+
+
+
\ No newline at end of file
diff --git a/C-TRACK/WebUserControls/mod_periodo.ascx.cs b/C-TRACK/WebUserControls/mod_periodo.ascx.cs
index b428c51..77980de 100644
--- a/C-TRACK/WebUserControls/mod_periodo.ascx.cs
+++ b/C-TRACK/WebUserControls/mod_periodo.ascx.cs
@@ -3,59 +3,61 @@ using System.Web.UI;
namespace C_TRACK.WebUserControls
{
- public partial class mod_periodo : System.Web.UI.UserControl
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class mod_periodo : BaseUserControl
{
- if (!Page.IsPostBack)
- {
- dataFrom = DateTime.Today.AddMonths(-1);
- dataTo = DateTime.Today.AddDays(1);
- updateUrl();
- }
- }
+ #region Public Properties
- protected DateTime dataFrom
- {
- get
- {
- DateTime answ = DateTime.Today;
- DateTime.TryParse(txtFrom.Text.Trim(), out answ);
- return answ;
- }
- set
- {
- txtFrom.Text = value.ToString("yyyy-MM-dd");
- }
- }
+ public DateTime dataFrom
+ {
+ get
+ {
+ DateTime answ = DateTime.Today;
+ DateTime.TryParse(txtFrom.Text.Trim(), out answ);
+ return answ;
+ }
+ set
+ {
+ txtFrom.Text = value.ToString("yyyy-MM-dd");
+ }
+ }
- protected DateTime dataTo
- {
- get
- {
- DateTime answ = DateTime.Today;
- DateTime.TryParse(txtTo.Text.Trim(), out answ);
- return answ;
- }
- set
- {
- txtTo.Text = value.ToString("yyyy-MM-dd");
- }
- }
+ public DateTime dataTo
+ {
+ get
+ {
+ DateTime answ = DateTime.Today;
+ DateTime.TryParse(txtTo.Text.Trim(), out answ);
+ return answ;
+ }
+ set
+ {
+ txtTo.Text = value.ToString("yyyy-MM-dd");
+ }
+ }
- protected void txtFrom_TextChanged(object sender, EventArgs e)
- {
- updateUrl();
- }
+ #endregion Public Properties
- protected void txtTo_TextChanged(object sender, EventArgs e)
- {
- updateUrl();
- }
+ #region Protected Methods
- private void updateUrl()
- {
- hlExport.NavigateUrl = string.Format("~/doExport?from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", dataFrom, dataTo);
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ dataFrom = DateTime.Today.AddMonths(-1);
+ dataTo = DateTime.Today.AddDays(1);
+ }
+ }
+
+ protected void txtFrom_TextChanged(object sender, EventArgs e)
+ {
+ raiseEvent();
+ }
+
+ protected void txtTo_TextChanged(object sender, EventArgs e)
+ {
+ raiseEvent();
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/C-TRACK/WebUserControls/mod_periodo.ascx.designer.cs b/C-TRACK/WebUserControls/mod_periodo.ascx.designer.cs
index fb4a820..f908db8 100644
--- a/C-TRACK/WebUserControls/mod_periodo.ascx.designer.cs
+++ b/C-TRACK/WebUserControls/mod_periodo.ascx.designer.cs
@@ -7,11 +7,13 @@
//
//------------------------------------------------------------------------------
-namespace C_TRACK.WebUserControls {
-
-
- public partial class mod_periodo {
-
+namespace C_TRACK.WebUserControls
+{
+
+
+ public partial class mod_periodo
+ {
+
///
/// Controllo txtFrom.
///
@@ -20,7 +22,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.TextBox txtFrom;
-
+
///
/// Controllo txtTo.
///
@@ -29,14 +31,5 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.TextBox txtTo;
-
- ///
- /// Controllo hlExport.
- ///
- ///
- /// Campo generato automaticamente.
- /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
- ///
- protected global::System.Web.UI.WebControls.HyperLink hlExport;
}
}
diff --git a/C-TRACK/doExport.aspx.cs b/C-TRACK/doExport.aspx.cs
index ced6d84..df95bdc 100644
--- a/C-TRACK/doExport.aspx.cs
+++ b/C-TRACK/doExport.aspx.cs
@@ -5,84 +5,132 @@ using System.Text;
namespace C_TRACK
{
- public partial class doExport : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class doExport : System.Web.UI.Page
{
- string delimiter = ",";
+ #region Protected Properties
- //prepare the output stream
- Response.Clear();
- Response.ContentType = "text/csv";
- Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
-
- string value = "";
- StringBuilder builder = new StringBuilder();
-
- // recupero oggetti parametrici...
- string from = Request.QueryString["from"];
- string to = Request.QueryString["to"];
- DateTime dateFrom = DateTime.Today.AddYears(-1);
- DateTime dateTo = DateTime.Today.AddDays(1);
- // se è diverso da vuoto faccio parse...
- if (from != "" && from !=null)
- {
- DateTime.TryParse(from, out dateFrom);
- }
- if (to != "" && to != null)
- {
- DateTime.TryParse(to, out dateTo);
- }
-
- // leggo tabella
- var dt = dataLayer.man.taTR.getByFilt("", dateFrom, dateTo);
-
- //write the csv column headers
- for (int i = 0; i < dt.Columns.Count; i++)
- {
-
- value = dt.Columns[i].ColumnName;
- // Implement special handling for values that contain comma or quote
- // Enclose in quotes and double up any double quotes
- if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
- builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
- else
+ protected DateTime dateFrom
{
- builder.Append(value);
-
+ get
+ {
+ DateTime answ = DateTime.Today.AddYears(-1);
+ // se è diverso da vuoto faccio parse...
+ if (!string.IsNullOrEmpty(from))
+ {
+ DateTime.TryParse(from, out answ);
+ }
+ return answ;
+ }
}
- Response.Write(value);
- Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
- builder.Clear();
- }
-
- //write the data
- foreach (DataRow row in dt.Rows)
- {
- for (int i = 0; i < dt.Columns.Count; i++)
+ protected DateTime dateTo
{
- value = row[i].ToString();
- // Implement special handling for values that contain comma or quote
- // Enclose in quotes and double up any double quotes
-
- if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
- builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
- else
- {
- builder.Append(value);
-
- }
-
- Response.Write(builder.ToString());
- Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
- builder.Clear();
+ get
+ {
+ DateTime answ = DateTime.Today.AddDays(1);
+ // se è diverso da vuoto faccio parse...
+ if (!string.IsNullOrEmpty(to))
+ {
+ DateTime.TryParse(to, out answ);
+ }
+ return answ;
+ }
}
- }
- Response.End();
+ protected string from
+ {
+ get
+ {
+ return Request.QueryString["from"];
+ }
+ }
+ protected string mode
+ {
+ get
+ {
+ return Request.QueryString["mode"];
+ }
+ }
+ protected string to
+ {
+ get
+ {
+ return Request.QueryString["to"];
+ }
+ }
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string delimiter = ",";
+
+ //prepare the output stream
+ Response.Clear();
+ Response.ContentType = "text/csv";
+ Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
+
+ string value = "";
+ StringBuilder builder = new StringBuilder();
+ DataTable dt = new DataTable();
+
+ // leggo tabella secondo il MODO
+ if (mode == "aggr")
+ {
+ dt = (DataTable)dataLayer.man.taTRA.getByFilt("", dateFrom, dateTo);
+ }
+ else
+ {
+ dt = (DataTable)dataLayer.man.taTR.getByFilt("", dateFrom, dateTo);
+ }
+
+ // write the csv column headers
+ for (int i = 0; i < dt.Columns.Count; i++)
+ {
+ value = dt.Columns[i].ColumnName;
+ // Implement special handling for values that contain comma or quote
+ // Enclose in quotes and double up any double quotes
+ if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
+ builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
+ else
+ {
+ builder.Append(value);
+ }
+
+ Response.Write(value);
+ Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
+ builder.Clear();
+ }
+
+ //write the data
+ foreach (DataRow row in dt.Rows)
+ {
+ for (int i = 0; i < dt.Columns.Count; i++)
+ {
+ value = row[i].ToString();
+ // Implement special handling for values that contain comma or quote
+ // Enclose in quotes and double up any double quotes
+
+ if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
+ builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
+ else
+ {
+ builder.Append(value);
+ }
+
+ Response.Write(builder.ToString());
+ Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
+ builder.Clear();
+ }
+ }
+
+ Response.End();
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/C-TRACK/export.aspx b/C-TRACK/export.aspx
index 73d4c14..84d71e4 100644
--- a/C-TRACK/export.aspx
+++ b/C-TRACK/export.aspx
@@ -3,17 +3,26 @@
<%@ Register Src="~/WebUserControls/mod_checkOpr.ascx" TagPrefix="uc1" TagName="mod_checkOpr" %>
<%@ Register Src="~/WebUserControls/mod_periodo.ascx" TagPrefix="uc1" TagName="mod_periodo" %>
-
-
-
-
+
\ No newline at end of file
diff --git a/C-TRACK/export.aspx.cs b/C-TRACK/export.aspx.cs
index e42d461..9843539 100644
--- a/C-TRACK/export.aspx.cs
+++ b/C-TRACK/export.aspx.cs
@@ -7,11 +7,30 @@ using System.Web.UI.WebControls;
namespace C_TRACK
{
- public partial class export : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class export : System.Web.UI.Page
{
+ #region Private Methods
+ private void mod_periodo_eh_doRefresh(object sender, EventArgs e)
+ {
+ updateUrl();
+ }
+
+ private void updateUrl()
+ {
+ hlExportFull.NavigateUrl = string.Format("~/doExport?mode=full&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
+ hlExportComp.NavigateUrl = string.Format("~/doExport?mode=aggr&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ mod_periodo.eh_doRefresh += mod_periodo_eh_doRefresh;
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/C-TRACK/export.aspx.designer.cs b/C-TRACK/export.aspx.designer.cs
index 8db2a21..e86cb40 100644
--- a/C-TRACK/export.aspx.designer.cs
+++ b/C-TRACK/export.aspx.designer.cs
@@ -7,11 +7,13 @@
//
//------------------------------------------------------------------------------
-namespace C_TRACK {
-
-
- public partial class export {
-
+namespace C_TRACK
+{
+
+
+ public partial class export
+ {
+
///
/// Controllo mod_checkOpr.
///
@@ -20,7 +22,7 @@ namespace C_TRACK {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::C_TRACK.WebUserControls.mod_checkOpr mod_checkOpr;
-
+
///
/// Controllo mod_periodo.
///
@@ -29,5 +31,23 @@ namespace C_TRACK {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::C_TRACK.WebUserControls.mod_periodo mod_periodo;
+
+ ///
+ /// Controllo hlExportFull.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.HyperLink hlExportFull;
+
+ ///
+ /// Controllo hlExportComp.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.HyperLink hlExportComp;
}
}