diff --git a/INTERFACE/WebLCP/WUC/mod_jobsList.ascx b/INTERFACE/WebLCP/WUC/mod_jobsList.ascx index 9c3697a..ac3bcf3 100644 --- a/INTERFACE/WebLCP/WUC/mod_jobsList.ascx +++ b/INTERFACE/WebLCP/WUC/mod_jobsList.ascx @@ -14,14 +14,21 @@ - - + - - + - + + + + + + + + +
+
@@ -29,16 +36,8 @@ - - - - - - - - - - +
+
diff --git a/INTERFACE/WebLCP/WUC/mod_jobsList.ascx.cs b/INTERFACE/WebLCP/WUC/mod_jobsList.ascx.cs index 37db9dd..060c770 100644 --- a/INTERFACE/WebLCP/WUC/mod_jobsList.ascx.cs +++ b/INTERFACE/WebLCP/WUC/mod_jobsList.ascx.cs @@ -1,5 +1,7 @@ -using SteamWare; +using Newtonsoft.Json; +using SteamWare; using System; +using System.Collections; using System.Web.UI; using System.Web.UI.WebControls; @@ -7,6 +9,8 @@ namespace WebLCP.WUC { public partial class mod_jobsList : System.Web.UI.UserControl { + public event EventHandler eh_doRefresh; + protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) @@ -47,6 +51,10 @@ namespace WebLCP.WUC protected void chkToggle_CheckedChanged(object sender, EventArgs e) { bool setCheck = ((CheckBox)sender).Checked; +#if false + ArrayList al = new ArrayList(); + jobData currJob = new jobData(); +#endif // seleziono TUTTI i checkbox presenti foreach (GridViewRow row in grView.Rows) { @@ -54,9 +62,76 @@ namespace WebLCP.WUC { CheckBox chkb = (CheckBox)row.FindControl("chkSelected"); chkb.Checked = setCheck; +#if false + // aggiungo SE CHECKED il job alla lista... + if (setCheck) + { + currJob = new jobData(); + Label lblJob = (Label)row.FindControl("lblJobId"); + int jobId = 0; + int.TryParse(lblJob.Text, out jobId); + currJob.jobId = jobId; + currJob.jobCode = "J" + jobId.ToString("D9"); + al.Add(currJob); + } +#endif } catch { } } +#if false + // salvo in sessione arrayList utente... + string jsonData = JsonConvert.SerializeObject(al); + memLayer.ML.setSessionVal("jobSelection", jsonData); + raiseEvent(); +#endif + + + saveSelection(); + } + + protected void raiseEvent() + { + // se qualcuno ascolta sollevo evento nuovo valore... + if (eh_doRefresh != null) + { + eh_doRefresh(this, new EventArgs()); + } + } + + protected void chkSelected_CheckedChanged(object sender, EventArgs e) + { + saveSelection(); + } + + private void saveSelection() + { + ArrayList al = new ArrayList(); + jobData currJob; + // seleziono TUTTI i checkbox presenti + foreach (GridViewRow row in grView.Rows) + { + try + { + CheckBox chkb = (CheckBox)row.FindControl("chkSelected"); + // aggiungo SE CHECKED il job alla lista... + if (chkb.Checked) + { + currJob = new jobData(); + Label lblJob = (Label)row.FindControl("lblJobId"); + int jobId = 0; + int.TryParse(lblJob.Text, out jobId); + currJob.jobId = jobId; + currJob.jobCode = "J" + jobId.ToString("D9"); + al.Add(currJob); + } + } + catch + { } + } + // salvo in sessione arrayList utente... + string jsonData = JsonConvert.SerializeObject(al); + memLayer.ML.setSessionVal("jobSelection", jsonData); + raiseEvent(); } } } \ No newline at end of file diff --git a/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx b/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx index b99a2e7..a73ddce 100644 --- a/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx +++ b/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx @@ -6,18 +6,22 @@

Plot page

- Plot Type +
+ Plot Type - Num Columns +
+
+ Num Columns +
diff --git a/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx.cs b/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx.cs index cef891d..3b368ed 100644 --- a/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx.cs +++ b/INTERFACE/WebLCP/WUC/mod_showSvgList.ascx.cs @@ -6,17 +6,27 @@ namespace WebLCP.WUC { protected void Page_Load(object sender, EventArgs e) { + mod_jobsList.eh_doRefresh += Mod_jobsList_eh_doRefresh; + } + private void Mod_jobsList_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); + } + + private void doUpdate() + { + repPlots.DataBind(); } protected void ddlNumCol_SelectedIndexChanged(object sender, EventArgs e) { - repPlots.DataBind(); + doUpdate(); } protected void ddlType_SelectedIndexChanged(object sender, EventArgs e) { - repPlots.DataBind(); + doUpdate(); } } } \ No newline at end of file diff --git a/INTERFACE/WebLCP/dataLayer.cs b/INTERFACE/WebLCP/dataLayer.cs index 4ccf949..c6cf5a9 100644 --- a/INTERFACE/WebLCP/dataLayer.cs +++ b/INTERFACE/WebLCP/dataLayer.cs @@ -1,4 +1,5 @@ -using SteamWare; +using Newtonsoft.Json; +using SteamWare; using System; using System.Collections; @@ -198,51 +199,21 @@ namespace WebLCP public static ICollection getSelectedJobs() { ArrayList al = new ArrayList(); - plotData currPlot = new plotData(); - currPlot.path = "~/results/J000000042/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 42; - currPlot.jobCode = "J000000042"; - al.Add(currPlot); - currPlot.path = "~/results/J000000043/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 43; - currPlot.jobCode = "J000000043"; - al.Add(currPlot); - currPlot.path = "~/results/J000000044/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 44; - currPlot.jobCode = "J000000044"; - al.Add(currPlot); - currPlot.path = "~/results/J000000045/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 45; - currPlot.jobCode = "J000000045"; - al.Add(currPlot); - currPlot.path = "~/results/J000000042/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 42; - currPlot.jobCode = "J000000042"; - al.Add(currPlot); - currPlot.path = "~/results/J000000043/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 43; - currPlot.jobCode = "J000000043"; - al.Add(currPlot); - currPlot.path = "~/results/J000000044/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 44; - currPlot.jobCode = "J000000044"; - al.Add(currPlot); - currPlot.path = "~/results/J000000045/DensityPlots_Un-adjusted.svg"; - currPlot.jobId = 45; - currPlot.jobCode = "J000000045"; - al.Add(currPlot); + string rawdata = memLayer.ML.StringSessionObj("jobSelection"); + if (rawdata != "") + { + al = JsonConvert.DeserializeObject(rawdata); + } + // restituisco array! return al; } - - } /// /// Classe oggetto plot /// - public class plotData + public class jobData { public int jobId { get; set; } public string jobCode { get; set; } - public string path { get; set; } } } \ No newline at end of file