Test ok con selezione PLOT
This commit is contained in:
@@ -14,14 +14,21 @@
|
||||
<asp:CheckBox runat="server" ID="chkToggle" AutoPostBack="True" OnCheckedChanged="chkToggle_CheckedChanged" Visible='<%# selectMode %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelected" Visible='<%# selectMode %>' />
|
||||
<asp:HiddenField runat="server" ID="hfJobId" Value='<%# Eval("JobId") %>' />
|
||||
<asp:CheckBox runat="server" ID="chkSelected" AutoPostBack="True" Visible='<%# selectMode %>' OnCheckedChanged="chkSelected_CheckedChanged" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="JobId" HeaderText="#" SortExpression="JobId" />
|
||||
<asp:TemplateField HeaderText="Sent" SortExpression="dtSubmiss">
|
||||
<asp:TemplateField HeaderText="#" SortExpression="JobId">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldtSubmiss" runat="server" Text='<%# Eval("dtSubmiss") %>' />
|
||||
<asp:Label ID="lblJobId" runat="server" Text='<%# Eval("JobId") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sent" SortExpression="dtSubmiss">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="lblName" runat="server" Text="Name" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<b><asp:Label ID="lblJobDescr" runat="server" Text='<%# Eval("JobDescr") %>' /></b><br />
|
||||
<asp:Label ID="lbldtSubmiss" runat="server" Text='<%# Eval("dtSubmiss","{0:yyyy-MM-dd HH:mm:ss}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Status" SortExpression="JsDescr">
|
||||
@@ -29,16 +36,8 @@
|
||||
<asp:Label ID="lblStatus" runat="server" Text="Status" Visible='<%# !selectMode %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblJsDescr" runat="server" Text='<%# Eval("JsDescr") %>' Visible='<%# !selectMode %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="JobDescr" HeaderText="Description" SortExpression="JobDescr" />
|
||||
<asp:TemplateField HeaderText="Completed" SortExpression="dtEndProc">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="lblCompleted" runat="server" Text="Completed" Visible='<%# !selectMode %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDtEndProc" runat="server" Text='<%# Eval("dtEndProc") %>' Visible='<%# !selectMode %>' />
|
||||
<b><asp:Label ID="lblJsDescr" runat="server" Text='<%# Eval("JsDescr") %>' Visible='<%# !selectMode %>' /></b><br />
|
||||
<asp:Label ID="lblDtEndProc" runat="server" Text='<%# Eval("dtEndProc","{0:yyyy-MM-dd HH:mm:ss}") %>' Visible='<%# !selectMode %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Output">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,22 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 col-lg-2">
|
||||
<h2>Plot page</h2>
|
||||
Plot Type
|
||||
<div class="my-2">
|
||||
Plot Type
|
||||
<asp:DropDownList runat="server" ID="ddlType" CssClass="form-control form-control-sm" AutoPostBack="true" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
|
||||
<asp:ListItem Text="Scatter Plot" Value="ScatterPlots"></asp:ListItem>
|
||||
<asp:ListItem Text="Density Plot" Value="DensityPlots"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
Num Columns
|
||||
</div>
|
||||
<div class="my-2">
|
||||
Num Columns
|
||||
<asp:DropDownList runat="server" ID="ddlNumCol" CssClass="form-control form-control-sm" AutoPostBack="true" OnSelectedIndexChanged="ddlNumCol_SelectedIndexChanged">
|
||||
<asp:ListItem Text="2" Value="col-6"></asp:ListItem>
|
||||
<asp:ListItem Text="3" Value="col-4" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="4" Value="col-3"></asp:ListItem>
|
||||
<asp:ListItem Text="6" Value="col-2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div style="font-size: .6em">
|
||||
<uc1:mod_jobsList runat="server" ID="mod_jobsList" selectMode="true" />
|
||||
</div>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<ArrayList>(rawdata);
|
||||
}
|
||||
// restituisco array!
|
||||
return al;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Classe oggetto plot
|
||||
/// </summary>
|
||||
public class plotData
|
||||
public class jobData
|
||||
{
|
||||
public int jobId { get; set; }
|
||||
public string jobCode { get; set; }
|
||||
public string path { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user