prima versione edit commenti (abilitati)
This commit is contained in:
@@ -1,52 +1,54 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commenti.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_commenti" %>
|
||||
|
||||
|
||||
<div data-role="content">
|
||||
<asp:Label runat="server" ID="lblNumGG" Text="Commenti da mostrare" AssociatedControlID="rblPageSize" />
|
||||
<fieldset data-role="controlgroup" data-type="horizontal">
|
||||
<asp:RadioButtonList ID="rblPageSize" runat="server" RepeatDirection="Horizontal" AutoPostBack="true">
|
||||
<asp:ListItem Text="5" Value="5" Selected="True" />
|
||||
<asp:ListItem Text="10" Value="10" />
|
||||
<asp:ListItem Text="25" Value="25" />
|
||||
<asp:ListItem Text="50" Value="50" />
|
||||
</asp:RadioButtonList>
|
||||
</fieldset>
|
||||
<ul data-role="listview" data-inset="true">
|
||||
<asp:Repeater ID="repComm" runat="server" DataSourceID="odsComm">
|
||||
<ItemTemplate>
|
||||
<li>
|
||||
<div class="divSx">
|
||||
<asp:ImageButton runat="server" ID="btnEdit" ImageUrl="~/images/edit_l.png" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnEdit_Click" Visible='<%# enableEdit %>' />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:ImageButton runat="server" ID="btnDel" ImageUrl="~/images/elimina_l.png" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnDel_Click" Visible='<%# enableEdit %>' />
|
||||
</div>
|
||||
<div style="font-size: smaller;">
|
||||
<div>
|
||||
<div class="divSx" style="font-size: x-small;">
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Operatore", "<b>{0}</b>") %>' ForeColor="#ACACAC" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv">
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Value") %>' Font-Bold="false" />
|
||||
</div>
|
||||
<div class="clearDiv" style="font-size: xx-small; border-top: 1px solid #ACACAC; color: #ACACAC">
|
||||
<div class="divSx">
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Eval("InizioStato", "{0:dd/MM/yyyy HH:mm:ss}") %>' Font-Bold="false" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CodArticolo") %>' Font-Bold="false" />
|
||||
<asp:Label runat="server" ID="Label2" Text='<%# Eval("idxODL","ODL{0}") %>' Font-Bold="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv"></div>
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</ul>
|
||||
<asp:Label runat="server" ID="lblNumGG" Text="# Commenti" AssociatedControlID="rblPageSize" />
|
||||
<asp:RadioButtonList ID="rblPageSize" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" CssClass="p-0">
|
||||
<asp:ListItem class="p-1 btn btn-primary" Text="5" Value="5" Selected="True" />
|
||||
<asp:ListItem class="p-1 btn btn-primary" Text="10" Value="10" />
|
||||
<asp:ListItem class="p-1 btn btn-primary" Text="25" Value="25" />
|
||||
<asp:ListItem class="p-1 btn btn-primary" Text="50" Value="50" />
|
||||
</asp:RadioButtonList>
|
||||
|
||||
<div class="d-flex flex-wrap">
|
||||
<asp:Repeater ID="repComm" runat="server" DataSourceID="odsComm">
|
||||
<ItemTemplate>
|
||||
<div class="my-1 ml-0 mr-1 p-0">
|
||||
<div class="card text-white dichBlock rCAll" style="min-width: 10rem;">
|
||||
<div class='card-title py-0 px-2 mb-0 rCTop bg-dark '>
|
||||
<b style="font-size: 1.1em;">
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Operatore", "<b>{0}</b>") %>' />
|
||||
</b>
|
||||
</div>
|
||||
<div class="card-text p-1 d-flex align-items-end">
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Value") %>' Font-Bold="false" />
|
||||
</div>
|
||||
<div class="card-text p-1 d-flex align-items-end">
|
||||
<div class="labelBottom text-left p-0">
|
||||
<asp:LinkButton runat="server" ID="lbtEdit" CommandArgument='<%# Eval("InizioStato") %>' OnClick="lbtEdit_Click" Visible='<%# enableEdit %>' CssClass="btn btn-sm btn-primary"><i class="fa fa-2x fa-edit"></i></asp:LinkButton>
|
||||
</div>
|
||||
<div class="labelBottom text-right p-0">
|
||||
<asp:LinkButton runat="server" ID="lbtDel" CommandArgument='<%# Eval("InizioStato") %>' OnClick="lbtDel_Click" Visible='<%# enableEdit %>' CssClass="btn btn-sm btn-danger"><i class="fa fa-2x fa-trash"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text p-1 d-flex align-items-end rCBot" style="font-size: 0.8em; border-top: 1px solid #ACACAC; color: #ACACAC">
|
||||
<div class="labelBottom text-left p-0">
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Eval("InizioStato", "{0:dd/MM/yyyy HH:mm:ss}") %>' Font-Bold="false" />
|
||||
</div>
|
||||
<div class="labelBottom text-right p-0">
|
||||
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CodArticolo") %>' Font-Bold="false" />
|
||||
<asp:Label runat="server" ID="Label2" Text='<%# Eval("idxODL","ODL{0}") %>' Font-Bold="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
<asp:ObjectDataSource ID="odsComm" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.CommentiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
|
||||
<asp:ControlParameter ControlID="rblPageSize" DefaultValue="10" Name="showMax" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
|
||||
<asp:ControlParameter ControlID="rblPageSize" DefaultValue="10" Name="showMax" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,75 +6,61 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_commenti : System.Web.UI.UserControl
|
||||
public partial class mod_commenti : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// registrata richiesta
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqEdit;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
/// <summary>
|
||||
/// registrata richiesta
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqEdit;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// abilitazione edit commenti
|
||||
/// </summary>
|
||||
public bool enableEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadBool("commEnableEditDel");
|
||||
}
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
repComm.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// carico x edit commento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
ImageButton imgBtn = (ImageButton)sender;
|
||||
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
||||
memLayer.ML.setSessionVal("inizioStato", inizioStato);
|
||||
// sollevo evento!
|
||||
if (eh_reqEdit != null)
|
||||
{
|
||||
eh_reqEdit(this, new EventArgs());
|
||||
}
|
||||
|
||||
|
||||
//string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
|
||||
//DS_applicazione.EventListRow riga = null;
|
||||
//try
|
||||
//{
|
||||
// riga = DataLayer.obj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
|
||||
//txtDate.Text = riga.InizioStato.ToString("yyyy-MM-dd");
|
||||
//txtTime.Text = riga.InizioStato.ToString("HH:mm");
|
||||
//txtCommento.Text = riga.Value;
|
||||
//}
|
||||
//catch
|
||||
//{ }
|
||||
//fixPanels(false, true, false);
|
||||
}
|
||||
/// <summary>
|
||||
/// elimina commento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDel_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
ImageButton imgBtn = (ImageButton)sender;
|
||||
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
||||
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
|
||||
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, inizioStato);
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// abilitazione edit commenti
|
||||
/// </summary>
|
||||
public bool enableEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadBool("commEnableEditDel");
|
||||
}
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
repComm.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// carico x edit commento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
LinkButton imgBtn = (LinkButton)sender;
|
||||
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
||||
memLayer.ML.setSessionVal("inizioStato", inizioStato);
|
||||
// sollevo evento!
|
||||
if (eh_reqEdit != null)
|
||||
{
|
||||
eh_reqEdit(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// elimina commento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
LinkButton imgBtn = (LinkButton)sender;
|
||||
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
||||
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
|
||||
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, inizioStato);
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-21
@@ -1,51 +1,50 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
namespace MoonProTablet.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_commenti {
|
||||
|
||||
/// <summary>
|
||||
/// lblNumGG control.
|
||||
/// Controllo lblNumGG.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumGG;
|
||||
|
||||
/// <summary>
|
||||
/// rblPageSize control.
|
||||
/// Controllo rblPageSize.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rblPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// repComm control.
|
||||
/// Controllo repComm.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repComm;
|
||||
|
||||
/// <summary>
|
||||
/// odsComm control.
|
||||
/// Controllo odsComm.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsComm;
|
||||
}
|
||||
|
||||
@@ -39,16 +39,17 @@
|
||||
<ItemTemplate>
|
||||
<div class="my-1 ml-0 mr-1 p-0">
|
||||
<asp:LinkButton runat="server" ID="btnEdit" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnEdit_Click">
|
||||
<div class="card text-white dichBlock rCAll" style="min-width: 10rem;">
|
||||
<div class="card text-white dichBlock rCAll" style="min-width: 9rem;">
|
||||
<div class='card-title p-2 mb-0 rCTop <%# Eval("Semaforo") %>'>
|
||||
<h4>
|
||||
<asp:Label ID="lblStato" runat="server" Text='<%# Eval("Stato", "<b>{0}</b>") %>' /></h4>
|
||||
<h6 class="text-right ml-auto">
|
||||
<b style="font-size: 1.3em;">
|
||||
<asp:Label ID="lblStato" runat="server" Text='<%# Eval("Stato", "<b>{0}</b>") %>' />
|
||||
</b>
|
||||
<div class="text-right ml-auto" style="font-size: 1.1em;">
|
||||
<asp:Label runat="server" ID="lblCodArticolo" Text='<%# Eval("CodArticolo") %>' />
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text p-0 d-flex align-items-end rCBot">
|
||||
<div class="labelBottom text-left p-2">
|
||||
<div class="card-text p-0 d-flex align-items-end rCBot" style="font-size: 0.8em;">
|
||||
<div class="labelBottom text-left p-1">
|
||||
<asp:Label ID="lblInizioStato" runat="server" Text='<%# Eval("InizioStato", "{0:dd/MM/yyyy HH:mm}") %>' />
|
||||
</div>
|
||||
<div class="labelBottom text-right p-1">
|
||||
@@ -56,11 +57,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
<asp:ObjectDataSource ID="odsFerm" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.FermiNonQualTableAdapter">
|
||||
</asp:LinkButton></div></ItemTemplate></asp:Repeater><asp:ObjectDataSource ID="odsFerm" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.FermiNonQualTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
|
||||
<asp:ControlParameter ControlID="ddlPrevDays" DefaultValue="3" Name="gg" PropertyName="SelectedValue" Type="Int32" />
|
||||
|
||||
Reference in New Issue
Block a user