Aggiunta area A4 + webUserCOntrols e WebMasterPages
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_TagCloudProgetti.ascx.cs" Inherits="GPW.WebUserControls.mod_TagCloudProgetti" %>
|
||||
<div style="text-align: center; margin: auto; font-size: 9pt;">
|
||||
<asp:RadioButtonList ID="rblOre" runat="server" CssClass="radioBtn" RepeatLayout="Flow" RepeatDirection="Horizontal"
|
||||
RepeatColumns="8" AutoPostBack="true" OnSelectedIndexChanged="rblOre_SelectedIndexChanged">
|
||||
<asp:ListItem Text="ult." Value="0"></asp:ListItem>
|
||||
<asp:ListItem Text="15'" Value="15"></asp:ListItem>
|
||||
<asp:ListItem Text="30'" Value="30"></asp:ListItem>
|
||||
<asp:ListItem Text="1 h" Value="60" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="2 h" Value="120"></asp:ListItem>
|
||||
<asp:ListItem Text="3 h" Value="180"></asp:ListItem>
|
||||
<asp:ListItem Text="4 h" Value="240"></asp:ListItem>
|
||||
<asp:ListItem Text="8 h" Value="480"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div id="tagCloud">
|
||||
<asp:Repeater ID="repTagCloud" runat="server" DataSourceID="ods">
|
||||
<ItemTemplate>
|
||||
<%--Modo standard: tag cloud--%>
|
||||
<span id="Standard" runat="server" visible='<%# modo == GPW.WebUserControls.TagCloudMode.standard %>'>
|
||||
<asp:LinkButton runat="server" ID="lnkTag" CssClass='<%# tagClass(Eval("freq")) %>' ToolTip='<%# Eval("nomeComm") + " | " + Eval("nomeFase") %>' OnClick="lnkTag_Click">
|
||||
<%# Eval("nomeProj") %>
|
||||
</asp:LinkButton>
|
||||
</span>
|
||||
<%--Modo piramide--%>
|
||||
<span id="Piramide" runat="server" visible='<%# modo == GPW.WebUserControls.TagCloudMode.piramide %>'>
|
||||
<asp:LinkButton runat="server" ID="LinkButton1" ToolTip='<%# Eval("nomeProj") %>' CommandArgument='<%# Eval("idxFase") %>' OnClick="lnkTag_Click" CssClass='<%# tagClassPiram(Eval("RowNum")) %>'>
|
||||
<%# "[" + Eval("nomeComm") + "] " + Eval("nomeFase") %>
|
||||
</asp:LinkButton>
|
||||
</span>
|
||||
<%--Modo elenco--%>
|
||||
<div id="Elenco" runat="server" visible='<%# modo == GPW.WebUserControls.TagCloudMode.elenco %>'>
|
||||
<asp:LinkButton runat="server" ID="LinkButton2" CssClass='<%# tagClassElenco(Eval("RowNum")) %>' CommandArgument='<%# Eval("idxFase") %>' OnClick="lnkTag_Click" ToolTip='<%# Eval("nomeComm") + " | " + Eval("nomeFase") + " | " + Eval("Qty","{0:N1} h") + " | " + Eval("freq","{0:P1}") %>'>
|
||||
<%# Eval("RowNum","{0:00}") + ") " + Eval("nomeProj").ToString().ToUpper() + " | " + Eval("nomeComm") + " | " + Eval("nomeFase") %>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<%--Modo elencoCPF--%>
|
||||
<div id="ElencoCPF" runat="server" visible='<%# modo == GPW.WebUserControls.TagCloudMode.elencoCPF %>'>
|
||||
<asp:LinkButton runat="server" ID="LinkButton3" CssClass='<%# tagClassElenco(Eval("RowNum")) %>' CommandArgument='<%# Eval("idxFase") %>' OnClick="lnkTag_Click" ToolTip='<%# Eval("nomeComm") + " | " + Eval("nomeFase") + " | " + Eval("Qty","{0:N1} h") %>'>
|
||||
<%# Eval("RowNum","{0:00}") + ") " + Eval("nomeComm") + " | " + Eval("nomeProj") + " | " + Eval("nomeFase") %>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<div>
|
||||
<div class="divSx" style="font-size: 0.7em;">
|
||||
<asp:DropDownList runat="server" ID="ddlModoTag" AutoPostBack="true" OnSelectedIndexChanged="ddlModoTag_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True">elenco</asp:ListItem>
|
||||
<asp:ListItem>elencoCPF</asp:ListItem>
|
||||
<asp:ListItem>piramide</asp:ListItem>
|
||||
<asp:ListItem>standard</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="divDx" style="font-size: 0.7em;">
|
||||
<asp:DropDownList runat="server" ID="ddlPageSize" AutoPostBack="true" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<asp:ListItem>5</asp:ListItem>
|
||||
<asp:ListItem Selected="True">10</asp:ListItem>
|
||||
<asp:ListItem>15</asp:ListItem>
|
||||
<asp:ListItem>20</asp:ListItem>
|
||||
<asp:ListItem>25</asp:ListItem>
|
||||
<asp:ListItem>30</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv"></div>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.freqProgettiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="idxDipendente" SessionField="idxDipCurr" Type="Int32" />
|
||||
<asp:SessionParameter DefaultValue="" Name="inizio" SessionField="_inizio" Type="DateTime" />
|
||||
<asp:SessionParameter Name="fine" SessionField="_fine" Type="DateTime" />
|
||||
<%--<asp:Parameter DefaultValue="20" Name="maxRes" Type="Int32" />--%>
|
||||
<asp:ControlParameter ControlID="ddlPageSize" PropertyName="SelectedValue" Name="maxRes" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -0,0 +1,282 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using GPW_data;
|
||||
using SteamWare;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_TagCloudProgetti : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// evento selezione valore tag
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
/// <summary>
|
||||
/// evento refresh numero items
|
||||
/// </summary>
|
||||
public event EventHandler eh_refresh;
|
||||
/// <summary>
|
||||
/// data di riferimento per controllo
|
||||
/// </summary>
|
||||
public DateTime dataRif {
|
||||
get
|
||||
{
|
||||
return Convert.ToDateTime(memLayer.ML.StringSessionObj("dataRifTC"));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataRifTC",value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// load pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// se vuoto lo imposto...
|
||||
if (!memLayer.ML.isInSessionObject("TagCloudMode"))
|
||||
{
|
||||
modo = TagCloudMode.standard;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// calcola calsse css data freq ripetizione
|
||||
/// </summary>
|
||||
/// <param name="freq"></param>
|
||||
/// <returns></returns>
|
||||
public string tagClass(object _freq)
|
||||
{
|
||||
string answ = "";
|
||||
double freq = Convert.ToDouble(_freq);
|
||||
if (freq > 0.25)
|
||||
{
|
||||
answ = "w1";
|
||||
}
|
||||
else if (freq > 0.16)
|
||||
{
|
||||
answ = "w2";
|
||||
}
|
||||
else if (freq > 0.1)
|
||||
{
|
||||
answ = "w3";
|
||||
}
|
||||
else if (freq > 0.05)
|
||||
{
|
||||
answ = "w4";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "w5";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola calsse css data posizione in elenco
|
||||
/// </summary>
|
||||
/// <param name="posiz"></param>
|
||||
/// <returns></returns>
|
||||
public string tagClassElenco(object _posiz)
|
||||
{
|
||||
string answ = "";
|
||||
int posiz = Convert.ToInt32(_posiz);
|
||||
if (posiz <= 1)
|
||||
{
|
||||
answ = "e1";
|
||||
}
|
||||
else if (posiz <= 3)
|
||||
{
|
||||
answ = "e2";
|
||||
}
|
||||
else if (posiz <= 6)
|
||||
{
|
||||
answ = "e3";
|
||||
}
|
||||
else if (posiz <= 10)
|
||||
{
|
||||
answ = "e4";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "e5";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola calsse css data posizione in piramide
|
||||
/// </summary>
|
||||
/// <param name="posiz"></param>
|
||||
/// <returns></returns>
|
||||
public string tagClassPiram(object _posiz)
|
||||
{
|
||||
string answ = "";
|
||||
int posiz = Convert.ToInt32(_posiz);
|
||||
if (posiz == 1)
|
||||
{
|
||||
answ = "p1";
|
||||
}
|
||||
else if (posiz <= 3)
|
||||
{
|
||||
answ = "p2";
|
||||
}
|
||||
else if (posiz <= 6)
|
||||
{
|
||||
answ = "p3";
|
||||
}
|
||||
else if (posiz <= 10)
|
||||
{
|
||||
answ = "p4";
|
||||
}
|
||||
else if (posiz <= 15)
|
||||
{
|
||||
answ = "p5";
|
||||
}
|
||||
else if (posiz <= 21)
|
||||
{
|
||||
answ = "p6";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "p7";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// crea una nuova attività dal tag indicato
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkTag_Click(object sender, EventArgs e)
|
||||
{
|
||||
// variabili!
|
||||
int idxDipCurr = memLayer.ML.IntSessionObj("idxDipCurr");
|
||||
// inizia con dataRif = 8 del mattino
|
||||
DateTime inizio = dataRif.Date.AddHours(8);
|
||||
int idxFase = 0;
|
||||
// leggo valore fase
|
||||
LinkButton lbtn = (LinkButton)sender;
|
||||
try
|
||||
{
|
||||
idxFase = Convert.ToInt32(lbtn.CommandArgument);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiamo clona!
|
||||
int minuti = 0;
|
||||
try
|
||||
{
|
||||
minuti = Convert.ToInt32(rblOre.SelectedValue);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
DataProxy.DP.taRA.clonaLastRA_byFaseUtente(idxDipCurr, inizio, idxFase, minuti);
|
||||
repTagCloud.DataBind();
|
||||
// riporto evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// evento selezione nuovo valore durata
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void rblOre_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo il valore scelto
|
||||
memLayer.ML.setSessionVal("stdMinDurata", rblOre.SelectedValue);
|
||||
repTagCloud.DataBind();
|
||||
// riporto evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// chiamata aggiornamento controllo
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
repTagCloud.DataBind();
|
||||
}
|
||||
|
||||
public TagCloudMode modo
|
||||
{
|
||||
get
|
||||
{
|
||||
return (TagCloudMode)memLayer.ML.objSessionObj("TagCloudMode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("TagCloudMode", value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// riporto evento!
|
||||
if (eh_refresh!= null)
|
||||
{
|
||||
eh_refresh(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlModoTag_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// cambio modo!
|
||||
switch (ddlModoTag.SelectedValue)
|
||||
{
|
||||
case "elenco":
|
||||
modo = TagCloudMode.elenco;
|
||||
break;
|
||||
case "elencoCPF":
|
||||
modo = TagCloudMode.elencoCPF;
|
||||
break;
|
||||
case "piramide":
|
||||
modo = TagCloudMode.piramide;
|
||||
break;
|
||||
case "standard":
|
||||
modo = TagCloudMode.standard;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
repTagCloud.DataBind();
|
||||
// riporto evento!
|
||||
if (eh_refresh != null)
|
||||
{
|
||||
eh_refresh(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum TagCloudMode
|
||||
{
|
||||
/// <summary>
|
||||
/// modalità elenco (con codice colore) standard (Progetto-Fase-Sottofase)
|
||||
/// </summary>
|
||||
elenco,
|
||||
/// <summary>
|
||||
/// modalità elenco Commessa-Progetto-Fase (con codice colore)
|
||||
/// </summary>
|
||||
elencoCPF,
|
||||
/// <summary>
|
||||
/// modalità piramide 1 | 2-2 | 3-3-3 | 4-4-4-4 | ...
|
||||
/// </summary>
|
||||
piramide,
|
||||
/// <summary>
|
||||
/// modalità normale
|
||||
/// </summary>
|
||||
standard
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_TagCloudProgetti {
|
||||
|
||||
/// <summary>
|
||||
/// rblOre control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rblOre;
|
||||
|
||||
/// <summary>
|
||||
/// repTagCloud control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repTagCloud;
|
||||
|
||||
/// <summary>
|
||||
/// ddlModoTag control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlModoTag;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_adminClienti.ascx.cs" Inherits="GPW.WebUserControls.mod_adminClienti" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="fontPiccolo">
|
||||
<asp:GridView ID="grView" runat="server" AllowSorting="true" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
|
||||
DataKeyNames="idxCliente" DataSourceID="ods" ForeColor="#333333" GridLines="None" Width="100%" OnDataBound="grView_DataBound">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'
|
||||
ImageUrl="../images/view_s.png" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'
|
||||
ImageUrl="../images/edit_s.png" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>'
|
||||
ImageUrl="../images/apply_s.png" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'
|
||||
ImageUrl="../images/new_s.png" OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click"
|
||||
ImageUrl="../images/reload_l.png" Visible="true" ImageAlign="AbsBottom" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="RagSociale" SortExpression="RagSociale">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRagSociale" runat="server" Text='<%# Eval("RagSociale") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtRagSociale" runat="server" Text='<%# Bind("RagSociale") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtRagSociale" runat="server" Text='<%# Bind("RagSociale") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="indirizzo" SortExpression="indirizzo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblindirizzo" runat="server" Text='<%# Eval("indirizzo") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtindirizzo" runat="server" Text='<%# Bind("indirizzo") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtindirizzo" runat="server" Text='<%# Bind("indirizzo") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="CAP" SortExpression="CAP">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCAP" runat="server" Text='<%# Eval("CAP") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtCAP" runat="server" Text='<%# Bind("CAP") %>' Width="4em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtCAP" runat="server" Text='<%# Bind("CAP") %>' Width="4em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="citta" SortExpression="citta">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcitta" runat="server" Text='<%# Eval("citta") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtcitta" runat="server" Text='<%# Bind("citta") %>' Width="6em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtcitta" runat="server" Text='<%# Bind("citta") %>' Width="6em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="prov" SortExpression="prov">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblprov" runat="server" Text='<%# Eval("prov") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtprov" runat="server" Text='<%# Bind("prov") %>' Width="2em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtprov" runat="server" Text='<%# Bind("prov") %>' Width="2em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="tel" SortExpression="tel">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbltel" runat="server" Text='<%# Eval("tel") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txttel" runat="server" Text='<%# Bind("tel") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txttel" runat="server" Text='<%# Bind("tel") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="email" SortExpression="email">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblemail" runat="server" Text='<%# Eval("email") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtemail" runat="server" Text='<%# Bind("email") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtemail" runat="server" Text='<%# Bind("email") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="pIva" SortExpression="pIva">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblpIva" runat="server" Text='<%# Eval("pIva") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtpIva" runat="server" Text='<%# Bind("pIva") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtpIva" runat="server" Text='<%# Bind("pIva") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="CF" SortExpression="CF">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCF" runat="server" Text='<%# Eval("CF") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtCF" runat="server" Text='<%# Bind("CF") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtCF" runat="server" Text='<%# Bind("CF") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="nota" SortExpression="nota">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnota" runat="server" Text='<%# Eval("nota") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtnota" runat="server" Text='<%# Bind("nota") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtnota" runat="server" Text='<%# Bind("nota") %>' />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxCliente") %>' CommandName="Delete"
|
||||
ImageUrl="../images/elimina_s.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("idxCliente")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="../images/apply_s.png"
|
||||
ToolTip='<%# traduci("Update")%>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert" ImageUrl="../images/new_s.png"
|
||||
OnClick="lblIns_click" ToolTip='<%# traduci("Insert") %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' Visible='<%# chkLicOk %>' CssClass="btnNew" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<SortedAscendingCellStyle BackColor="#F5F7FB"></SortedAscendingCellStyle>
|
||||
<SortedAscendingHeaderStyle BackColor="#6D95E1"></SortedAscendingHeaderStyle>
|
||||
<SortedDescendingCellStyle BackColor="#E9EBEF"></SortedDescendingCellStyle>
|
||||
<SortedDescendingHeaderStyle BackColor="#4870BE"></SortedDescendingHeaderStyle>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" DeleteMethod="deleteQuery" InsertMethod="insertQuery"
|
||||
OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagClientiTableAdapter"
|
||||
UpdateMethod="updateQuery"
|
||||
FilterExpression=" (RagSociale like '%{0}%') OR (indirizzo like '%{0}%') OR (citta like '%{0}%') OR (url like '%{0}%') OR (email like '%{0}%') OR (nota like '%{0}%') "
|
||||
onupdating="ods_Updating">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreCercato" Type="String" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxCliente" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="RagSociale" Type="String" />
|
||||
<asp:Parameter Name="indirizzo" Type="String" />
|
||||
<asp:Parameter Name="CAP" Type="String" />
|
||||
<asp:Parameter Name="citta" Type="String" />
|
||||
<asp:Parameter Name="prov" Type="String" />
|
||||
<asp:Parameter Name="tel" Type="String" />
|
||||
<asp:Parameter Name="email" Type="String" />
|
||||
<asp:Parameter Name="pIva" Type="String" />
|
||||
<asp:Parameter Name="CF" Type="String" />
|
||||
<asp:Parameter Name="nota" Type="String" />
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Original_idxCliente" Type="Int32" />
|
||||
<asp:Parameter Name="RagSociale" Type="String" />
|
||||
<asp:Parameter Name="indirizzo" Type="String" />
|
||||
<asp:Parameter Name="CAP" Type="String" />
|
||||
<asp:Parameter Name="citta" Type="String" />
|
||||
<asp:Parameter Name="prov" Type="String" />
|
||||
<asp:Parameter Name="tel" Type="String" />
|
||||
<asp:Parameter Name="url" Type="String" />
|
||||
<asp:Parameter Name="email" Type="String" />
|
||||
<asp:Parameter Name="pIva" Type="String" />
|
||||
<asp:Parameter Name="CF" Type="String" />
|
||||
<asp:Parameter Name="logoUrl" Type="String" />
|
||||
<asp:Parameter Name="nota" Type="String" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
</div>
|
||||
@@ -0,0 +1,257 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_adminClienti : System.Web.UI.UserControl
|
||||
{
|
||||
#region area standard (non modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area CUSTOM (da modificare)
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Applicazione.AnagClientiDataTable tabella = new DS_Applicazione.AnagClientiDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object idxObj)
|
||||
{
|
||||
bool answ = true;
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (answ)
|
||||
{
|
||||
int trovati = 0;
|
||||
// !!!FARE!!!
|
||||
#if false
|
||||
// controllo se ci siano tipo celle associate
|
||||
trovati = MagClass.magazzino.taTipoCella.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
// controllo se ci siano blocchi associati
|
||||
trovati = trovati + MagClass.magazzino.taBlocchi.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
#endif
|
||||
// controllo se ci sono record correlati...
|
||||
if (trovati > 0)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo stato licenze!
|
||||
/// </summary>
|
||||
public bool chkLicOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return (licenzeGPW.checkLicenze);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_adminClienti {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_adminDipendenti.ascx.cs" Inherits="GPW.WebUserControls.mod_adminDipendenti" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="fontPiccolo">
|
||||
<asp:GridView ID="grView" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
|
||||
DataKeyNames="idxDipendente" DataSourceID="ods" ForeColor="#333333" GridLines="None" Width="100%" OnDataBound="grView_DataBound">
|
||||
<AlternatingRowStyle BackColor="White" />
|
||||
<EditRowStyle BackColor="#2461BF" />
|
||||
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
|
||||
<RowStyle BackColor="#EFF3FB" />
|
||||
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle BackColor="#F5F7FB" />
|
||||
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
|
||||
<SortedDescendingCellStyle BackColor="#E9EBEF" />
|
||||
<SortedDescendingHeaderStyle BackColor="#4870BE" />
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'
|
||||
ImageUrl="../images/view_s.png" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'
|
||||
ImageUrl="../images/edit_s.png" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>'
|
||||
ImageUrl="../images/apply_s.png" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'
|
||||
ImageUrl="../images/new_s.png" OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click"
|
||||
ImageUrl="../images/reload_l.png" Visible="true" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="Cognome" SortExpression="Cognome">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCognome" runat="server" Text='<%# Eval("Cognome") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtCognome" runat="server" Text='<%# Bind("Cognome") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtCognome" runat="server" Text='<%# Bind("Cognome") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="Nome" SortExpression="Nome">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblNome" runat="server" Text='<%# Eval("Nome") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtNome" runat="server" Text='<%# Bind("Nome") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtNome" runat="server" Text='<%# Bind("Nome") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="matricola" SortExpression="matricola">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblmatricola" runat="server" Text='<%# Eval("matricola") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="3em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="3em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="codOrario" SortExpression="codOrario">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcodOrario" runat="server" Text='<%# Eval("codOrario") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList runat="server" ID="dlCodOrario" SelectedValue='<%# Bind("codOrario") %>' DataSourceID="odsOrario" DataTextField="label"
|
||||
DataValueField="value" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:DropDownList runat="server" ID="dlCodOrario" SelectedValue='<%# Bind("codOrario") %>' DataSourceID="odsOrario" DataTextField="label"
|
||||
DataValueField="value" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="dominio" SortExpression="dominio">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldominio" runat="server" Text='<%# Eval("dominio") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtdominio" runat="server" Text='<%# Bind("dominio") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtdominio" runat="server" Text='<%# Bind("dominio") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="utente" SortExpression="utente">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblutente" runat="server" Text='<%# Eval("utente") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtutente" runat="server" Text='<%# Bind("utente") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtutente" runat="server" Text='<%# Bind("utente") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="email" SortExpression="email">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblemail" runat="server" Text='<%# Eval("email") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtemail" runat="server" Text='<%# Bind("email") %>' Width="12em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtemail" runat="server" Text='<%# Bind("email") %>' Width="12em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="CF" SortExpression="CF">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCF" runat="server" Text='<%# Eval("CF") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtCF" runat="server" Text='<%# Bind("CF") %>' Width="10em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtCF" runat="server" Text='<%# Bind("CF") %>' Width="10em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="dataNascita" SortExpression="dataNascita">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldataNascita" runat="server" Text='<%# Eval("dataNascita","{0:dd/MM/yy}") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtdataNascita" runat="server" Text='<%# Bind("dataNascita","{0:yyyy/MM/dd}") %>' Width="6em" />
|
||||
<asp:CalendarExtender runat="server" FirstDayOfWeek="Monday" ID="ceDataNascita" TargetControlID="txtdataNascita" Format="yyyy/MM/dd" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtdataNascita" runat="server" Text='<%# Bind("dataNascita","{0:yyyy/MM/dd}") %>' Width="6em" />
|
||||
<asp:CalendarExtender runat="server" FirstDayOfWeek="Monday" ID="ceDataNascita" TargetControlID="txtdataNascita" Format="yyyy/MM/dd" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="luogoNascita" SortExpression="luogoNascita">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblluogoNascita" runat="server" Text='<%# Eval("luogoNascita") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtluogoNascita" runat="server" Text='<%# Bind("luogoNascita") %>' Width="8em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtluogoNascita" runat="server" Text='<%# Bind("luogoNascita") %>' Width="8em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="provNascita" SortExpression="provNascita">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblprovNascita" runat="server" Text='<%# Eval("provNascita") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtprovNascita" runat="server" Text='<%# Bind("provNascita") %>' Width="2em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtprovNascita" runat="server" Text='<%# Bind("provNascita") %>' Width="2em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="nazNascita" SortExpression="nazNascita">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnazNascita" runat="server" Text='<%# Eval("nazNascita") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtnazNascita" runat="server" Text='<%# Bind("nazNascita") %>' Width="2em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtnazNascita" runat="server" Text='<%# Bind("nazNascita") %>' Width="2em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="attivo" SortExpression="attivo">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkattivo" runat="server" Checked='<%# Eval("attivo") %>' Enabled="false" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="chkattivo" runat="server" Checked='<%# Bind("attivo") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:CheckBox ID="chkattivo" runat="server" Checked='<%# Bind("attivo") %>' />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxDipendente") %>' CommandName="Delete"
|
||||
ImageUrl="../images/elimina_s.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("idxDipendente")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="../images/apply_s.png"
|
||||
ToolTip='<%# traduci("Update")%>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert" ImageUrl="../images/new_s.png"
|
||||
OnClick="lblIns_click" ToolTip='<%# traduci("Insert") %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' Visible='<%# chkLicOk %>' CssClass="btnNew" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<SortedAscendingCellStyle BackColor="#F5F7FB"></SortedAscendingCellStyle>
|
||||
<SortedAscendingHeaderStyle BackColor="#6D95E1"></SortedAscendingHeaderStyle>
|
||||
<SortedDescendingCellStyle BackColor="#E9EBEF"></SortedDescendingCellStyle>
|
||||
<SortedDescendingHeaderStyle BackColor="#4870BE"></SortedDescendingHeaderStyle>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" DeleteMethod="deleteQuery" InsertMethod="insertQuery"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.DipendentiTableAdapter"
|
||||
UpdateMethod="updateQuery" FilterExpression=" (Cognome like '%{0}%') OR (Nome like '%{0}%') OR (CF like '%{0}%') OR (matricola like '%{0}%') OR (email like '%{0}%') "
|
||||
OnUpdating="ods_Updating">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreCercato" Type="String" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="matricola" Type="String" />
|
||||
<asp:Parameter Name="CF" Type="String" />
|
||||
<asp:Parameter Name="Cognome" Type="String" />
|
||||
<asp:Parameter Name="Nome" Type="String" />
|
||||
<asp:Parameter Name="dataNascita" Type="DateTime" />
|
||||
<asp:Parameter Name="luogoNascita" Type="String" />
|
||||
<asp:Parameter Name="provNascita" Type="String" />
|
||||
<asp:Parameter Name="nazNascita" Type="String" />
|
||||
<asp:Parameter Name="email" Type="String" />
|
||||
<asp:Parameter Name="dominio" Type="String" />
|
||||
<asp:Parameter Name="utente" Type="String" />
|
||||
<asp:Parameter Name="codOrario" Type="String" />
|
||||
<asp:Parameter Name="attivo" Type="Boolean" />
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="matricola" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="CF" Type="String" />
|
||||
<asp:Parameter Name="Cognome" Type="String" />
|
||||
<asp:Parameter Name="Nome" Type="String" />
|
||||
<asp:Parameter Name="dataNascita" Type="DateTime" />
|
||||
<asp:Parameter Name="luogoNascita" Type="String" />
|
||||
<asp:Parameter Name="provNascita" Type="String" />
|
||||
<asp:Parameter Name="nazNascita" Type="String" />
|
||||
<asp:Parameter Name="email" Type="String" />
|
||||
<asp:Parameter Name="dominio" Type="String" />
|
||||
<asp:Parameter Name="utente" Type="String" />
|
||||
<asp:Parameter Name="codOrario" Type="String" />
|
||||
<asp:Parameter Name="attivo" Type="Boolean" />
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="odsOrario" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selCodOrarioTableAdapter"></asp:ObjectDataSource>
|
||||
@@ -0,0 +1,261 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_adminDipendenti : System.Web.UI.UserControl
|
||||
{
|
||||
#region area standard (non modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area CUSTOM (da modificare)
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Applicazione.DipendentiDataTable tabella = new DS_Applicazione.DipendentiDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object idxObj)
|
||||
{
|
||||
bool answ = true;
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (answ)
|
||||
{
|
||||
int trovati = 0;
|
||||
// !!!FARE!!!
|
||||
#if false
|
||||
// controllo se ci siano tipo celle associate
|
||||
trovati = MagClass.magazzino.taTipoCella.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
// controllo se ci siano blocchi associati
|
||||
trovati = trovati + MagClass.magazzino.taBlocchi.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
#endif
|
||||
// controllo se ci sono record correlati...
|
||||
if (trovati > 0)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo stato licenze!
|
||||
/// </summary>
|
||||
public bool chkLicOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return (licenzeGPW.utentiAttivi < licenzeGPW.licenzeAttive);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
// attivo imposto a true!
|
||||
e.InputParameters["attivo"] = "true";
|
||||
// sistemo calendario!
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_adminDipendenti {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
|
||||
/// <summary>
|
||||
/// odsOrario control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsOrario;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_adminFasi.ascx.cs" Inherits="GPW.WebUserControls.mod_adminFasi" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="filtro_1 fontPiccolo" style="white-space: nowrap; height: 30px;">
|
||||
<div class="divSx">
|
||||
<uc1:mod_filtro ID="filtroCli" runat="server" filterChekText="filtroCliente" comboWidth="150" changeCheckVisible="false"
|
||||
isChecked="true" />
|
||||
<asp:ObjectDataSource ID="odsClienti" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selClientiTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<uc1:mod_filtro ID="filtroPrj" runat="server" filterChekText="filtroProgetto" comboWidth="200" changeCheckEnabled="false"
|
||||
changeCheckVisible="false" isChecked="true" />
|
||||
<asp:ObjectDataSource ID="odsProj" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selProgettiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="filtroCli" DefaultValue="0" PropertyName="valore" Name="conditio" Type="String" />
|
||||
<asp:Parameter DefaultValue="false" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fontPiccolo">
|
||||
<asp:GridView ID="grView" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
|
||||
DataKeyNames="idxFase" DataSourceID="ods" ForeColor="#333333" GridLines="None" Width="100%" OnDataBound="grView_DataBound"
|
||||
OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<EmptyDataTemplate>
|
||||
<asp:Button ID="btnNewEmpty" runat="server" OnClick="btnNewEmpty_Click" Text='<%# traduci("NewFase") %>' CssClass="btnNew"
|
||||
ToolTip='<%# traduci("NewFaseExpl") %>' Visible='<%# isWritable() %>' />
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'
|
||||
ImageUrl="../images/view_m.png" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'
|
||||
ImageUrl="../images/edit_m.png" Visible='<%# isWritable() %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>'
|
||||
ImageUrl="../images/apply_m.png" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_m.png" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'
|
||||
ImageUrl="../images/new_m.png" OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_m.png" />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click"
|
||||
ImageUrl="../images/reload_l.png" Visible="true" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="nomeFase" SortExpression="nomeFase">
|
||||
<ItemTemplate>
|
||||
<div class="divSx">
|
||||
<asp:Image runat="server" ID="imgSpaz" Width='<%# widthByCod(Eval("codFase")) %>' ImageUrl="~/images/EmptyImg.png" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<div style="text-align: left; padding: 2px 3px 2px 3px;" class='<%# classByCod(Eval("codFase")) %>'>
|
||||
<asp:Label ID="nomeFaseLabel" runat="server" Text='<%# Eval("nomeFase") %>' Font-Strikeout='<%# invBool(Eval("Attivo")) %>'
|
||||
Font-Bold="true" />
|
||||
</div>
|
||||
<%--<asp:Label ID="codFaseLabel" runat="server" Text='<%# Eval("codFase") %>' />--%>
|
||||
<div class="fontPiccolo textGrigio" style="text-align: left; padding: 2px 3px 2px 3px;">
|
||||
<asp:Label ID="descrizioneFaseLabel" runat="server" Text='<%# Eval("descrizioneFase") %>' />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<div class="divSx">
|
||||
<asp:Image runat="server" ID="imgSpaz" Width='<%# widthByCod(Eval("codFase")) %>' ImageUrl="~/images/EmptyImg.png" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:TextBox ID="txtnomeFase" runat="server" Text='<%# Bind("nomeFase") %>' Width="20em" />
|
||||
|
||||
<asp:TextBox ID="txtdescrizioneFase" runat="server" Text='<%# Bind("descrizioneFase") %>' Width="20em" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<div class="divSx">
|
||||
<asp:Image runat="server" ID="imgSpaz" Width='<%# widthByCod(Eval("codFase")) %>' ImageUrl="~/images/EmptyImg.png" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:TextBox ID="txtnomeFase" runat="server" Text='<%# Bind("nomeFase") %>' Width="20em" />
|
||||
|
||||
<asp:TextBox ID="txtdescrizioneFase" runat="server" Text='<%# Bind("descrizioneFase") %>' Width="20em" />
|
||||
</div>
|
||||
</FooterTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="timeTrack" SortExpression="enableTime">
|
||||
<ItemTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglTime" runat="server" TargetControlID="chkenableTime" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Time track ATTIVO" UncheckedImageAlternateText="Time track NON attivo" UncheckedImageUrl="~/images/timeDis_m.png"
|
||||
CheckedImageUrl="~/images/time_m.png" />
|
||||
<asp:CheckBox ID="chkenableTime" runat="server" Checked='<%# Eval("enableTime") %>' Enabled="false" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglTime" runat="server" TargetControlID="chkenableTime" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Time track ATTIVO" UncheckedImageAlternateText="Time track NON attivo" UncheckedImageUrl="~/images/timeDis_m.png"
|
||||
CheckedImageUrl="~/images/time_m.png" />
|
||||
<asp:CheckBox ID="chkenableTime" runat="server" Checked='<%# Bind("enableTime") %>' Enabled="true" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglTime" runat="server" TargetControlID="chkenableTime" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Time track ATTIVO" UncheckedImageAlternateText="Time track NON attivo" UncheckedImageUrl="~/images/timeDis_m.png"
|
||||
CheckedImageUrl="~/images/time_m.png" />
|
||||
<asp:CheckBox ID="chkenableTime" runat="server" Checked='<%# Bind("enableTime") %>' Enabled="true" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="moneyTrack" SortExpression="enableMoney">
|
||||
<ItemTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglMoney" runat="server" TargetControlID="chkenableMoney" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Money track ATTIVO" UncheckedImageAlternateText="Money track NON attivo" UncheckedImageUrl="~/images/moneyDis_m.png"
|
||||
CheckedImageUrl="~/images/money_m.png" />
|
||||
<asp:CheckBox ID="chkenableMoney" runat="server" Checked='<%# Eval("enableMoney") %>' Enabled="false" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglMoney" runat="server" TargetControlID="chkenableMoney" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Money track ATTIVO" UncheckedImageAlternateText="Money track NON attivo" UncheckedImageUrl="~/images/moneyDis_m.png"
|
||||
CheckedImageUrl="~/images/money_m.png" />
|
||||
<asp:CheckBox ID="chkenableMoney" runat="server" Checked='<%# Bind("enableMoney") %>' Enabled="true" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<ajaxToolkit:ToggleButtonExtender ID="tglMoney" runat="server" TargetControlID="chkenableMoney" ImageWidth="22" ImageHeight="22"
|
||||
CheckedImageAlternateText="Money track ATTIVO" UncheckedImageAlternateText="Money track NON attivo" UncheckedImageUrl="~/images/moneyDis_m.png"
|
||||
CheckedImageUrl="~/images/money_m.png" />
|
||||
<asp:CheckBox ID="chkenableMoney" runat="server" Checked='<%# Bind("enableMoney") %>' Enabled="true" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="RealVsBudgetTime" SortExpression="budgetTime" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Panel runat="server" ID="pnlTime" CssClass='<%# colorByVal(Eval("totOre"),Eval("budgetTime"))%>' Style="font-size: 8pt;
|
||||
padding: .3em;" Width="8em" Visible='<%# Bind("enableTime") %>'>
|
||||
<asp:Label ID="lblRealTime" runat="server" Text='<%# Eval("totOre","{0:#,###.##}") %>' ToolTip='<%# traduci("OreErogate") %>' />
|
||||
/
|
||||
<asp:Label ID="lblbudgetTime" runat="server" Text='<%# Eval("budgetTime","{0:#,###.##}") %>' ToolTip='<%# traduci("OreBudget") %>' />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtbudgetTime" runat="server" Text='<%# Bind("budgetTime") %>' Width="3em" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtbudgetTime" runat="server" Text='<%# Bind("budgetTime") %>' Width="3em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Attivo" SortExpression="Attivo" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkAttivo" runat="server" Checked='<%# Eval("Attivo") %>' Enabled="false" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="chkAttivo" runat="server" Checked='<%# Bind("Attivo") %>' Enabled="true" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<div class="divDx">
|
||||
<asp:ImageButton ID="imgAddNew" runat="server" CausesValidation="False" CommandName="Select" ImageUrl="../images/new_m.png"
|
||||
CommandArgument='<%# Eval("idxFase") %>' OnClick="btnNew_Click" ToolTip='<%# traduci("AddNewSubFase") %>' Visible='<%# isAncestor(Eval("idxFaseAncest")) %>' />
|
||||
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxFase") %>' CommandName="Delete"
|
||||
ImageUrl="../images/elimina_m.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("idxFase")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="../images/apply_s.png"
|
||||
ToolTip='<%# traduci("Update")%>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert" ImageUrl="../images/new_s.png"
|
||||
OnClick="lblIns_click" ToolTip='<%# traduci("Insert") %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("NewFase") %>' CssClass="btnNew" ToolTip='<%# traduci("NewFaseExpl") %>' Visible='<%# isWritable() %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<SortedAscendingCellStyle BackColor="#F8FAFA"></SortedAscendingCellStyle>
|
||||
<SortedAscendingHeaderStyle BackColor="#246B61"></SortedAscendingHeaderStyle>
|
||||
<SortedDescendingCellStyle BackColor="#D4DFE1"></SortedDescendingCellStyle>
|
||||
<SortedDescendingHeaderStyle BackColor="#15524A"></SortedDescendingHeaderStyle>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="getByIdxProgetto" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagFasiTableAdapter" FilterExpression=" (nomeFase like '%{0}%') OR (descrizioneFase like '%{0}%') "
|
||||
DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery" onupdating="ods_Updating">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxFase" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreCercato" Type="String" />
|
||||
</FilterParameters>
|
||||
<InsertParameters>
|
||||
<asp:ControlParameter ControlID="filtroPrj" DefaultValue="0" PropertyName="valoreInt" Name="idxProgetto" Type="Int32" />
|
||||
<asp:SessionParameter SessionField="idxFaseAncest" Name="idxFaseAncest" Type="Int32" />
|
||||
<asp:Parameter Name="nomeFase" Type="String" />
|
||||
<asp:Parameter Name="descrizioneFase" Type="String" />
|
||||
<asp:Parameter Name="enableTime" Type="Boolean" />
|
||||
<asp:Parameter Name="enableMoney" Type="Boolean" />
|
||||
<asp:Parameter Name="budgetTime" Type="Decimal" />
|
||||
<asp:Parameter Name="budgetMoney" Type="Decimal" DefaultValue="0" />
|
||||
<asp:Parameter Name="Attivo" Type="Boolean" DefaultValue="true" />
|
||||
</InsertParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="filtroPrj" DefaultValue="0" PropertyName="valoreInt" Name="idxProgetto" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="nomeFase" Type="String" />
|
||||
<asp:Parameter Name="descrizioneFase" Type="String" />
|
||||
<asp:Parameter Name="enableTime" Type="Boolean" />
|
||||
<asp:Parameter Name="enableMoney" Type="Boolean" />
|
||||
<asp:Parameter Name="Attivo" Type="Int32" />
|
||||
<asp:Parameter Name="budgetTime" Type="Decimal" />
|
||||
<asp:Parameter Name="budgetMoney" Type="Decimal" DefaultValue="0" />
|
||||
<asp:Parameter Name="Original_idxFase" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
<asp:Panel runat="server" ID="pnlDetRA">
|
||||
<asp:Label runat="server" ID="lblDet" Text="---" />
|
||||
</asp:Panel>
|
||||
</div>
|
||||
@@ -0,0 +1,610 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_adminFasi : System.Web.UI.UserControl
|
||||
{
|
||||
#region area standard (non modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// aggiorno visualizzazione fasi!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void filtroPrj_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
salveFilterPrj();
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area CUSTOM (da modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_faseSel;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// uid base
|
||||
/// </summary>
|
||||
protected string sessionUid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.UniqueID.Replace("$", "-");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idx del cliente selezionato
|
||||
/// </summary>
|
||||
public int idxCliente
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj(string.Format("idxCli_{0}", sessionUid));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("idxCli_{0}", sessionUid), value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx del progetto selezionato
|
||||
/// </summary>
|
||||
public int idxProgetto
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj(string.Format("idxProj_{0}", sessionUid));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("idxProj_{0}", sessionUid), value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore della fase selezionata
|
||||
/// </summary>
|
||||
public int idxFase
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (grView.SelectedIndex >= 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(grView.SelectedValue);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// pagina corrente (URL finale)
|
||||
/// </summary>
|
||||
public string _paginaCorrente { get; set; }
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
filtroCli.ods = odsClienti;
|
||||
filtroCli.valore = idxCliente.ToString();// memLayer.ML.StringSessionObj("idxCli_sel");
|
||||
filtroPrj.ods = odsProj;
|
||||
filtroPrj.valore = idxProgetto.ToString();// memLayer.ML.StringSessionObj("idxProgetto_sel");
|
||||
PagCorrente();
|
||||
}
|
||||
filtroCli.eh_selValore += new EventHandler(filtroCli_eh_selValore);
|
||||
filtroPrj.eh_selValore += new EventHandler(filtroPrj_eh_selValore);
|
||||
grView.PageSize = utils.pageSize;
|
||||
setDetVisibility();
|
||||
}
|
||||
/// <summary>
|
||||
/// salva in variabile pagina il nome della pagina corrente
|
||||
/// </summary>
|
||||
protected void PagCorrente()
|
||||
{
|
||||
Uri MyUrl = Request.Url;
|
||||
string delimStr = "/";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||
int n = finalUrl.Length;
|
||||
_paginaCorrente = finalUrl[n - 1].ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema visibilità area dettaglio RA
|
||||
/// </summary>
|
||||
private void setDetVisibility()
|
||||
{
|
||||
pnlDetRA.Visible = enableShowRA;
|
||||
lblDet.Visible = (grView.SelectedIndex >= 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// salva filtro cliente
|
||||
/// </summary>
|
||||
private void saveFilterCli()
|
||||
{
|
||||
// salvo filtro cliente
|
||||
//memLayer.ML.setSessionVal("idxCli_sel", filtroCli.valore);
|
||||
idxCliente = filtroCli.valoreInt;
|
||||
filtroPrj.ods = odsProj;
|
||||
filtroPrj.reselFirst();
|
||||
}
|
||||
/// <summary>
|
||||
/// salva filtro prj
|
||||
/// </summary>
|
||||
private void salveFilterPrj()
|
||||
{
|
||||
//memLayer.ML.setSessionVal("idxProgetto_sel", filtroPrj.valore);
|
||||
idxProgetto = filtroPrj.valoreInt;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio sel cliente --> aggiorno progetti
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void filtroCli_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
saveFilterCli();
|
||||
salveFilterPrj();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
//// aggiungo fase ancestor!
|
||||
//e.InputParameters["idxFaseAncest"] = memLayer.ML.IntSessionObj("idxFaseAncest");
|
||||
// aggiungo progetto!
|
||||
e.InputParameters["idxProgetto"] = idxProgetto;
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// controllo se c'è un argument x la fase...
|
||||
string idxFaseAncest = "0";
|
||||
try
|
||||
{
|
||||
idxFaseAncest = ((ImageButton)sender).CommandArgument;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
memLayer.ML.setSessionVal("idxFaseAncest", idxFaseAncest);
|
||||
if (idxFaseAncest == "0")
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
}
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore QUANDO NON CI SIANO RECORDS!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewEmpty_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxFaseAncest", "0");
|
||||
DataProxy.DP.taAF.insertQuery(idxProgetto, 0, "NuovaFase", "DescrizioneFase", false, false, 0, 0, true);
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Applicazione.AnagFasiDataTable tabella = new DS_Applicazione.AnagFasiDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object idxObj)
|
||||
{
|
||||
bool answ = isWritable();
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (answ)
|
||||
{
|
||||
int trovati = 0;
|
||||
// !!!FARE!!!
|
||||
#if false
|
||||
// controllo se ci siano tipo celle associate
|
||||
trovati = MagClass.magazzino.taTipoCella.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
// controllo se ci siano blocchi associati
|
||||
trovati = trovati + MagClass.magazzino.taBlocchi.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
#endif
|
||||
// controllo se ci sono record correlati...
|
||||
if (trovati > 0)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola classe css dato codice fase
|
||||
/// </summary>
|
||||
/// <param name="codFase"></param>
|
||||
/// <returns></returns>
|
||||
public string classByCod(object codFase)
|
||||
{
|
||||
string answ = "";
|
||||
int livello = 0;
|
||||
// calcolo livello come num punti "." -1...
|
||||
try
|
||||
{
|
||||
string[] array = codFase.ToString().Split('.');
|
||||
livello = array.Length;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (livello < 4)
|
||||
{
|
||||
answ = "fontNormale textNero";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "fontPiccolo textAzzurro";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina dimensioni dell'oggetto spaziatore data la fase
|
||||
/// </summary>
|
||||
/// <param name="codFase"></param>
|
||||
/// <returns></returns>
|
||||
public Unit widthByCod(object codFase)
|
||||
{
|
||||
Unit answ = new Unit(0, UnitType.Pixel);
|
||||
int livello = 0;
|
||||
// calcolo livello come num punti "." -1...
|
||||
try
|
||||
{
|
||||
string[] array = codFase.ToString().Split('.');
|
||||
livello = array.Length;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (livello >= 4)
|
||||
{
|
||||
answ = new Unit((livello - 3) * 10, UnitType.Pixel);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// abilitazione/disabilitazione gestione cambio cliente
|
||||
/// </summary>
|
||||
public bool changeSelCliEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return filtroCli.changeSelEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
filtroCli.changeSelEnabled = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
setDetVisibility();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// indico cambio selezione valore...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
setDetVisibility();
|
||||
if (eh_faseSel != null)
|
||||
{
|
||||
eh_faseSel(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce una classe css a seconda dei valori passati:
|
||||
/// green: bdgt > real
|
||||
/// orange: real > bdgt*warning
|
||||
/// red: real > bdgt
|
||||
/// std: errore...
|
||||
/// </summary>
|
||||
/// <param name="real"></param>
|
||||
/// <param name="bdgt"></param>
|
||||
/// <returns></returns>
|
||||
public string colorByVal(object real, object bdgt)
|
||||
{
|
||||
string answ = "badgeStd";
|
||||
try
|
||||
{
|
||||
double valoreReal = Convert.ToDouble(real);
|
||||
double valoreBdget = Convert.ToDouble(bdgt);
|
||||
double valoreWarn = Convert.ToDouble(bdgt) * Convert.ToDouble(memLayer.ML.confReadString("warningRatioPerc")) / 100;
|
||||
if (valoreReal >= valoreBdget)
|
||||
{
|
||||
answ = "badgeRosso";
|
||||
}
|
||||
else if (valoreReal >= valoreWarn)
|
||||
{
|
||||
answ = "badgeArancio";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "badgeVerde";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return "ui-corner-all " + answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia visibile pnl dettaglio RA della fase selezionata
|
||||
/// </summary>
|
||||
public bool enableShowRA
|
||||
{
|
||||
get
|
||||
{
|
||||
return pnlDetRA.Visible;
|
||||
}
|
||||
set
|
||||
{
|
||||
pnlDetRA.Visible = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola se sia ancestore la fase
|
||||
/// </summary>
|
||||
/// <param name="idxFaseAncest"></param>
|
||||
/// <returns></returns>
|
||||
public bool isAncestor(object idxFaseAncest)
|
||||
{
|
||||
bool answ = isWritable();
|
||||
if (answ)
|
||||
{
|
||||
int idxFase = -1;
|
||||
try
|
||||
{
|
||||
idxFase = Convert.ToInt32(idxFaseAncest);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
answ = (idxFase == 0);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool isWritable()
|
||||
{
|
||||
bool answ = false;
|
||||
if (_paginaCorrente == null)
|
||||
{
|
||||
PagCorrente();
|
||||
}
|
||||
answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente) && chkLicOk;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo stato licenze!
|
||||
/// </summary>
|
||||
public bool chkLicOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return (licenzeGPW.utentiAttivi < licenzeGPW.licenzeAttive);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_adminFasi {
|
||||
|
||||
/// <summary>
|
||||
/// filtroCli control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_filtro filtroCli;
|
||||
|
||||
/// <summary>
|
||||
/// odsClienti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsClienti;
|
||||
|
||||
/// <summary>
|
||||
/// filtroPrj control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_filtro filtroPrj;
|
||||
|
||||
/// <summary>
|
||||
/// odsProj control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsProj;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
|
||||
/// <summary>
|
||||
/// pnlDetRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlDetRA;
|
||||
|
||||
/// <summary>
|
||||
/// lblDet control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDet;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_adminOrario.ascx.cs" Inherits="GPW.WebUserControls.mod_adminOrario" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="fontPiccolo">
|
||||
<asp:GridView ID="grView" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="codOrario" DataSourceID="ods" ForeColor="#333333" GridLines="None" Width="100%" OnDataBound="grView_DataBound">
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' ImageUrl="../images/view_s.png" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' ImageUrl="../images/edit_s.png" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>' ImageUrl="../images/apply_s.png" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>' ImageUrl="../images/cancel_s.png" />
|
||||
</EditItemTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click" ImageUrl="../images/reload_m.png" Visible="true" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="codOrario" HeaderText="cod" SortExpression="codOrario" ControlStyle-Width="7em" />
|
||||
<asp:BoundField DataField="descOrario" HeaderText="descrizione" SortExpression="descOrario" ControlStyle-Width="21em" />
|
||||
<asp:BoundField DataField="oreLun" HeaderText="Lun" SortExpression="oreLun" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreMar" HeaderText="Mar" SortExpression="oreMar" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreMer" HeaderText="Mer" SortExpression="oreMer" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreGio" HeaderText="Gio" SortExpression="oreGio" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreVen" HeaderText="Ven" SortExpression="oreVen" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreSab" HeaderText="Sab" SortExpression="oreSab" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreDom" HeaderText="Dom" SortExpression="oreDom" DataFormatString="{0:0.##}" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oreOrdSett" HeaderText="Ordinarie" SortExpression="oreOrdSett" DataFormatString="{0:0.##}" ControlStyle-Width="2em" />
|
||||
<asp:BoundField DataField="oreStraordAss" HeaderText="Straordinarie" SortExpression="oreStraordAss" DataFormatString="{0:0.##}" ControlStyle-Width="2em" />
|
||||
<asp:CheckBoxField DataField="autoCompOreOrd" HeaderText="autoCompOreOrd" SortExpression="autoCompOreOrd" ControlStyle-Width="1em" />
|
||||
<asp:BoundField DataField="oraInizio_1" HeaderText="Inizio_1" SortExpression="oraInizio_1" ControlStyle-Width="4em" />
|
||||
<asp:BoundField DataField="oraFine_1" HeaderText="Fine_1" SortExpression="oraFine_1" ControlStyle-Width="4em" />
|
||||
<asp:BoundField DataField="oraInizio_2" HeaderText="Inizio_2" SortExpression="oraInizio_2" ControlStyle-Width="4em" />
|
||||
<asp:BoundField DataField="oraFine_2" HeaderText="Fine_2" SortExpression="oraFine_2" ControlStyle-Width="4em" />
|
||||
<asp:BoundField DataField="oraInizio_3" HeaderText="Inizio_3" SortExpression="oraInizio_3" ControlStyle-Width="4em" />
|
||||
<asp:BoundField DataField="oraFine_3" HeaderText="Fine_3" SortExpression="oraFine_3" ControlStyle-Width="4em" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("codOrario") %>' CommandName="Delete" ImageUrl="../images/elimina_s.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("codOrario")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="../images/apply_s.png" ToolTip='<%# traduci("Update")%>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png" ToolTip='<%# traduci("Cancel") %>' />
|
||||
</EditItemTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' Visible='<%# chkLicOk %>' CssClass="btnNew" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell"></SortedAscendingCellStyle>
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead"></SortedAscendingHeaderStyle>
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell"></SortedDescendingCellStyle>
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead"></SortedDescendingHeaderStyle>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" DeleteMethod="deleteQuery"
|
||||
InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagOrariTableAdapter" UpdateMethod="updateQuery"
|
||||
FilterExpression=" (RagSociale like '%{0}%') OR (indirizzo like '%{0}%') OR (citta like '%{0}%') OR (url like '%{0}%') OR (email like '%{0}%') OR (nota like '%{0}%') "
|
||||
onupdating="ods_Updating">
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreCercato" Type="String" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_codOrario" Type="String" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="codOrario" Type="String" />
|
||||
<asp:Parameter Name="descOrario" Type="String" />
|
||||
<asp:Parameter Name="oreOrdSett" Type="Double" />
|
||||
<asp:Parameter Name="oreStraordAss" Type="Double" />
|
||||
<asp:Parameter Name="autoCompOreOrd" Type="Boolean" />
|
||||
<asp:Parameter Name="oreLun" Type="Double" />
|
||||
<asp:Parameter Name="oreMar" Type="Double" />
|
||||
<asp:Parameter Name="oreMer" Type="Double" />
|
||||
<asp:Parameter Name="oreGio" Type="Double" />
|
||||
<asp:Parameter Name="oreVen" Type="Double" />
|
||||
<asp:Parameter Name="oreSab" Type="Double" />
|
||||
<asp:Parameter Name="oreDom" Type="Double" />
|
||||
<asp:Parameter DbType="Time" Name="oraInizio_1" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_1" />
|
||||
<asp:Parameter DbType="Time" Name="oraInizio_2" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_2" />
|
||||
<asp:Parameter DbType="Time" Name="oraInizio_3" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_3" />
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="codOrario" Type="String" />
|
||||
<asp:Parameter Name="descOrario" Type="String" />
|
||||
<asp:Parameter Name="oreOrdSett" Type="Double" />
|
||||
<asp:Parameter Name="oreStraordAss" Type="Double" />
|
||||
<asp:Parameter Name="autoCompOreOrd" Type="Boolean" />
|
||||
<asp:Parameter Name="oreLun" Type="Double" />
|
||||
<asp:Parameter Name="oreMar" Type="Double" />
|
||||
<asp:Parameter Name="oreMer" Type="Double" />
|
||||
<asp:Parameter Name="oreGio" Type="Double" />
|
||||
<asp:Parameter Name="oreVen" Type="Double" />
|
||||
<asp:Parameter Name="oreSab" Type="Double" />
|
||||
<asp:Parameter Name="oreDom" Type="Double" />
|
||||
<asp:Parameter Name="oraInizio_1" DbType="Time" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_1" />
|
||||
<asp:Parameter DbType="Time" Name="oraInizio_2" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_2" />
|
||||
<asp:Parameter DbType="Time" Name="oraInizio_3" />
|
||||
<asp:Parameter DbType="Time" Name="oraFine_3" />
|
||||
<asp:Parameter Name="Original_codOrario" Type="String" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
</div>
|
||||
@@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_adminOrario : System.Web.UI.UserControl
|
||||
{
|
||||
#region area standard (non modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area CUSTOM (da modificare)
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Applicazione.AnagOrariDataTable tabella = new DS_Applicazione.AnagOrariDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object idxObj)
|
||||
{
|
||||
bool answ = true;
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (answ)
|
||||
{
|
||||
int trovati = 0;
|
||||
// controllo se ci siano tipo celle associate
|
||||
trovati = DataProxy.DP.taDipendenti.getByCodOrario(idxObj.ToString()).Rows.Count;
|
||||
// controllo se ci sono record correlati...
|
||||
if (trovati > 0)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// inserisco record
|
||||
DataProxy.DP.taAO.Insert("0000 (new)", "descrizione", 0, 0, false, 0, 0, 0, 0, 0, 0, 0, DateTime.Today.TimeOfDay, DateTime.Today.TimeOfDay, null, null, null, null);
|
||||
//update!
|
||||
grView.DataBind();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo stato licenze!
|
||||
/// </summary>
|
||||
public bool chkLicOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return (licenzeGPW.checkLicenze);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_adminOrario {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_adminProgetti.ascx.cs" Inherits="GPW.WebUserControls.mod_adminProgetti" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc2" %>
|
||||
<%@ Register Src="mod_dettaglioProgetto.ascx" TagName="mod_dettaglioProgetto" TagPrefix="uc3" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="filtro_1 fontPiccolo" style="white-space: nowrap; height: 30px;">
|
||||
<div class="divSx">
|
||||
<uc2:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" realtimeUpdate="true" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:CheckBox ID="chkShowChiusi" runat="server" Text="Mostra Archiviati" OnCheckedChanged="chkShowChiusi_CheckedChanged"
|
||||
AutoPostBack="True" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<uc1:mod_filtro ID="filtroCli" runat="server" filterChekText="filtroCliente" comboWidth="180" />
|
||||
</div>
|
||||
<%--<div class="divSx">
|
||||
<uc1:mod_filtro ID="filtroDip" runat="server" filterChekText="filtroDipendenti" comboWidth="180" />
|
||||
</div>--%>
|
||||
<div class="divSx">
|
||||
<asp:CheckBox ID="chkShowVuoti" runat="server" Text="Mostra Vuoti" AutoPostBack="True"
|
||||
OnCheckedChanged="chkShowVuoti_CheckedChanged" Checked="true" />
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:CheckBox ID="chkShowOnlyStarred" runat="server" Text="Mostra SOLO Starred" AutoPostBack="True"
|
||||
OnCheckedChanged="chkShowOnlyStarred_CheckedChanged" Checked="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="divSx" style="min-width: 600px;">
|
||||
<div class="fontPiccolo">
|
||||
<asp:GridView ID="grView" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
|
||||
DataKeyNames="idxProgetto" DataSourceID="ods" ForeColor="#333333" GridLines="None" OnDataBound="grView_DataBound" OnSelectedIndexChanged="grView_SelectedIndexChanged"
|
||||
OnRowUpdating="grView_RowUpdating">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="false" ItemStyle-Width="72px" ItemStyle-VerticalAlign="Middle"
|
||||
ItemStyle-Height="26px">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'
|
||||
ImageUrl="../images/view_m.png" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'
|
||||
ImageUrl="../images/edit_m.png" Visible='<%# isWritable() %>' />
|
||||
<asp:ImageButton ID="imgDettFasi" runat="server" CausesValidation="False" CommandArgument="dettFasi" CommandName="Update"
|
||||
ToolTip='<%# traduci("go2dettFasi") %>' ImageUrl="../images/naviga_m.png" OnClick="imgDettFasi_Click" />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>'
|
||||
ImageUrl="../images/apply_s.png" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'
|
||||
ImageUrl="../images/new_s.png" OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'
|
||||
ImageUrl="../images/cancel_s.png" />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click"
|
||||
ImageUrl="../images/reload_l.png" Visible="true" />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="RagSociale" SortExpression="RagSociale"
|
||||
ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<b>
|
||||
<asp:Label ID="lblRagSociale" runat="server" Text='<%# Eval("RagSociale") %>' /></b>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList runat="server" ID="dlidxCliente" SelectedValue='<%# Bind("idxCliente") %>' DataSourceID="odsClienti" DataTextField="label"
|
||||
DataValueField="value" />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:DropDownList runat="server" ID="dlidxCliente" SelectedValue='<%# Bind("idxCliente") %>' DataSourceID="odsClienti" DataTextField="label"
|
||||
DataValueField="value" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="nomeProj" SortExpression="nomeProj"
|
||||
ItemStyle-Width="500px">
|
||||
<ItemTemplate>
|
||||
<div class="fontNormale">
|
||||
<asp:Label ID="lblnomeProj" runat="server" Text='<%# Eval("nomeProj") %>' Font-Strikeout='<%# invBool(Eval("Attivo")) %>' />
|
||||
</div>
|
||||
<div class="labelInput">
|
||||
<asp:Label ID="lbldescrProj" runat="server" Text='<%# Eval("descrProj") %>' Font-Size="7pt" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<div class="fontNormale">
|
||||
<asp:TextBox ID="txtnomeProj" runat="server" Text='<%# Bind("nomeProj") %>' Width="30em" />
|
||||
</div>
|
||||
<div class="labelInput">
|
||||
<asp:TextBox ID="txtdescrProj" runat="server" Text='<%# Bind("descrProj") %>' Width="30em" TextMode="MultiLine" Height="8em" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<div class="fontNormale">
|
||||
<asp:TextBox ID="txtnomeProj" runat="server" Text='<%# Bind("nomeProj") %>' Width="30em" />
|
||||
</div>
|
||||
<div class="labelInput">
|
||||
<asp:TextBox ID="txtdescrProj" runat="server" Text='<%# Bind("descrProj") %>' Width="30em" TextMode="MultiLine" Height="8em" />
|
||||
</div>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="RealVsBudgetTime" SortExpression="budgetTime" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Panel runat="server" ID="pnlTime" CssClass='<%# colorByVal(Eval("totOre"),Eval("budgetTime"))%>' Style="font-size: 9pt;
|
||||
padding: .3em;" Width="100px">
|
||||
<b>
|
||||
<asp:Label ID="lblRealTime" runat="server" Text='<%# Eval("totOre","{0:#,###.##}") %>' ToolTip='<%# traduci("OreErogate") %>' /></b>
|
||||
/
|
||||
<asp:Label ID="lblbudgetTime" runat="server" Text='<%# Eval("budgetTime","{0:#,###.##}") %>' ToolTip='<%# traduci("OreBudget") %>' />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Panel runat="server" ID="pnlTime" CssClass='<%# colorByVal(Eval("totOre"),Eval("budgetTime"))%>' Style="font-size: 9pt;
|
||||
padding: .3em;" Width="100px">
|
||||
<b>
|
||||
<asp:Label ID="lblRealTime" runat="server" Text='<%# Eval("totOre","{0:#,###.##}") %>' ToolTip='<%# traduci("OreErogate") %>' /></b>
|
||||
/
|
||||
<asp:Label ID="lblbudgetTime" runat="server" Text='<%# Eval("budgetTime","{0:#,###.##}") %>' ToolTip='<%# traduci("OreBudget") %>' />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="budgetMoney" SortExpression="budgetMoney">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblbudgetMoney" runat="server" Text='<%# Eval("budgetMoney","{0:#,###.##}€") %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Label ID="lblbudgetMoney" runat="server" Text='<%# Eval("budgetMoney","{0:#,###.##}€") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxProgetto") %>' CommandName="Delete"
|
||||
ImageUrl="../images/elimina_s.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("idxProgetto")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="../images/apply_s.png"
|
||||
ToolTip='<%# traduci("Update")%>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert" ImageUrl="../images/new_s.png"
|
||||
OnClick="lblIns_click" ToolTip='<%# traduci("Insert") %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="../images/cancel_s.png"
|
||||
ToolTip='<%# traduci("Cancel") %>' />
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:ImageButton ID="imgBtnNew" runat="server" ToolTip='<%# traduci("New") %>' CausesValidation="False" OnClick="btnNew_Click"
|
||||
ImageUrl="~/images/new_m.png" Visible='<%# isWritable() %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OnInserting="recuperaFooter" DeleteMethod="deleteQuery" InsertMethod="insertQuery"
|
||||
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagProgettiTableAdapter"
|
||||
UpdateMethod="updateQuery" FilterExpression=" (nomeProj like '%{0}%') OR (descrProj like '%{0}%')"
|
||||
onupdating="ods_Updating">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxProgetto" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter SessionField="valoreCercato" Type="String" />
|
||||
</FilterParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="idxCliente" Type="Int32" />
|
||||
<asp:Parameter Name="nomeProj" Type="String" />
|
||||
<asp:Parameter Name="descrProj" Type="String" />
|
||||
</InsertParameters>
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="0" Name="idxDipendente" Type="Int32" />
|
||||
<asp:SessionParameter Name="dataFrom" SessionField="_inizio" Type="DateTime" />
|
||||
<asp:SessionParameter Name="dataTo" SessionField="_fine" Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxCliente" SessionField="idxCli_sel" Type="Int32" />
|
||||
<asp:SessionParameter DefaultValue="False" Name="showPrjArch" SessionField="showPrjArch" Type="Boolean" />
|
||||
<asp:SessionParameter DefaultValue="True" Name="showPrjZeroH" SessionField="showPrjZeroH" Type="Boolean" />
|
||||
<asp:SessionParameter DefaultValue="False" Name="showPrjStar" SessionField="showPrjStar" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="idxCliente" Type="Int32" />
|
||||
<asp:Parameter Name="nomeProj" Type="String" />
|
||||
<asp:Parameter Name="descrProj" Type="String" />
|
||||
<asp:Parameter Name="Original_idxProgetto" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsClienti" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selClientiTableAdapter"></asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="divSx" style="min-width: 175px;">
|
||||
<uc3:mod_dettaglioProgetto ID="mod_dettaglioProgetto1" runat="server" />
|
||||
</div>
|
||||
@@ -0,0 +1,523 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_adminProgetti : System.Web.UI.UserControl
|
||||
{
|
||||
#region area standard (non modificare)
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
mod_dettaglioProgetto1.Visible = false;
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// annulla inserimento nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblCanc_click(object sender, EventArgs e)
|
||||
{
|
||||
// annullo inserimento: nascondo footer, bind controlli...
|
||||
grView.FooterRow.Visible = false;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area CUSTOM (da modificare)
|
||||
|
||||
/// <summary>
|
||||
/// pagina corrente (URL finale)
|
||||
/// </summary>
|
||||
public string _paginaCorrente { get; set; }
|
||||
/// <summary>
|
||||
/// determina se siano da visualizzare i progetti già chiusi
|
||||
/// </summary>
|
||||
public bool showChiusi
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj("showPrjArch");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("showPrjArch", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se siano visibili progetti "vuoti" con zero ore caricate quindi
|
||||
/// </summary>
|
||||
public bool showVuoti
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj("showPrjZeroH");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("showPrjZeroH", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se siano visibili SOLO progetti "Starred"
|
||||
/// </summary>
|
||||
public bool showOnlyStarred
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj("showPrjStar");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("showPrjStar", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// caricamento
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// imposto intervallo date...10 anni...
|
||||
intervalloDate date = new intervalloDate();
|
||||
date.fine = DateTime.Now.Date.AddDays(1);
|
||||
date.inizio = date.fine.AddYears(-10);
|
||||
mod_periodoAnalisi1.intervalloAnalisi = date;
|
||||
// svuoto variabili sessione
|
||||
memLayer.ML.emptySessionVal("idxProgetto_sel");
|
||||
memLayer.ML.emptySessionVal("idxCli_sel");
|
||||
filtroCli.ods = odsClienti;
|
||||
filtroCli.reselFirst();
|
||||
filtroCli.isChecked = false;
|
||||
showChiusi = false;
|
||||
showVuoti = true;
|
||||
mod_dettaglioProgetto1.Visible = false;
|
||||
}
|
||||
filtroCli.eh_selValore += new EventHandler(filtroCli_eh_selValore);
|
||||
mod_dettaglioProgetto1.eh_nuovoValore += new EventHandler(mod_dettaglioProgetto1_eh_nuovoValore);
|
||||
}
|
||||
/// <summary>
|
||||
/// salva in variabile pagina il nome della pagina corrente
|
||||
/// </summary>
|
||||
protected void PagCorrente()
|
||||
{
|
||||
Uri MyUrl = Request.Url;
|
||||
string delimStr = "/";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||
int n = finalUrl.Length;
|
||||
_paginaCorrente = finalUrl[n - 1].ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// cambiati dati dettaglio (attivo/inattivo)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void mod_dettaglioProgetto1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// selezionato valore, filtro!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void filtroCli_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
if (filtroCli.isChecked)
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxCli_sel", filtroCli.valoreInt);
|
||||
}
|
||||
else
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxCli_sel", 0);
|
||||
}
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_Applicazione.AnagProgettiDataTable tabella = new DS_Applicazione.AnagProgettiDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object idxObj)
|
||||
{
|
||||
bool answ = isWritable();
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (answ)
|
||||
{
|
||||
int trovati = 0;
|
||||
// !!!FARE!!!
|
||||
#if false
|
||||
// controllo se ci siano tipo celle associate
|
||||
trovati = MagClass.magazzino.taTipoCella.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
// controllo se ci siano blocchi associati
|
||||
trovati = trovati + MagClass.magazzino.taBlocchi.getByCodMag(memLayer.ML.StringSessionObj("CodCS"), idxObj.ToString()).Rows.Count;
|
||||
#endif
|
||||
// controllo se ci sono record correlati...
|
||||
if (trovati > 0)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// evento selezione!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxProgetto_sel", grView.SelectedDataKey["idxProgetto"]);
|
||||
mod_dettaglioProgetto1.Visible = true;
|
||||
if (eh_selValore != null)
|
||||
{
|
||||
eh_selValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se mostrare i progetti archiviati
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkShowChiusi_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
showChiusi = chkShowChiusi.Checked;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è clonare...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgDettFasi_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "dettFasi");
|
||||
}
|
||||
/// <summary>
|
||||
/// intercetto eventuale update fittizio x rimandare a pagina dett fasi
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
|
||||
{
|
||||
// salvo progetto sel
|
||||
memLayer.ML.setSessionVal("idxProgetto_sel", e.Keys["idxProgetto"]);
|
||||
// quale comando?
|
||||
string _comando = "";
|
||||
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
|
||||
{
|
||||
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
|
||||
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
|
||||
}
|
||||
// verifico il tipo di richiesta (clona o update normale)
|
||||
switch (_comando)
|
||||
{
|
||||
case "dettFasi":
|
||||
// salvo idxCli...
|
||||
int idxCli = 0;
|
||||
try
|
||||
{
|
||||
idxCli = DataProxy.DP.taAP.getByIdxPrj(memLayer.ML.IntSessionObj("idxProgetto_sel"))[0].idxCliente;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
memLayer.ML.setSessionVal("idxCli_sel", idxCli);
|
||||
Response.Redirect("fasi.aspx");
|
||||
// blocco update!
|
||||
e.Cancel = true;
|
||||
break;
|
||||
default:
|
||||
// faccio update!
|
||||
break;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua update controllo
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce una classe css a seconda dei valori passati:
|
||||
/// green: bdgt > real
|
||||
/// orange: real > bdgt*warning
|
||||
/// red: real > bdgt
|
||||
/// std: errore...
|
||||
/// </summary>
|
||||
/// <param name="real"></param>
|
||||
/// <param name="bdgt"></param>
|
||||
/// <returns></returns>
|
||||
public string colorByVal(object real, object bdgt)
|
||||
{
|
||||
string answ = "badgeStd";
|
||||
try
|
||||
{
|
||||
double valoreReal = Convert.ToDouble(real);
|
||||
double valoreBdget = Convert.ToDouble(bdgt);
|
||||
double valoreWarn = Convert.ToDouble(bdgt) * Convert.ToDouble(memLayer.ML.confReadString("warningRatioPerc")) / 100;
|
||||
if (valoreReal >= valoreBdget)
|
||||
{
|
||||
answ = "badgeRosso";
|
||||
}
|
||||
else if (valoreReal >= valoreWarn)
|
||||
{
|
||||
answ = "badgeArancio";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "badgeVerde";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return "ui-corner-all " + answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// cambia impsotazione show/hide progetti con ore a zero...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkShowVuoti_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
showVuoti = chkShowVuoti.Checked;
|
||||
grView.DataBind();
|
||||
}
|
||||
protected void chkShowOnlyStarred_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
showOnlyStarred = chkShowOnlyStarred.Checked;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool isWritable()
|
||||
{
|
||||
bool answ = false;
|
||||
if (_paginaCorrente == null)
|
||||
{
|
||||
PagCorrente();
|
||||
}
|
||||
answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente) && chkLicOk;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo stato licenze!
|
||||
/// </summary>
|
||||
public bool chkLicOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return (licenzeGPW.utentiAttivi < licenzeGPW.licenzeAttive);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (!licenzeGPW.checkLicenze)
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.EditIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_adminProgetti {
|
||||
|
||||
/// <summary>
|
||||
/// mod_periodoAnalisi1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_periodoAnalisi mod_periodoAnalisi1;
|
||||
|
||||
/// <summary>
|
||||
/// chkShowChiusi control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkShowChiusi;
|
||||
|
||||
/// <summary>
|
||||
/// filtroCli control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_filtro filtroCli;
|
||||
|
||||
/// <summary>
|
||||
/// chkShowVuoti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkShowVuoti;
|
||||
|
||||
/// <summary>
|
||||
/// chkShowOnlyStarred control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkShowOnlyStarred;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// odsClienti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsClienti;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
|
||||
/// <summary>
|
||||
/// mod_dettaglioProgetto1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_dettaglioProgetto mod_dettaglioProgetto1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_approvaTimbr.ascx.cs" Inherits="GPW.WebUserControls.mod_approvaTimbr" %>
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="filtro_1" style="height: 28px; padding: 2px;">
|
||||
<div class="divSx fontPiccolo">
|
||||
<div class="divSx">
|
||||
<uc1:mod_filtro ID="filtroDip" runat="server" filterUnchekText="mostraTutti" filterChekText="filtraDip" />
|
||||
<asp:ObjectDataSource ID="odsDip" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.v_selDipendentiTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<label for="arrot">
|
||||
Min. arrot.
|
||||
</label>
|
||||
<asp:TextBox runat="server" ID="txtArrot" name="arrot" Text="5" Width="2em" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv">
|
||||
<asp:GridView ID="grView" nome="grView" runat="server" AllowPaging="True" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="dataOra,idxDipendente" CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="Smaller" Width="640px" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<EmptyDataTemplate>
|
||||
Nessun record da approvare
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDip" runat="server" Text='<%# cognomeNome(Eval("idxDipendente")) %>' Visible='<%# userCanApprove %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="dataOra" SortExpression="dataOra" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblData" runat="server" Text='<%# Eval("dataOra", "{0:yyyy-MM-dd, ddd - HH:mm}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label runat="server" ID="lblHeadIn" Text="IN" />
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label ID="lblIn" runat="server" Text="X" Visible='<%# Eval("entrata") %>' ForeColor="#666666" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:ImageButton runat="server" ID="btnSwapInOut" ToolTip="Scambia In/Out" CommandName="Update" ImageUrl="~/images/InOutArrows_m.png" />
|
||||
<asp:ConfirmButtonExtender ID="cbeSwapInOut" runat="server" ConfirmText="Procedo con scambio Entrata/Uscita della timbratura?" TargetControlID="btnSwapInOut">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label runat="server" ID="lblHeadOut" Text="OUT" />
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label ID="lblOut" runat="server" Text="X" Visible='<%# invBool(Eval("entrata")) %>' ForeColor="#666666" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<div style="padding: 10px;">
|
||||
<asp:LinkButton runat="server" ID="lbDelete" Text="Elimina" CommandArgument="Elimina" CommandName="Delete" CssClass="btnDelete btnRosso" />
|
||||
<asp:ConfirmButtonExtender ID="cbeDelete" runat="server" ConfirmText="Sicuro di voler eliminare la timbratura? non è possibile annullare l'operazione." TargetControlID="lbDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbApprova" Visible='<%# userCanApprove %>' Text="Approva" CommandArgument="approva" CommandName="Select" CssClass="btnNew btnVerde" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getNonAppr" TypeName="GPW_data.DS_ApplicazioneTableAdapters.TimbratureTableAdapter" DeleteMethod="DeleteNonAppr" UpdateMethod="updateSwapInOut" ondeleted="ods_Deleted" onupdated="ods_Updated" >
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDip_sel" Name="idxDipendente" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
@@ -0,0 +1,186 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
using System.Globalization;
|
||||
using System.Data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_approvaTimbr : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
filtroDip.ods = odsDip;
|
||||
filtroDip.reset();
|
||||
}
|
||||
filtroDip.eh_selValore += new EventHandler(filtroDip_eh_selValore);
|
||||
}
|
||||
/// <summary>
|
||||
/// seleziono
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void filtroDip_eh_selValore(object sender, EventArgs e)
|
||||
{
|
||||
// imposto ods
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// imposto ODS
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
if (filtroDip.valoreInt != -1)
|
||||
{
|
||||
IdxDipSel = filtroDip.valoreInt;
|
||||
ods.SelectMethod = "getNonApprByDip";
|
||||
}
|
||||
else
|
||||
{
|
||||
//memLayer.ML.emptySessionVal("idxDip_sel");
|
||||
IdxDipSel = -1;
|
||||
ods.SelectMethod = "getNonAppr";
|
||||
}
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola cognome-nome da idx
|
||||
/// </summary>
|
||||
/// <param name="idxDip"></param>
|
||||
/// <returns></returns>
|
||||
public string cognomeNome(object idxDip)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
DS_Applicazione.DipendentiRow rigaDip = DataProxy.DP.taDipendenti.getByIdx(Convert.ToInt32(idxDip))[0];
|
||||
answ = string.Format("{0} {1}", rigaDip.Cognome, rigaDip.Nome);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se l'utente possa approvare la modifica oraria
|
||||
/// </summary>
|
||||
public bool userCanApprove
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = user_std.UtSn.userHasRight("GPW_admin");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx dipendente loggato
|
||||
/// </summary>
|
||||
protected int IdxDipSel
|
||||
{
|
||||
get
|
||||
{
|
||||
int idx = -1;
|
||||
try
|
||||
{
|
||||
idx = memLayer.ML.IntSessionObj("idxDip_sel");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return idx;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDip_sel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper x salvare approvazioni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo approvazione
|
||||
DateTime dataOra = DateTime.Now;
|
||||
int idxDip = 0;
|
||||
try
|
||||
{
|
||||
dataOra = Convert.ToDateTime(grView.SelectedDataKey["dataOra"].ToString());
|
||||
idxDip = Convert.ToInt32(grView.SelectedDataKey["idxDipendente"].ToString());
|
||||
logger.lg.scriviLog(string.Format("Approvazione per dip {0} in data/ora {1}", idxDip, dataOra), tipoLog.INFO);
|
||||
// recupero tab timbr non approvate x dip
|
||||
DS_Applicazione.TimbratureRow rigaTimb = DataProxy.DP.taTimb.getByDipDataOra(idxDip, dataOra)[0];
|
||||
// effettua arrotondamento (aggiunge/toglie)
|
||||
int minOrig = dataOra.Minute;
|
||||
int secOrig = dataOra.Second;
|
||||
int minArr = 0;
|
||||
int step = Convert.ToInt32(txtArrot.Text);
|
||||
if (rigaTimb.entrata)
|
||||
{
|
||||
|
||||
minArr = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(minOrig / step))) * step;
|
||||
}
|
||||
else
|
||||
{
|
||||
minArr = Convert.ToInt32(Math.Floor(Convert.ToDouble(minOrig / step))) * step;
|
||||
}
|
||||
// modifico data del record
|
||||
DataProxy.DP.taTimb.stp_Timbr_modifica(idxDip, dataOra, dataOra.AddMinutes(minArr - minOrig).AddSeconds(-secOrig));
|
||||
// approvo con data modificata
|
||||
DataProxy.DP.taTimb.stp_Timbr_Approva(idxDip, dataOra.AddMinutes(minArr - minOrig).AddSeconds(-secOrig));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// update!
|
||||
grView.SelectedIndex = -1;
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// post update resetto filtro...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// post delete resetto filtro...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ods_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_approvaTimbr {
|
||||
|
||||
/// <summary>
|
||||
/// filtroDip control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_filtro filtroDip;
|
||||
|
||||
/// <summary>
|
||||
/// odsDip control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsDip;
|
||||
|
||||
/// <summary>
|
||||
/// txtArrot control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtArrot;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_attivitaIns.ascx.cs" Inherits="GPW.WebUserControls.mod_attivitaIns" %>
|
||||
<%@ Register Src="mod_dateTimeJQM.ascx" TagName="mod_dateTimeJQM" TagPrefix="uc1" %>
|
||||
<div data-role="header" data-position="fixed">
|
||||
<h3>
|
||||
Edit / Nuova Attività</h3>
|
||||
</div>
|
||||
<div data-role="content" style="margin: -10px;">
|
||||
<asp:FormView ID="frViewRA" runat="server" DataKeyNames="idxRA" DataSourceID="odsRA" OnItemCommand="frViewRA_ItemCommand"
|
||||
Width="100%">
|
||||
<EditItemTemplate>
|
||||
<label for="ddlProgetto" style="font-size: xx-small;">
|
||||
Progetto
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlProgetto" name="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<%--<asp:ObjectDataSource ID="odsProgetto" runat="server" SelectMethod="getGrouped" TypeName="GPW_data.DS_UtilityTableAdapters.v_selProgettiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="true" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>--%>
|
||||
<label for="ddlFase" style="font-size: xx-small;">
|
||||
Fase
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlFase" name="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value"
|
||||
data-mini="true" OnDataBound="ddlFase_DataBound">
|
||||
</asp:DropDownList>
|
||||
<%--<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selFasiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="ddlProgetto" DefaultValue="0" Name="conditio" PropertyName="SelectedValue" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>--%>
|
||||
<uc1:mod_dateTimeJQM ID="mod_dateTimeJQM1" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
|
||||
<uc1:mod_dateTimeJQM ID="dtjFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
|
||||
<br />
|
||||
descrizione:
|
||||
<asp:TextBox ID="descrizioneTextBox" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="3em" />
|
||||
<div class="ui-grid-b">
|
||||
<div class="ui-block-a">
|
||||
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" data-icon="check"
|
||||
data-role="button" data-theme="b" data-mini="true" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" data-icon="refresh"
|
||||
data-role="button" data-theme="c" data-mini="true" />
|
||||
</div>
|
||||
<div class="ui-block-c">
|
||||
<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" data-icon="minus"
|
||||
data-role="button" data-theme="e" data-mini="true" />
|
||||
</div>
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<InsertItemTemplate>
|
||||
<label for="ddlProgetto" style="font-size: xx-small;">
|
||||
Progetto
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlProgetto" name="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<label for="ddlFase" style="font-size: xx-small;">
|
||||
Fase
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlFase" name="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value"
|
||||
data-mini="true" OnDataBound="ddlFase_DataBound">
|
||||
</asp:DropDownList>
|
||||
<uc1:mod_dateTimeJQM ID="dtjInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
|
||||
<uc1:mod_dateTimeJQM ID="dtjFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
|
||||
<br />
|
||||
descrizione:
|
||||
<asp:TextBox ID="descrizioneTextBox" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="3em" />
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" data-icon="plus"
|
||||
data-role="button" data-theme="b" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" data-icon="refresh"
|
||||
data-role="button" data-theme="c" />
|
||||
</div>
|
||||
</div>
|
||||
</InsertItemTemplate>
|
||||
<ItemTemplate>
|
||||
<label for="ddlProgetto" style="font-size: xx-small;">
|
||||
Progetto
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlProgetto" name="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<label for="ddlFase" style="font-size: xx-small;">
|
||||
Fase
|
||||
</label>
|
||||
<asp:DropDownList ID="ddlFase" name="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value"
|
||||
data-mini="true" OnDataBound="ddlFase_DataBound">
|
||||
</asp:DropDownList>
|
||||
<uc1:mod_dateTimeJQM ID="dtjInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
|
||||
<uc1:mod_dateTimeJQM ID="dtjFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
|
||||
<br />
|
||||
descrizione:
|
||||
<asp:TextBox ID="descrizioneTextBox" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="3em" />
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
<asp:ObjectDataSource ID="odsRA" runat="server" DeleteMethod="deleteQuery" InsertMethod="Insert" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="getByKey" TypeName="GPW_data.DS_ApplicazioneTableAdapters.RegAttivitaTableAdapter" UpdateMethod="updateQuery"
|
||||
OnUpdating="odsRA_Updating" OnInserted="odsRA_Inserted" OnInserting="odsRA_Inserting" OnUpdated="odsRA_Updated" OnDeleted="odsRA_Deleted">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxRA" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="idxFase" Type="Int32" />
|
||||
<asp:Parameter Name="inizio" Type="DateTime" />
|
||||
<asp:Parameter Name="fine" Type="DateTime" />
|
||||
<asp:Parameter Name="descrizione" Type="String" />
|
||||
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
|
||||
</InsertParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxRA" SessionField="idxRASel" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="idxFase" Type="Int32" />
|
||||
<asp:Parameter Name="inizio" Type="DateTime" />
|
||||
<asp:Parameter Name="fine" Type="DateTime" />
|
||||
<asp:Parameter Name="descrizione" Type="String" />
|
||||
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
|
||||
<asp:Parameter Name="Original_idxRA" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsProgetto" runat="server" SelectMethod="getGrouped" TypeName="GPW_data.DS_UtilityTableAdapters.v_selProgettiTableAdapter"
|
||||
OldValuesParameterFormatString="original_{0}">
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="true" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<%--<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selFasiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="conditio" SessionField="idxProjSel" Type="Int32" />
|
||||
<asp:Parameter DefaultValue="true" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>--%>
|
||||
<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selFasiOptTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxProjSel" DefaultValue="0" Name="conditio" Type="Int32" />
|
||||
<asp:Parameter DefaultValue="false" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
@@ -0,0 +1,235 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_attivitaIns : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// pagina di return a fine editing
|
||||
/// </summary>
|
||||
protected string returnPage
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = memLayer.ML.confReadString("baseUrl");
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("returnPage");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("returnPage", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// RA selezionata
|
||||
/// </summary>
|
||||
protected int idxRASel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxRASel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxRASel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// data selezionata
|
||||
/// </summary>
|
||||
protected DateTime dataRif
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataRif", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// progetto selezionato
|
||||
/// </summary>
|
||||
protected int idxProjSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxProjSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxProjSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// fase selezionata
|
||||
/// </summary>
|
||||
protected int idxFaseSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxFaseSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxFaseSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// al primo load ricarico i dati correnti (se ci sono)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
DropDownList ddlFase_int;
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// verifico se ci sia una richiesta di editing...
|
||||
if (idxRASel > 0)
|
||||
{
|
||||
frViewRA.ChangeMode(FormViewMode.Edit);
|
||||
// pre-seleziono idx progetto x ods fase...
|
||||
idxFaseSel = DataProxy.DP.taRA.getByKey(idxRASel)[0].idxFase;
|
||||
idxProjSel = idxPrjByFase(idxFaseSel);
|
||||
// imposto valori selezionati
|
||||
DropDownList ddlProj_int = (DropDownList)frViewRA.FindControl("ddlProgetto");
|
||||
ddlProj_int.SelectedValue = idxProjSel.ToString();
|
||||
ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase");
|
||||
ddlFase_int.SelectedValue = idxFaseSel.ToString();
|
||||
}
|
||||
else // è insert nuova!!!
|
||||
{
|
||||
frViewRA.ChangeMode(FormViewMode.Insert);
|
||||
mod_dateTimeJQM dtjInizio = (mod_dateTimeJQM)frViewRA.FindControl("dtjInizio");
|
||||
mod_dateTimeJQM dtjFine = (mod_dateTimeJQM)frViewRA.FindControl("dtjFine");
|
||||
dtjInizio.valoreDateTime = dataRif.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute);
|
||||
dtjFine.valoreDateTime = dtjInizio.valoreDateTime.AddMinutes(memLayer.ML.confReadInt("defRegAttMin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola idxProgetto da idxFase
|
||||
/// </summary>
|
||||
/// <param name="idxFase"></param>
|
||||
/// <returns></returns>
|
||||
public int idxPrjByFase(object idxFase)
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = DataProxy.DP.taAF.getByIdx(Convert.ToInt32(idxFase))[0].idxProgetto;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorno ods fasi...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlProgetto_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo in session idxProjSel!
|
||||
DropDownList ddlProj_int = (DropDownList)sender;
|
||||
idxProjSel = Convert.ToInt32(ddlProj_int.SelectedValue);
|
||||
// ricarico dati fasi
|
||||
odsFase.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// evento richiesta update
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void odsRA_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
// recupero valore fase selezionato...
|
||||
DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase");
|
||||
e.InputParameters["idxFase"] = ddlFase_int.SelectedValue;
|
||||
e.InputParameters["idxDipendente"] = DataProxy.idxDipendente;
|
||||
}
|
||||
|
||||
protected void frViewRA_ItemCommand(object sender, FormViewCommandEventArgs e)
|
||||
{
|
||||
// se è cancel ritorno ad altra pagina!
|
||||
if (e.CommandName == "Cancel")
|
||||
{
|
||||
Response.Redirect(returnPage);
|
||||
}
|
||||
}
|
||||
|
||||
protected void odsRA_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
// recupero valori non direttamente linkati...
|
||||
DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase");
|
||||
e.InputParameters["idxFase"] = ddlFase_int.SelectedValue;
|
||||
e.InputParameters["idxDipendente"] = DataProxy.idxDipendente;
|
||||
}
|
||||
|
||||
protected void odsRA_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
Response.Redirect(returnPage);
|
||||
}
|
||||
|
||||
protected void odsRA_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
Response.Redirect(returnPage);
|
||||
}
|
||||
|
||||
protected void odsRA_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
Response.Redirect(returnPage);
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo eventuali "headers"
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlFase_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// cerco eventuali controlli tipo "ancestor" e li disattivo!
|
||||
DropDownList ddlFase_int = (DropDownList)sender;
|
||||
ListItem li = new ListItem();
|
||||
while (li != null)
|
||||
{
|
||||
li = ddlFase_int.Items.FindByValue("0");
|
||||
try
|
||||
{
|
||||
li.Attributes.Add("style", "color:gray;");
|
||||
li.Attributes.Add("disabled", "true");
|
||||
li.Value = "-1";
|
||||
li.Text = string.Format("[ {0} ]", li.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
try
|
||||
{
|
||||
ddlFase_int.SelectedIndex = 1;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_attivitaIns {
|
||||
|
||||
/// <summary>
|
||||
/// frViewRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.FormView frViewRA;
|
||||
|
||||
/// <summary>
|
||||
/// odsRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRA;
|
||||
|
||||
/// <summary>
|
||||
/// odsProgetto control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsProgetto;
|
||||
|
||||
/// <summary>
|
||||
/// odsFase control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsFase;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_autocomplete.ascx.cs" Inherits="GPW.WebUserControls.mod_autocomplete" %>
|
||||
<%if (false)
|
||||
{ %>
|
||||
<%--<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
|
||||
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/themes/base/css" />--%>
|
||||
<%} %>
|
||||
<style>
|
||||
.ui-autocomplete {
|
||||
max-height: 36em;
|
||||
min-width: 20em;
|
||||
overflow-y: auto;
|
||||
/* prevent horizontal scrollbar */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
/* IE 6 doesn't support max-height
|
||||
* we use height instead, but this forces the menu to always be this tall
|
||||
*/
|
||||
* html .ui-autocomplete {
|
||||
height: 36em;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// funzione autocomplete
|
||||
function set<%=txtSel.ClientID %>()
|
||||
{
|
||||
$("#<%=txtSel.ClientID %>").autocomplete({
|
||||
source: function (request, response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
url: "<%=txtServiceUrl.Text %>",
|
||||
data: "{'prefixText':'" + request.term + "'}",
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function (data) {
|
||||
//response(data.d);
|
||||
response($.map(data.d, function (item) {
|
||||
return {
|
||||
label: item.split('#')[0],
|
||||
val: item.split('#')[1]
|
||||
}
|
||||
}))
|
||||
},
|
||||
error: function (result) {
|
||||
alert("Impossibile caricare i dati!");
|
||||
}
|
||||
});
|
||||
},
|
||||
select: function (e, i) {
|
||||
$("#<%=hiddenFieldID.ClientID %>").val(i.item.val);
|
||||
$("#<%=txtSel.ClientID %>").val(i.item.label);
|
||||
document.getElementById('<%=btnSearch.ClientID%>').click();
|
||||
//$("#<%=btnSearch.ClientID %>").click();
|
||||
},
|
||||
minLength: <%=txtMinCharAutoCom.Text %>
|
||||
});
|
||||
}
|
||||
// funzione x intercettare focusout...
|
||||
function fcsOut<%=txtSel.ClientID %>()
|
||||
{
|
||||
$("#<%=txtSel.ClientID %>").focusout(function() {
|
||||
// controllo se hidden diverso da txtsel...
|
||||
var str =$("#<%=txtSel.ClientID %>").val()
|
||||
if(str.search($("#<%=hiddenFieldID.ClientID %>").val())<0)
|
||||
{
|
||||
$("#<%=hiddenFieldID.ClientID %>").val($("#<%=txtSel.ClientID %>").val());
|
||||
}
|
||||
// chiamo search...
|
||||
document.getElementById('<%=btnSearch.ClientID%>').click();
|
||||
// alert...
|
||||
//alert('Valore hidden: ' +$("#<%=hiddenFieldID.ClientID %>").val());
|
||||
});
|
||||
}
|
||||
// aggancio evento doc pronto con jQuery...
|
||||
$(function () {
|
||||
set<%=txtSel.ClientID %>();
|
||||
fcsOut<%=txtSel.ClientID %>();
|
||||
});
|
||||
var prm = Sys.WebForms.PageRequestManager.getInstance();
|
||||
prm.add_endRequest(function () {
|
||||
$(function () {
|
||||
// chiamate jquery da rieseguire post ajax update x partial page render
|
||||
$(function () {
|
||||
set<%=txtSel.ClientID %>();
|
||||
fcsOut<%=txtSel.ClientID %>();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<%--controlli "principali"--%>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-btn" style="text-align: left;">
|
||||
<asp:LinkButton runat="server" ID="btnSearch" CssClass="btn btn-primary btn-sm" OnClick="btnSearch_Click">
|
||||
<i class="fa fa-search"></i>
|
||||
<asp:Label runat="server" ID="lblField"><%: traduci("Search") %></asp:Label>
|
||||
</asp:LinkButton>
|
||||
</span>
|
||||
<asp:TextBox runat="server" ID="txtSel" CssClass="searchinput form-control" OnTextChanged="txtSel_TextChanged" AutoPostBack="True" TextMode="SingleLine" AutoCompleteType="Search" />
|
||||
<%--controlli "accessori"--%>
|
||||
<asp:TextBox runat="server" ID="txtMinCharAutoCom" Text="2" Visible="false" Width="1em" />
|
||||
<asp:TextBox runat="server" ID="txtServiceUrl" Text="Services/WS_data.asmx/Test" Visible="false" Width="1em" />
|
||||
<span class="input-group-btn">
|
||||
<asp:LinkButton runat="server" ID="lnkReset" class="btn btn-primary btn-sm" OnClick="lnkReset_Click"><i class="fa fa-undo"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<asp:TextBox runat="server" ID="hiddenFieldID" AutoPostBack="true" OnTextChanged="hiddenFieldID_TextChanged" ViewStateMode="Enabled" Width="0px" Font-Size="6pt" BackColor="Transparent" BorderStyle="None" Height="0px" />
|
||||
|
||||
<style>
|
||||
.ui-autocomplete-category {
|
||||
font-weight: bold;
|
||||
padding: .2em .4em;
|
||||
margin: .8em 0 .2em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,329 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_autocomplete : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// evento valore selezionato
|
||||
/// </summary>
|
||||
public event EventHandler eh_valSelezionato;
|
||||
/// <summary>
|
||||
/// evento valore selezionato
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// segnaposto x casella testuale autocomplete
|
||||
/// </summary>
|
||||
public string placeholder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UID formattato con "_"
|
||||
/// </summary>
|
||||
public string uid
|
||||
{
|
||||
get
|
||||
{
|
||||
// fix brutale: nelle pagine master c'è un ctl00_ iniziale di troppo...
|
||||
return this.UniqueID.Replace("$", "_").Replace("ctl00_", "").Replace("ctl01_", "");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
defaultVal = "";
|
||||
txtSel.Attributes["placeholder"] = placeholder;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper traduzione
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma.ToString());
|
||||
}
|
||||
|
||||
protected void txtSel_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (txtSel.Text.Trim() == "")
|
||||
{
|
||||
hiddenFieldID.Text = defaultVal;
|
||||
_valore = defaultVal;
|
||||
}
|
||||
if (eh_valSelezionato != null)
|
||||
{
|
||||
eh_valSelezionato(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// salvo valore selezionato!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void hiddenFieldID_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
salvaSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// valore selezionato dal controllo (RW local)
|
||||
/// </summary>
|
||||
protected string _valore
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj(uid + "_sel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(uid + "_sel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salva evento selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnPost_Click(object sender, EventArgs e)
|
||||
{
|
||||
salvaSelezione();
|
||||
}
|
||||
|
||||
private void salvaSelezione()
|
||||
{
|
||||
_valore = hiddenFieldID.Text;
|
||||
if (eh_valSelezionato != null)
|
||||
{
|
||||
eh_valSelezionato(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// valore (chiave) selezionato dal controllo (R public)
|
||||
/// </summary>
|
||||
public string valore
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = hiddenFieldID.Text;
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = txtSel.Text.Trim();
|
||||
}
|
||||
if (answ == "")
|
||||
{
|
||||
answ = txtSel.Text.Trim();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hiddenFieldID.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// label selezionato dal controllo (R public)
|
||||
/// </summary>
|
||||
public string selezione
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtSel.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtSel.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// label dell'etichetta di ricerca
|
||||
/// </summary>
|
||||
public string labelRicerca
|
||||
{
|
||||
set
|
||||
{
|
||||
lblField.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// label dell'etichetta di ricerca CON TRADUZIONE
|
||||
/// </summary>
|
||||
public string labelRicercaTrad
|
||||
{
|
||||
set
|
||||
{
|
||||
lblField.Text = traduci(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// num minimo caratteri x autocomplete
|
||||
/// </summary>
|
||||
public Int32 minCharAutocomplete
|
||||
{
|
||||
get
|
||||
{
|
||||
return Convert.ToInt32(txtMinCharAutoCom.Text);
|
||||
}
|
||||
set
|
||||
{
|
||||
txtMinCharAutoCom.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// path del webservice (compreso metodo)
|
||||
/// nb: DI NORMA fornisce risultati nel formato label#valore
|
||||
/// </summary>
|
||||
public string ServicePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtServiceUrl.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtServiceUrl.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta visibilità della textBox delle chiavi
|
||||
/// </summary>
|
||||
public bool showKey
|
||||
{
|
||||
set
|
||||
{
|
||||
if (!value)
|
||||
{
|
||||
hiddenFieldID.Width = Unit.Pixel(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta la stringa tooltip
|
||||
/// </summary>
|
||||
public string toolTip
|
||||
{
|
||||
set
|
||||
{
|
||||
txtSel.ToolTip = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// larghezza textbox in unità EM
|
||||
/// </summary>
|
||||
public int textEmWidht
|
||||
{
|
||||
set
|
||||
{
|
||||
txtSel.Width = Unit.Parse(string.Format("{0}em", value));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// larghezza textbox in unità %
|
||||
/// </summary>
|
||||
public int textEmPerc
|
||||
{
|
||||
set
|
||||
{
|
||||
txtSel.Width = Unit.Parse(string.Format("{0}%", value));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta il focus sulla textBox
|
||||
/// </summary>
|
||||
public void setFocus()
|
||||
{
|
||||
txtSel.Focus();
|
||||
}
|
||||
/// <summary>
|
||||
/// permette di passare altri parametri di contesto al metodo invocato x autocomplete
|
||||
/// </summary>
|
||||
public string contextKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtSel.AccessKey;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtSel.AccessKey = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// tabIndex del controllo
|
||||
/// </summary>
|
||||
public short TabIndex
|
||||
{
|
||||
set
|
||||
{
|
||||
txtSel.TabIndex = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore di default (x reset)
|
||||
/// </summary>
|
||||
public string defaultVal { get; set; }
|
||||
/// <summary>
|
||||
/// resetta controllo
|
||||
/// </summary>
|
||||
public void doReset()
|
||||
{
|
||||
// resetto selezione e ricerca!
|
||||
txtSel.Text = "";
|
||||
hiddenFieldID.Text = defaultVal;
|
||||
_valore = defaultVal;
|
||||
}
|
||||
/// <summary>
|
||||
/// effettuato reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
doReset();
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stile x la label
|
||||
/// </summary>
|
||||
public Unit labelWidth
|
||||
{
|
||||
set
|
||||
{
|
||||
lblField.Width = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// dummy call x indicare selezione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
salvaSelezione();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_autocomplete {
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// lblField control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblField;
|
||||
|
||||
/// <summary>
|
||||
/// txtSel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtSel;
|
||||
|
||||
/// <summary>
|
||||
/// txtMinCharAutoCom control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtMinCharAutoCom;
|
||||
|
||||
/// <summary>
|
||||
/// txtServiceUrl control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtServiceUrl;
|
||||
|
||||
/// <summary>
|
||||
/// lnkReset control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lnkReset;
|
||||
|
||||
/// <summary>
|
||||
/// hiddenFieldID control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox hiddenFieldID;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_bCodeTimb.ascx.cs" Inherits="GPW.WebUserControls.mod_bCodeTimb" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlAll" CssClass="stileAttesa" Height="100%">
|
||||
<div style="height: 100%;">
|
||||
<div style="float: none; text-align: center; margin: auto;">
|
||||
<div class="fullPageHeader">
|
||||
<div style="float: left; text-align: left;">
|
||||
<asp:Label runat="server" ID="lblPostazione" />
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<asp:Label runat="server" ID="lblPrinter" />
|
||||
<br />
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblCurrentPage" Text="Postazione Timbrature Barcode" Font-Size="16pt" ForeColor="White" />
|
||||
<br />
|
||||
<asp:HyperLink runat="server" ID="hlMenu" NavigateUrl="~/Default.aspx" Text="Main Menu" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: none; text-align: center; margin: auto;">
|
||||
<div class="clearDiv">
|
||||
<asp:Label runat="server" ID="lblDipendenteAttivo" Font-Size="36pt" Text="..." />
|
||||
</div>
|
||||
<div class="msgBoxBarcode">
|
||||
<asp:Label runat="server" ID="lblMessaggi" Text="attesa input utente" Font-Size="18pt" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="divSx" style="padding: 4px; text-align: left; min-height: 400px; min-width: 200px; width: 19%;">
|
||||
<asp:Panel runat="server" ID="pnlBtnIn">
|
||||
<asp:Button runat="server" ID="btnEntrata" Text="Entrata" Width="200px" Height="300px" CssClass="fontTitolo" OnClick="btnEntrata_Click" />
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="divDx" style="padding: 4px; text-align: right; min-height: 400px; min-width: 200px; width: 19%;">
|
||||
<asp:Panel runat="server" ID="PaneOut">
|
||||
<asp:Button runat="server" ID="btnUscita" Text="Uscita" Width="200px" Height="300px" CssClass="fontTitolo" OnClick="btnUscita_Click" />
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="divCenter" style="min-height: 400px; width: 50%;">
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblBarcode" Text="Barcode" />
|
||||
<br />
|
||||
<asp:TextBox runat="server" ID="txtBarcode" Height="60px" Width="400px" Font-Size="32pt" AutoPostBack="true" Style="text-align: center"
|
||||
OnTextChanged="txtBarcode_TextChanged" TextMode="Password" />
|
||||
</div>
|
||||
<br />
|
||||
<div class="divCenter">
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="dataLav,idxDipendente"
|
||||
CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="9pt" Width="100%">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="data" SortExpression="dataLav" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("dataLav", "{0:dd-MM}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ent" SortExpression="entrata_1" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Bind("entrata_1","{0:HH:mm}") %>' ForeColor="#226622" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usc" SortExpression="uscita_1" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Bind("uscita_1","{0:HH:mm}") %>' ForeColor="#222266" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ent" SortExpression="entrata_2" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Bind("entrata_2","{0:HH:mm}") %>' ForeColor="#226622" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usc" SortExpression="uscita_2" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label6" runat="server" Text='<%# Bind("uscita_2","{0:HH:mm}") %>' ForeColor="#222266" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ent" SortExpression="entrata_3" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label7" runat="server" Text='<%# Bind("entrata_3","{0:HH:mm}") %>' ForeColor="#226622" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usc" SortExpression="uscita_3" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label8" runat="server" Text='<%# Bind("uscita_3","{0:HH:mm}") %>' ForeColor="#222266" Font-Size="X-Small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="H lav" SortExpression="h_lav" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<b>
|
||||
<asp:Label ID="Label11" runat="server" Text='<%# Bind("h_lav","{0:0.00}") %>' />
|
||||
</b>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<b>
|
||||
<asp:Label ID="lblIsOk" runat="server" Text="*" ForeColor="Red" Visible='<%# invBool(Eval("isOk")) %>' />
|
||||
</b>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" DeleteMethod="Delete" InsertMethod="Insert" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="getLastByUser" TypeName="GPW_data.DS_ApplicazioneTableAdapters.TimbratureExplTableAdapter" UpdateMethod="Update">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDipendente" Name="idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="num2show" DefaultValue="10" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||
<ContentTemplate>
|
||||
<asp:Panel ID="pnlTimer" runat="server" ScrollBars="None">
|
||||
<asp:Label runat="server" ID="lblNextTimbr" />
|
||||
<%--<asp:Image ID="imgRun" runat="server" ImageUrl="~/images/ajax-loader.gif" />--%>
|
||||
<b>
|
||||
<asp:Label runat="server" ID="lblCountDown" CssClass="fontMedio" /></b>
|
||||
<asp:Timer ID="timerConf" runat="server" Interval="500" Enabled="false">
|
||||
</asp:Timer>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="clearDiv clockBar" style="height: 72px;">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||
<ContentTemplate>
|
||||
<div class="divSx">
|
||||
<asp:Label runat="server" ID="lblData" Font-Size="48pt" Text="..." />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:Label runat="server" ID="lblRTC" Font-Size="48pt" Text="..." Font-Bold="true" />
|
||||
</div>
|
||||
<asp:Timer ID="timerClock" runat="server" Interval="5000" Enabled="true">
|
||||
</asp:Timer>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>--%>
|
||||
<%--<div class="clearDiv clockBar">
|
||||
<div class="clock">
|
||||
<div id="Date">
|
||||
</div>
|
||||
<ul>
|
||||
<li id="hours"></li>
|
||||
<li id="point">:</li>
|
||||
<li id="min"></li>
|
||||
<li id="point">:</li>
|
||||
<li id="sec"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
@@ -0,0 +1,488 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_bCodeTimb : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// salva il dato se il prox sia entrata...
|
||||
/// </summary>
|
||||
protected bool nextIsEntrata
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj("nextIsEntrata");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextIsEntrata", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// dataora associata all'evento scansioen BCode
|
||||
/// </summary>
|
||||
protected DateTime orarioBCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime)memLayer.ML.objSessionObj("dataOraBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataOraBCode", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// indica i secondi di countdown rimasti x auto-commit
|
||||
/// </summary>
|
||||
protected int countDown
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("countDownBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("countDownBCode", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// pagina corrente
|
||||
/// </summary>
|
||||
protected string paginaCorrente
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
Uri MyUrl = Request.Url;
|
||||
string delimStr = "/";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||
int n = finalUrl.Length;
|
||||
answ = finalUrl[n - 1].ToString();
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// prox messaggio utente (da mostrare)
|
||||
/// </summary>
|
||||
protected string nextUsrMsg
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("nextUsrMsg");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (answ == "")
|
||||
{
|
||||
answ = "...waiting...";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextUsrMsg", value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
chekIpPostazione();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
DataProxy.idxDipendente = -1;
|
||||
bool visibile = false;
|
||||
setCtrlState(visibile);
|
||||
checkBarcode();
|
||||
}
|
||||
timerConf.Tick += new EventHandler<EventArgs>(timerConf_Tick);
|
||||
#if false
|
||||
timerClock.Tick += new EventHandler<EventArgs>(timerClock_Tick);
|
||||
#endif
|
||||
lblDipendenteAttivo.Text = nextUsrMsg;
|
||||
txtBarcode.Focus();
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// timer x update orario indicato
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void timerClock_Tick(object sender, EventArgs e)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
lblData.Text = string.Format("{0:ddd} {0:dd/MM/yyyy}", adesso);
|
||||
lblRTC.Text = string.Format("{0:HH:mm}", adesso);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// verifica IP della postazione chiamante, se non è tra quelli permessi (o non è indicato "*") rimanda a pagina precedente...
|
||||
/// </summary>
|
||||
private void chekIpPostazione()
|
||||
{
|
||||
// recupero IP
|
||||
string IPv4 = Request.UserHostName;
|
||||
// controllo se IP locale = approvata...
|
||||
if (!memLayer.ML.confReadString("ipv4StazBCode").Contains(IPv4) && memLayer.ML.confReadString("ipv4StazBCode") != "*")
|
||||
{
|
||||
Response.Redirect("../Default.aspx");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// allo scadere del timer controllo countdown!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void timerConf_Tick(object sender, EventArgs e)
|
||||
{
|
||||
contatorePag = 0;
|
||||
if (countDown > 1)
|
||||
{
|
||||
countDown = countDown - 1;
|
||||
lblCountDown.Text = countDown.ToString();
|
||||
txtBarcode.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
// salvo operazione di default!
|
||||
registraTimbratura(nextIsEntrata);
|
||||
// reset visualizzazione
|
||||
setCtrlState(false);
|
||||
timerConf.Enabled = false;
|
||||
// reset valori
|
||||
Response.Redirect(paginaCorrente);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta lo stato visibile dei controlli
|
||||
/// </summary>
|
||||
/// <param name="visibile"></param>
|
||||
private void setCtrlState(bool visibile)
|
||||
{
|
||||
pnlTimer.Visible = visibile;
|
||||
//imgRun.Visible = visibile;
|
||||
if (DataProxy.idxDipendente > 0)
|
||||
{
|
||||
grView.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
grView.Visible = visibile;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica in che stato debbano essere i buttons (se barcode utente valido)
|
||||
/// </summary>
|
||||
private void checkButtons()
|
||||
{
|
||||
// controllo se il prox comando DOVREBBE essere entrata o uscita
|
||||
nextIsEntrata = true;
|
||||
// controllo dipendente
|
||||
if (DataProxy.idxDipendente > 0)
|
||||
{
|
||||
// ricavo ultima timbratura..
|
||||
nextIsEntrata = timbratrice.nextIsEntrata(DataProxy.idxDipendente);
|
||||
string tipoTimb = "uscita";
|
||||
// di conseguenza cambio abilitazione ad un buttons
|
||||
if (nextIsEntrata)
|
||||
{
|
||||
btnEntrata.CssClass = "btnPreferred";
|
||||
btnUscita.CssClass = "btnStd";
|
||||
tipoTimb = "ENTRATA";
|
||||
}
|
||||
else
|
||||
{
|
||||
btnEntrata.CssClass = "btnStd";
|
||||
btnUscita.CssClass = "btnPreferred";
|
||||
tipoTimb = "USCITA";
|
||||
}
|
||||
lblNextTimbr.Text = string.Format("Allo scadere del timer verrà registrata una timbratura di <b>{0}</b>", tipoTimb);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btnEntrata.CssClass = "btnStd";
|
||||
btnUscita.CssClass = "btnStd";
|
||||
lblNextTimbr.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// controlla se ci sia un barcode valido, tra:
|
||||
/// - idxDipendente (INT, eventuale padding di zero...)
|
||||
/// - matr dipendente
|
||||
/// - cf dipendente
|
||||
/// </summary>
|
||||
private void checkBarcode()
|
||||
{
|
||||
if (barcodeIn != "")
|
||||
{
|
||||
// mostro i buttons enabled
|
||||
btnEntrata.Enabled = true;
|
||||
btnUscita.Enabled = true;
|
||||
lblMessaggi.Text = "Barcode";
|
||||
switch (tipoBCode)
|
||||
{
|
||||
case tipoCodiceBarcode.idxDipendente:
|
||||
// calcolo idxOperatore...
|
||||
int idxOper = 0;
|
||||
try
|
||||
{
|
||||
idxOper = Convert.ToInt32(barcodeIn.ToLowerInvariant().Replace("idx", ""));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllo esista il codice idxDipendente scansionato
|
||||
if (DataProxy.DP.taDipendenti.getByIdx(idxOper).Rows.Count == 0)
|
||||
{
|
||||
setCtrlState(false);
|
||||
DataProxy.idxDipendente = 0;
|
||||
orarioBCode = DateTime.Now;
|
||||
timerConf.Enabled = false;
|
||||
nextUsrMsg = "...waiting...";
|
||||
lblMessaggi.Text += " - codice non valido / non trovato.";
|
||||
pnlAll.CssClass = "stileComandoKo";
|
||||
}
|
||||
else
|
||||
{
|
||||
setCtrlState(true);
|
||||
DataProxy.idxDipendente = idxOper;
|
||||
orarioBCode = DateTime.Now;
|
||||
DS_Applicazione.DipendentiRow rigaDip = DataProxy.DP.taDipendenti.getByIdx(idxOper)[0];
|
||||
nextUsrMsg = string.Format("{0} {1} - {2: HH:mm:ss}", rigaDip.Cognome, rigaDip.Nome, orarioBCode);
|
||||
lblMessaggi.Text += " - impostato dipendente!";
|
||||
pnlAll.CssClass = "stileComandoOk";
|
||||
// faccio partire countdown
|
||||
countDown = SteamWare.memLayer.ML.confReadInt("secTimeoutBCode");
|
||||
lblCountDown.Text = countDown.ToString();
|
||||
timerConf.Enabled = true;
|
||||
}
|
||||
txtBarcode.Focus();
|
||||
break;
|
||||
case tipoCodiceBarcode.matrDipendente:
|
||||
// fare!!!
|
||||
txtBarcode.Focus();
|
||||
break;
|
||||
case tipoCodiceBarcode.cfDipendente:
|
||||
// fare!!!
|
||||
txtBarcode.Focus();
|
||||
break;
|
||||
case tipoCodiceBarcode.Comando:
|
||||
// procedo SOLO se ho cod dipendente
|
||||
if (DataProxy.DP.taDipendenti.getByIdx(DataProxy.idxDipendente).Rows.Count > 0)
|
||||
{
|
||||
timerConf.Enabled = false;
|
||||
setCtrlState(false);
|
||||
}
|
||||
nextUsrMsg = "...waiting...";
|
||||
// controlla se sia entra/esci (IN/OUT)
|
||||
if (barcodeIn.ToUpperInvariant() == "CMDIN")
|
||||
{
|
||||
// registro ingresso!
|
||||
registraTimbratura(true);
|
||||
Response.Redirect(paginaCorrente);
|
||||
}
|
||||
else if (barcodeIn.ToUpperInvariant() == "CMDOUT")
|
||||
{
|
||||
// registro uscita!
|
||||
registraTimbratura(false);
|
||||
Response.Redirect(paginaCorrente);
|
||||
}
|
||||
//else if (barcodeIn.ToUpperInvariant() == "CMD")
|
||||
//{
|
||||
// Response.Redirect(paginaCorrente);
|
||||
//}
|
||||
//DataProxy.idxDipendente = -1;
|
||||
txtBarcode.Focus();
|
||||
break;
|
||||
default:
|
||||
txtBarcode.Focus();
|
||||
break;
|
||||
}
|
||||
barcodeIn = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessaggi.Text = "...attesa barcode...";
|
||||
}
|
||||
grView.DataBind();
|
||||
checkButtons();
|
||||
txtBarcode.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// valore barcode
|
||||
/// </summary>
|
||||
public string barcodeIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtBarcode.Text.Trim();
|
||||
}
|
||||
set
|
||||
{
|
||||
txtBarcode.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo entrata
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEntrata_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo entrata...
|
||||
registraTimbratura(true);
|
||||
Response.Redirect(paginaCorrente);
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo uscita
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUscita_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo uscita
|
||||
registraTimbratura(false);
|
||||
Response.Redirect(paginaCorrente);
|
||||
}
|
||||
/// <summary>
|
||||
/// registro timbratura
|
||||
/// </summary>
|
||||
/// <param name="isEntrata"></param>
|
||||
/// <returns></returns>
|
||||
private void registraTimbratura(bool isEntrata)
|
||||
{
|
||||
// salvo evento entrata...
|
||||
string IPv4 = Request.UserHostName;
|
||||
// auto-approvazione da web.config
|
||||
bool approvata = memLayer.ML.confReadBool("barcodeAutoApprove");
|
||||
if (DataProxy.idxDipendente > 0)
|
||||
{
|
||||
string CognomeNome = "";
|
||||
if (memLayer.ML.confReadBool("showNameAfterCmd"))
|
||||
{
|
||||
CognomeNome = DataProxy.DP.CognomeNomeByIdx(DataProxy.idxDipendente);
|
||||
}
|
||||
if (nextIsEntrata)
|
||||
{
|
||||
nextUsrMsg = string.Format("{1} ENTRATA {0:HH:mm:ss}", orarioBCode, CognomeNome);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextUsrMsg = string.Format("{1} USCITA {0:HH:mm:ss}", orarioBCode, CognomeNome);
|
||||
}
|
||||
timbratrice.registraTimbratura(DataProxy.idxDipendente, orarioBCode, isEntrata, IPv4, "Web", approvata);
|
||||
//aggiorno timbrature visualizzate
|
||||
setButtons();
|
||||
grView.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessaggi.Text = "IdxDipendente non trovato! timbratura impossibile";
|
||||
pnlAll.CssClass = "stileComandoND";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta i buttons secondo i valori in sessione...
|
||||
/// </summary>
|
||||
private void setButtons()
|
||||
{
|
||||
// mostrare e abilitare secondo condizioni al contorno
|
||||
}
|
||||
/// <summary>
|
||||
/// decodifica il tipo barcode acquisito
|
||||
/// </summary>
|
||||
public tipoCodiceBarcode tipoBCode
|
||||
{
|
||||
get
|
||||
{
|
||||
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
|
||||
// controllo non si tratti di un comando...
|
||||
string preCmd = memLayer.ML.confReadString("prefComandi");
|
||||
if (barcodeIn.StartsWith(preCmd, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
answ = tipoCodiceBarcode.Comando;
|
||||
}
|
||||
// controllo se sia un codice "idx"
|
||||
else if (barcodeIn.StartsWith("idx", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
answ = tipoCodiceBarcode.idxDipendente;
|
||||
}
|
||||
// controllo se sia un codice "matr"
|
||||
else if (barcodeIn.StartsWith("matr", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
answ = tipoCodiceBarcode.matrDipendente;
|
||||
}
|
||||
// controllo se sia un codice "cf"
|
||||
else if (barcodeIn.StartsWith("cf", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
answ = tipoCodiceBarcode.cfDipendente;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// evento cambio testo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtBarcode_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
// solo se ho ALMENO 3 char...
|
||||
if (barcodeIn.Length >= 3)
|
||||
{
|
||||
contatorePag = 0;
|
||||
checkBarcode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// variabile che conta numero di refresh parziali prima di fare reload completo
|
||||
/// </summary>
|
||||
protected int contatorePag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("numChiamatePaginaBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("numChiamatePaginaBCode", value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_bCodeTimb {
|
||||
|
||||
/// <summary>
|
||||
/// pnlAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlAll;
|
||||
|
||||
/// <summary>
|
||||
/// lblPostazione control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPostazione;
|
||||
|
||||
/// <summary>
|
||||
/// lblPrinter control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPrinter;
|
||||
|
||||
/// <summary>
|
||||
/// lblCurrentPage control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCurrentPage;
|
||||
|
||||
/// <summary>
|
||||
/// hlMenu control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlMenu;
|
||||
|
||||
/// <summary>
|
||||
/// lblDipendenteAttivo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDipendenteAttivo;
|
||||
|
||||
/// <summary>
|
||||
/// lblMessaggi control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMessaggi;
|
||||
|
||||
/// <summary>
|
||||
/// pnlBtnIn control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlBtnIn;
|
||||
|
||||
/// <summary>
|
||||
/// btnEntrata control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnEntrata;
|
||||
|
||||
/// <summary>
|
||||
/// PaneOut control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel PaneOut;
|
||||
|
||||
/// <summary>
|
||||
/// btnUscita control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnUscita;
|
||||
|
||||
/// <summary>
|
||||
/// lblBarcode control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblBarcode;
|
||||
|
||||
/// <summary>
|
||||
/// txtBarcode control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtBarcode;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// UpdatePanel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel UpdatePanel1;
|
||||
|
||||
/// <summary>
|
||||
/// pnlTimer control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlTimer;
|
||||
|
||||
/// <summary>
|
||||
/// lblNextTimbr control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNextTimbr;
|
||||
|
||||
/// <summary>
|
||||
/// lblCountDown control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCountDown;
|
||||
|
||||
/// <summary>
|
||||
/// timerConf control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer timerConf;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_barPlot.ascx.cs" Inherits="GPW.WebUserControls.mod_barPlot" %>
|
||||
<asp:Table runat="server" ID ="tblData" CellPadding="0" CellSpacing="0">
|
||||
</asp:Table>
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_barPlot : System.Web.UI.UserControl
|
||||
{
|
||||
protected SteamWare.DataType.DatoBarPlot[] _elencoValori;
|
||||
public double resolution { get; set; }
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
//doPlot();
|
||||
}
|
||||
|
||||
public SteamWare.DataType.DatoBarPlot[] elencoValori
|
||||
{
|
||||
get
|
||||
{
|
||||
return _elencoValori;
|
||||
}
|
||||
set
|
||||
{
|
||||
_elencoValori = value;
|
||||
doPlot();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// esegue plotting, creando tante celle quanti i valori dell'array passato
|
||||
/// </summary>
|
||||
private void doPlot()
|
||||
{
|
||||
try
|
||||
{
|
||||
TableRow riga = new TableRow();
|
||||
TableCell cell;
|
||||
for (int i = 0; i < _elencoValori.Length; i++)
|
||||
{
|
||||
// solo se >0 aggiungo cella...
|
||||
if (_elencoValori[i].valore > 0)
|
||||
{
|
||||
cell = new TableCell();
|
||||
cell.CssClass = _elencoValori[i].css;
|
||||
// se il valore è sotto 10px NON metto il testo...
|
||||
if ((_elencoValori[i].valore / resolution) > 20)
|
||||
{
|
||||
cell.Text = _elencoValori[i].label;
|
||||
}
|
||||
cell.Width = Convert.ToInt32(Math.Ceiling((double)_elencoValori[i].valore / resolution));
|
||||
cell.ToolTip = _elencoValori[i].tooltip;
|
||||
riga.Cells.Add(cell);
|
||||
}
|
||||
}
|
||||
tblData.Rows.Add(riga);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_barPlot {
|
||||
|
||||
/// <summary>
|
||||
/// tblData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Table tblData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commAttivita.ascx.cs" Inherits="GPW.WebUserControls.mod_commAttivita" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<ul data-role="listview" data-inset="false" data-theme="d" data-divider-theme="b">
|
||||
<li data-role="list-divider">
|
||||
<asp:Panel runat="server" data-role="popup" ID="popupBasic" ClientIDMode="Static">
|
||||
<p>
|
||||
<asp:Calendar runat="server" ID="calDataRif" OnSelectionChanged="calDataRif_SelectionChanged" />
|
||||
<p>
|
||||
</asp:Panel>
|
||||
<div class="ui-grid-b">
|
||||
<div class="ui-block-a">
|
||||
<a href="#popupBasic" data-rel="popup" data-role="button" data-mini="true">
|
||||
<asp:Label runat="server" ID="lblDataRif" /></a>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:LinkButton runat="server" ID="lnkCreateNew" Text="Aggiungi" OnClick="lnkCreateNew_Click" data-icon="plus" data-mini="true" data-iconpos="right" data-role="button" />
|
||||
</div>
|
||||
<div class="ui-block-c">
|
||||
<asp:Label runat="server" ID="lblTotOreRA" Style="font-weight: normal; font-size: 12pt;" Text="..." CssClass="ui-li-count"
|
||||
ToolTip="Ore caricate a commessa / ore lavorate da timbrature" />
|
||||
</div>
|
||||
</li>
|
||||
<asp:Repeater ID="repRegAtt" runat="server" DataSourceID="odsRegAtt">
|
||||
<ItemTemplate>
|
||||
<li data-theme="c">
|
||||
<asp:LinkButton runat="server" ID="lnkEdit" OnClick="lnkEdit_Click" CommandArgument='<%# Eval("idxRA") %>'>
|
||||
<p>
|
||||
<b>
|
||||
<asp:Label ID="lblCli" runat="server" Style="font-size: 10pt;" Text='<%# cliByIdxFase(Eval("idxFase")) %>' ForeColor="#6988AA" /> -
|
||||
<asp:Label ID="lblPrj" runat="server" Style="font-size: 10pt;" Text='<%# prjByIdxFase(Eval("idxFase")) %>' /></b>
|
||||
</p>
|
||||
<div class="ui-li-count" style="font-weight: normal; font-size: 10pt;">
|
||||
<asp:Label ID="inizioLabel" runat="server" Text='<%# Eval("inizio","{0:HH:mm}") %>' />
|
||||
-
|
||||
<asp:Label ID="fineLabel" runat="server" Text='<%# Eval("fine","{0:HH:mm}") %>' />
|
||||
</div>
|
||||
<p>
|
||||
<asp:Label ID="lblFase" runat="server" Text='<%# faseByIdx(Eval("idxFase")) %>' ForeColor="#696969" />
|
||||
</p>
|
||||
<p>
|
||||
<asp:Label ID="descrizioneLabel" runat="server" Text='<%# Eval("descrizione") %>' />
|
||||
</p>
|
||||
</asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lnkClona" OnClick="lnkClona_Click" CommandArgument='<%# Eval("idxRA") %>' data-icon="plus"
|
||||
data-theme="e" Text="Duplica" />
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
<%-- <AlternatingItemTemplate>
|
||||
<li data-theme="e" style="margin-top: -5px;">
|
||||
<asp:LinkButton runat="server" ID="lnkEdit" OnClick="lnkEdit_Click" CommandArgument='<%# Eval("idxRA") %>'>
|
||||
<p>
|
||||
<b>
|
||||
<asp:Label ID="lblCli" runat="server" Style="font-size: 10pt;" Text='<%# cliByIdxFase(Eval("idxFase")) %>' ForeColor="#6988AA" /> -
|
||||
<asp:Label ID="lblPrj" runat="server" Style="font-size: 10pt;" Text='<%# prjByIdxFase(Eval("idxFase")) %>' /></b>
|
||||
</p>
|
||||
<div class="ui-li-count" style="font-weight: normal; font-size: 10pt;">
|
||||
<asp:Label ID="inizioLabel" runat="server" Text='<%# Eval("inizio","{0:HH:mm}") %>' />
|
||||
-
|
||||
<asp:Label ID="fineLabel" runat="server" Text='<%# Eval("fine","{0:HH:mm}") %>' />
|
||||
</div>
|
||||
<p>
|
||||
<asp:Label ID="lblFase" runat="server" Text='<%# faseByIdx(Eval("idxFase")) %>' ForeColor="#696969" />
|
||||
</p>
|
||||
<p>
|
||||
<asp:Label ID="descrizioneLabel" runat="server" Text='<%# Eval("descrizione") %>' />
|
||||
</p>
|
||||
</asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lnkCLona" OnClick="lnkEdit_Click" CommandArgument='<%# Eval("idxRA") %>' data-icon="star" data-theme="e" Text="Duplica" />
|
||||
</li>
|
||||
</AlternatingItemTemplate>--%>
|
||||
</asp:Repeater>
|
||||
<asp:ObjectDataSource ID="odsRegAtt" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByDipData"
|
||||
TypeName="GPW_data.DS_ApplicazioneTableAdapters.RegAttivitaTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="1" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
|
||||
<asp:SessionParameter Name="dataFrom" SessionField="dataFromRA" Type="DateTime" />
|
||||
<asp:SessionParameter Name="dataTo" SessionField="dataToRA" Type="DateTime" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</ul>
|
||||
@@ -0,0 +1,197 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_commAttivita : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
setupPage();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// pagina di return a fine editing
|
||||
/// </summary>
|
||||
public string returnPage
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = memLayer.ML.confReadString("baseUrl");
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("returnPage");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("returnPage", value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// data riferimento (selezionata) da session
|
||||
/// </summary>
|
||||
public DateTime dataRif
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataRif", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta la pagina
|
||||
/// </summary>
|
||||
private void setupPage()
|
||||
{
|
||||
// salvo dataFrom/To x visualizzazione attivita
|
||||
lblDataRif.Text = dataRif.ToString("dd.MM.yy");
|
||||
// recupero dati della commessa utente giornaliera...
|
||||
try
|
||||
{
|
||||
int maxErrMinus = memLayer.ML.confReadInt("maxErrMinus");
|
||||
int maxErrPlus = memLayer.ML.confReadInt("maxErrPlus");
|
||||
DS_Applicazione.v_logCommUtRow rigaLog = DataProxy.DP.taLCU.getByIdxDipDate(memLayer.ML.IntSessionObj("idxDipendente"), dataRif, dataRif.AddDays(1), maxErrMinus, maxErrPlus)[0];
|
||||
lblTotOreRA.Text = string.Format("{0:0.##} h / {1:0.##} h", rigaLog.h_com, rigaLog.h_lav);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblTotOreRA.Text = "...";
|
||||
}
|
||||
memLayer.ML.setSessionVal("dataFromRA", dataRif.Date);
|
||||
memLayer.ML.setSessionVal("dataToRA", dataRif.AddDays(1).Date);
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera cliente da idxFase
|
||||
/// </summary>
|
||||
/// <param name="idxFase"></param>
|
||||
/// <returns></returns>
|
||||
public string cliByIdxFase(object _idxFase)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
int idxFase = Convert.ToInt32(_idxFase);
|
||||
DS_Applicazione.AnagFasiRow fase = DataProxy.DP.taAF.getByIdx(idxFase)[0];
|
||||
int idxPrj = Convert.ToInt32(fase.idxProgetto);
|
||||
DS_Applicazione.AnagProgettiRow progetto = DataProxy.DP.taAP.getByIdxPrj(idxPrj)[0];
|
||||
answ = DataProxy.DP.taAnCli.getByIdx(progetto.idxCliente)[0].RagSociale;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera progetto da idxFase
|
||||
/// </summary>
|
||||
/// <param name="idxFase"></param>
|
||||
/// <returns></returns>
|
||||
public string prjByIdxFase(object _idxFase)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
int idxFase = Convert.ToInt32(_idxFase);
|
||||
DS_Applicazione.AnagFasiRow fase = DataProxy.DP.taAF.getByIdx(idxFase)[0];
|
||||
int idxPrj = Convert.ToInt32(fase.idxProgetto);
|
||||
DS_Applicazione.AnagProgettiRow progetto = DataProxy.DP.taAP.getByIdxPrj(idxPrj)[0];
|
||||
answ = progetto.nomeProj;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera descrizione e nome fase da idxFase
|
||||
/// </summary>
|
||||
/// <param name="idxFase"></param>
|
||||
/// <returns></returns>
|
||||
public string faseByIdx(object _idxFase)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
int idxFase = Convert.ToInt32(_idxFase);
|
||||
DS_Applicazione.AnagFasiRow fase = DataProxy.DP.taAF.getByIdx(idxFase)[0];
|
||||
answ = string.Format("{0} <i>({1})</i>", fase.nomeFase, fase.descrizioneFase);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// rimanda ad edit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo
|
||||
LinkButton lbtn = (LinkButton)sender;
|
||||
memLayer.ML.setSessionVal("idxRASel", lbtn.CommandArgument);
|
||||
// redirect!
|
||||
Response.Redirect("attivitaIns.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// rimanda ad edit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lnkClona_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo
|
||||
LinkButton lbtn = (LinkButton)sender;
|
||||
int idxRa=0;
|
||||
try
|
||||
{
|
||||
idxRa = Convert.ToInt32(lbtn.CommandArgument);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiamo clona!
|
||||
DataProxy.DP.taRA.clonaRecord(idxRa);
|
||||
//update!
|
||||
setupPage();
|
||||
repRegAtt.DataBind();
|
||||
}
|
||||
protected void lnkCreateNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.emptySessionVal("idxRASel");
|
||||
// redirect!
|
||||
Response.Redirect("attivitaIns.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorno data selezionata!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void calDataRif_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
dataRif = calDataRif.SelectedDate;
|
||||
setupPage();
|
||||
repRegAtt.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_commAttivita {
|
||||
|
||||
/// <summary>
|
||||
/// popupBasic control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel popupBasic;
|
||||
|
||||
/// <summary>
|
||||
/// calDataRif control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Calendar calDataRif;
|
||||
|
||||
/// <summary>
|
||||
/// lblDataRif control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDataRif;
|
||||
|
||||
/// <summary>
|
||||
/// lnkCreateNew control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lnkCreateNew;
|
||||
|
||||
/// <summary>
|
||||
/// lblTotOreRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTotOreRA;
|
||||
|
||||
/// <summary>
|
||||
/// repRegAtt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repRegAtt;
|
||||
|
||||
/// <summary>
|
||||
/// odsRegAtt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRegAtt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commAttivitaDesk.ascx.cs" Inherits="GPW.WebUserControls.mod_commAttivitaDesk" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="mod_dateTime.ascx" TagName="mod_dateTime" TagPrefix="uc1" %>
|
||||
<%@ Register Src="mod_autocomplete.ascx" TagPrefix="uc2" TagName="mod_autocomplete" %>
|
||||
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
|
||||
<asp:Panel runat="server" ID="pnlAll" Height="100%">
|
||||
<asp:Panel runat="server" ID="pnlHeader" class="dataBlockHeader" Style="height: 30px; text-align: center; margin: auto; font-size: 12pt;">
|
||||
<asp:Label runat="server" ID="lblTitle" />
|
||||
<div class="divDx">
|
||||
<asp:ImageButton ID="imgBtnNew" runat="server" ToolTip="Nuovo" CausesValidation="False" OnClick="btnNew_Click" ImageUrl="~/images/new_l.png" />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<div class="dataBlockReset" style="padding: 4px 0px 4px 0px;">
|
||||
<asp:GridView ID="grView" runat="server" DataSourceID="odsRA" AutoGenerateColumns="False" OnRowDeleted="grView_RowDeleted"
|
||||
OnRowCommand="grView_RowCommand" DataKeyNames="idxRA" OnRowDataBound="grView_RowDataBound" OnRowEditing="grView_RowEditing"
|
||||
ShowHeader="false" Width="100%" OnRowUpdated="grView_RowUpdated">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerRowStyle" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<EmptyDataTemplate>
|
||||
<div style="background-color: #ACACAC;">
|
||||
Nessun record COMMESSA
|
||||
</div>
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgClona" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxRA") %>' CommandName="Update"
|
||||
ToolTip='<%# traduci("Duplica") %>' ImageUrl="../images/clonaObj_l.png" OnClick="imgClona_Click" Visible='<%# enableFull %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Record Commesse">
|
||||
<ItemTemplate>
|
||||
<div>
|
||||
<asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'
|
||||
CssClass="noLink" Enabled='<%# enableFull %>'>
|
||||
<div style="padding: 4px 4px 1px 4px; width: 326px;">
|
||||
<div class="divSx">
|
||||
<div style="font-size: 10pt; color: Black;">
|
||||
<b>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("RagSociale") %>' /></b>|
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("nomeProj") %>' ForeColor="GrayText" Font-Size="8pt" />
|
||||
</div>
|
||||
<div style="font-size: 8pt;">
|
||||
<asp:Label ID="Label10" runat="server" Text='<%# Eval("nomeFase") %>' ForeColor="Green" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="divDx" style="text-align: right; white-space: nowrap; right: 0px; top: 0px;">
|
||||
<div class="ui-corner-all" style="font-size: 8pt; background: #EEE; border: 1px solid #333; color: #333; padding: .1em;">
|
||||
<asp:Label ID="Label11" runat="server" Text='<%# Eval("inizio","{0:HH:mm}") %>' />
|
||||
-
|
||||
<asp:Label ID="Label12" runat="server" Text='<%# Eval("fine","{0:HH:mm}") %>' />
|
||||
</div>
|
||||
<div style="font-size: 11pt; color: #333; padding: .1em;">
|
||||
<b>
|
||||
<asp:Label ID="Label13" runat="server" Text='<%# formatDurata(Eval("oreTot")) %>' /></b> h
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv" style="font-size: 8pt; padding: 1px 4px 4px 4px; color: #333;">
|
||||
<div style="font-size: 8pt;">
|
||||
<asp:Label ID="Label9" runat="server" Text='<%# Eval("descrizione").ToString().Replace(Environment.NewLine,"<br />").Replace("\n","<br />") %>' />
|
||||
</div>
|
||||
</div>
|
||||
</asp:LinkButton></div></ItemTemplate><EditItemTemplate>
|
||||
<div style="padding: 4px 0px 0px 4px; width: 326px;">
|
||||
<div>
|
||||
<div class="divSx">
|
||||
<div>
|
||||
<label for="ddlProgetto" style="font-size: x-small;">
|
||||
Progetto </label><br /><asp:DropDownList ID="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" Font-Size="8pt" Width="22em">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ddlFase" style="font-size: x-small;">
|
||||
Fase </label><br /><asp:DropDownList ID="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value" Font-Size="8pt"
|
||||
OnDataBound="ddlFase_DataBound" Width="22em">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divSx" style="padding-left: 4px;">
|
||||
<label for="txtSearchFase" style="font-size: x-small;">
|
||||
<-- Search</label> <br /><asp:TextBox runat="server" ID="txtSearchFase" AutoPostBack="true" Width="80px" Font-Size="8pt" OnTextChanged="txtSearchFase_TextChanged" TextMode="MultiLine" />
|
||||
<%--<br />
|
||||
<uc2:mod_autocomplete runat="server" ID="acSearchFase" minCharAutocomplete="2" showKey="false" ServicePath="../Services/WS_data.asmx/ElencoFasi" placeholder="Search" labelRicerca="search" labelWidth="45px" />--%>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="divSx">
|
||||
<uc1:mod_dateTime ID="dtInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<uc1:mod_dateTime ID="dtFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
|
||||
</div>
|
||||
<div class="divCenter">
|
||||
</div></div><br />descrizione: <asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="6em" Width="24em" />
|
||||
<div class="divCenter" style="height: 36px;">
|
||||
<div class="divSx third" style="padding: 2px 4px 2px 4px; margin: auto; text-align: center; height: 20px;">
|
||||
<asp:Button runat="server" ID="btnInsert" Text="Aggiorna" CssClass="btnVerde ui-corner-all shadowBox btnNew" CommandName="Update"
|
||||
CausesValidation="true" />
|
||||
</div>
|
||||
<div class="divDx third" style="padding: 2px 4px 2px 4px; margin: auto; text-align: center; height: 20px;">
|
||||
<asp:Button runat="server" ID="btnInsertCancel" Text="Annulla" CssClass="btnRosso ui-corner-all shadowBox btnChiudi" CommandName="Cancel" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<div style="padding: 4px 0px 0px 4px; width: 326px;">
|
||||
<div>
|
||||
<div class="divSx">
|
||||
<div>
|
||||
<label for="ddlProgetto" style="font-size: x-small;">
|
||||
Progetto </label><br /><asp:DropDownList ID="ddlProgetto" runat="server" DataSourceID="odsProgetto" DataTextField="label" DataValueField="value"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlProgetto_SelectedIndexChanged" Font-Size="8pt" Width="22em">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ddlFase" style="font-size: x-small;">
|
||||
Fase </label><br /><asp:DropDownList ID="ddlFase" runat="server" DataSourceID="odsFase" DataTextField="label" DataValueField="value" Font-Size="8pt"
|
||||
OnDataBound="ddlFase_DataBound" Width="22em">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divSx" style="padding-left: 4px;">
|
||||
<label for="txtSearchFase" style="font-size: x-small;">
|
||||
<-- Search</label> <br /><asp:TextBox runat="server" ID="txtSearchFase" AutoPostBack="true" Width="80px" Font-Size="8pt" OnTextChanged="txtSearchFase_TextChanged" TextMode="MultiLine" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="clearDiv">
|
||||
<div class="divSx">
|
||||
<uc1:mod_dateTime ID="dtInizio" runat="server" valoreDateTime='<%# Bind("inizio") %>' labelData="Inizio" labelOra="Ora" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<uc1:mod_dateTime ID="dtFine" runat="server" valoreDateTime='<%# Bind("fine") %>' labelData="Fine" labelOra="Ora" />
|
||||
</div>
|
||||
<div class="divCenter">
|
||||
</div></div><br />descrizione: <asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("descrizione") %>' TextMode="MultiLine" Height="6em" Width="24em" />
|
||||
<div class="divCenter" style="height: 36px;">
|
||||
<div class="divSx third" style="padding: 2px 4px 2px 4px; margin: auto; text-align: center; height: 20px;">
|
||||
<asp:Button runat="server" ID="btnInsert" Text="Salva" CssClass="btnVerde ui-corner-all shadowBox btnNew" CommandName="Insert"
|
||||
CausesValidation="true" />
|
||||
</div>
|
||||
<div class="divDx third" style="padding: 2px 4px 2px 4px; margin: auto; text-align: center; height: 20px;">
|
||||
<asp:Button runat="server" ID="btnInsertCancel" Text="Annulla" CssClass="btnRosso ui-corner-all shadowBox btnChiudi" CommandName="Cancel" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("idxRA") %>' CommandName="Delete"
|
||||
ImageUrl="../images/elimina_l.png" ToolTip='<%# traduci("Delete") %>' Visible='<%# enableFull %>' />
|
||||
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="imgDelete"></asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="odsRA" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.regAttDayExplTableAdapter"
|
||||
DeleteMethod="deleteQuery" InsertMethod="insertQuery" OnInserted="odsRA_Inserted" UpdateMethod="updateQuery" OnUpdating="odsRA_Updating">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxRA" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="idxDipendente" SessionField="idxDipCurr" Type="Int32" />
|
||||
<asp:SessionParameter Name="dataRif" SessionField="dataRif" Type="DateTime" />
|
||||
</SelectParameters>
|
||||
<InsertParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="idxFase" Type="Int32" />
|
||||
<asp:Parameter Name="inizio" Type="DateTime" />
|
||||
<asp:Parameter Name="fine" Type="DateTime" />
|
||||
<asp:Parameter Name="descrizione" Type="String" />
|
||||
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxDipendente" SessionField="idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="idxFase" Type="Int32" />
|
||||
<asp:Parameter Name="inizio" Type="DateTime" />
|
||||
<asp:Parameter Name="fine" Type="DateTime" />
|
||||
<asp:Parameter Name="descrizione" Type="String" />
|
||||
<asp:Parameter Name="importo" Type="Decimal" DefaultValue="0" />
|
||||
<asp:Parameter Name="Original_idxRA" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsProgetto" runat="server" SelectMethod="getGrouped" TypeName="GPW_data.DS_UtilityTableAdapters.v_selProgettiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="true" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selFasiOptTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxProjSel" DefaultValue="0" Name="conditio" Type="Int32" />
|
||||
<asp:Parameter DefaultValue="false" Name="soloAttivi" Type="Boolean" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
@@ -0,0 +1,635 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
using System.Data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_commAttivitaDesk : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
#region area protected / private
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
refreshControlli();
|
||||
pnlHeader.Visible = enableFull;
|
||||
lblTitle.Text = string.Format("{0:dddd dd/MM/yyyy}", valoreDateTime);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// minuti selezionati nel controllo radio in testa
|
||||
/// </summary>
|
||||
protected int minutiSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("stdMinDurata");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("stdMinDurata", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// refresh dei controlli
|
||||
/// </summary>
|
||||
private void refreshControlli()
|
||||
{
|
||||
bool doDataBound = true;
|
||||
switch (stato)
|
||||
{
|
||||
case statoControllo.edit:
|
||||
doDataBound = true;
|
||||
//grView.ShowFooter = false;
|
||||
//grView.SelectedIndex = grView.EditIndex;
|
||||
//int idxRASel = Convert.ToInt32(grView.SelectedDataKey["idxRA"]);
|
||||
//// pre-seleziono idx progetto x ods fase...
|
||||
//idxFaseSel = DataProxy.DP.taRA.getByKey(idxRASel)[0].idxFase;
|
||||
//idxProjSel = idxPrjByFase(idxFaseSel);
|
||||
break;
|
||||
case statoControllo.insert:
|
||||
grView.ShowFooter = true;
|
||||
grView.DataBind();
|
||||
// imposto arrotondato ad ora...
|
||||
DateTime inizio = valoreDateTime.Date.AddHours(DateTime.Now.Hour);
|
||||
// imposto durate standard!
|
||||
int minuti = minutiSel;
|
||||
if (minuti < 0)
|
||||
{
|
||||
minuti = 60;
|
||||
}
|
||||
// cerco ultimo valore inserito odierno (se c'è)
|
||||
try
|
||||
{
|
||||
DS_Applicazione.RegAttivitaDataTable tabRA = DataProxy.DP.taRA.getByDipData(idxDipCurr, inizio.Date, inizio.Date.AddDays(1));
|
||||
inizio = tabRA[tabRA.Rows.Count - 1].fine;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
#if false
|
||||
// provo a leggere valore editato (se c'è...)
|
||||
try
|
||||
{
|
||||
DateTime inizioSel = ((mod_dateTime)grView.FooterRow.FindControl("dtInizio")).valoreDateTime;
|
||||
if (inizioSel != inizio && inizio != valoreDateTime.Date.AddHours(DateTime.Now.Hour)) inizio = inizioSel;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
#endif
|
||||
// cerco di impostare inizio/fine
|
||||
try
|
||||
{
|
||||
((mod_dateTime)grView.FooterRow.FindControl("dtInizio")).valoreDateTime = inizio;
|
||||
((mod_dateTime)grView.FooterRow.FindControl("dtFine")).valoreDateTime = inizio.AddMinutes(minuti);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
doDataBound = false;
|
||||
break;
|
||||
case statoControllo.item:
|
||||
grView.ShowFooter = false;
|
||||
// cerco di impostare inizio/fine
|
||||
if (grView.EditIndex >= 0)
|
||||
{
|
||||
if (minutiSel > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
//salvo valori selezionati
|
||||
string descrizione = ((TextBox)grView.Rows[grView.EditIndex].FindControl("txtDescrizione")).Text;
|
||||
DateTime inizioEdit = ((mod_dateTime)grView.Rows[grView.EditIndex].FindControl("dtInizio")).valoreDateTime;
|
||||
grView.DataBind();
|
||||
// reimposto! con durata calcolata
|
||||
((mod_dateTime)grView.Rows[grView.EditIndex].FindControl("dtInizio")).valoreDateTime = inizioEdit;
|
||||
((mod_dateTime)grView.Rows[grView.EditIndex].FindControl("dtFine")).valoreDateTime = inizioEdit.AddMinutes(minutiSel);
|
||||
((TextBox)grView.Rows[grView.EditIndex].FindControl("txtDescrizione")).Text = descrizione;
|
||||
// DISATTIVO COLLEGAMENTO A DATI...
|
||||
doDataBound = false;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (doDataBound)
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è clonare...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgClona_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
ImageButton lbtn = (ImageButton)sender;
|
||||
int idxRa = 0;
|
||||
try
|
||||
{
|
||||
idxRa = Convert.ToInt32(lbtn.CommandArgument);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiamo clona!
|
||||
DataProxy.DP.taRA.clonaRecord(idxRa);
|
||||
updateControl();
|
||||
}
|
||||
/// <summary>
|
||||
/// fa update del controllo e chiama evento update esterno
|
||||
/// </summary>
|
||||
private void updateControl()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
refreshControlli();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// completato insert! aggiorno!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void odsRA_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
stato = statoControllo.item;
|
||||
refreshControlli();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettuato update
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
updateControl();
|
||||
}
|
||||
/// <summary>
|
||||
/// riga eliminata
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
updateControl();
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void doInsert()
|
||||
{
|
||||
//recupero la riga footer...
|
||||
int idxDip = DataProxy.idxDipendente;
|
||||
int idxFase = 0;
|
||||
DateTime inizio = DateTime.Now;
|
||||
DateTime fine = DateTime.Now;
|
||||
string descr = "";
|
||||
try
|
||||
{
|
||||
idxFase = Convert.ToInt32(((DropDownList)grView.FooterRow.FindControl("ddlFase")).SelectedValue);
|
||||
inizio = ((mod_dateTime)grView.FooterRow.FindControl("dtInizio")).valoreDateTime;
|
||||
fine = ((mod_dateTime)grView.FooterRow.FindControl("dtFine")).valoreDateTime;
|
||||
descr = ((TextBox)grView.FooterRow.FindControl("txtDescrizione")).Text;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
DataProxy.DP.taRA.Insert(idxDip, idxFase, inizio, fine, descr, 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// riga in edit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
|
||||
{
|
||||
grView.SelectedIndex = e.NewEditIndex;
|
||||
int idxRASel = Convert.ToInt32(grView.SelectedDataKey["idxRA"]);
|
||||
// salvo in sessione valori selezionati
|
||||
idxFaseSel = DataProxy.DP.taRA.getByKey(idxRASel)[0].idxFase;
|
||||
idxProjSel = idxPrjByFase(idxFaseSel);
|
||||
}
|
||||
/// <summary>
|
||||
/// riga popolata
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
// controllo la riga
|
||||
GridViewRow riga = e.Row;
|
||||
if (grView.EditIndex >= 0 || grView.ShowFooter)
|
||||
{
|
||||
try
|
||||
{
|
||||
//pre-seleziono idx progetto x ods fase...
|
||||
DropDownList ddlProj_int = (DropDownList)riga.FindControl("ddlProgetto");
|
||||
if (idxProjSel >= 0 && (ddlProj_int != null))
|
||||
{
|
||||
ddlProj_int.SelectedValue = idxProjSel.ToString();
|
||||
}
|
||||
DropDownList ddlFase_int = (DropDownList)riga.FindControl("ddlFase");
|
||||
if (idxFaseSel >= 0 && (ddlFase_int != null))
|
||||
{
|
||||
ddlFase_int.SelectedValue = idxFaseSel.ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// intercetto update!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void odsRA_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
DropDownList ddlfase_int = (DropDownList)grView.Rows[grView.EditIndex].FindControl("ddlFase");
|
||||
e.InputParameters["idxFase"] = ddlfase_int.SelectedValue;
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorno ods fasi...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlProgetto_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo in session idxProjSel!
|
||||
DropDownList ddlProj_int = (DropDownList)sender;
|
||||
idxProjSel = Convert.ToInt32(ddlProj_int.SelectedValue);
|
||||
// ricarico dati fasi
|
||||
odsFase.DataBind();
|
||||
// se in insert salvo orari e testo...
|
||||
DateTime inizio = DateTime.Now;
|
||||
DateTime fine = DateTime.Now;
|
||||
string descr = "";
|
||||
if (stato == statoControllo.insert)
|
||||
{
|
||||
inizio = ((mod_dateTime)grView.FooterRow.FindControl("dtInizio")).valoreDateTime;
|
||||
fine = ((mod_dateTime)grView.FooterRow.FindControl("dtFine")).valoreDateTime;
|
||||
descr = ((TextBox)grView.FooterRow.FindControl("txtDescrizione")).Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
// se è edit...
|
||||
int idx = grView.EditIndex;
|
||||
inizio = ((mod_dateTime)grView.Rows[idx].FindControl("dtInizio")).valoreDateTime;
|
||||
fine = ((mod_dateTime)grView.Rows[idx].FindControl("dtFine")).valoreDateTime;
|
||||
descr = ((TextBox)grView.Rows[idx].FindControl("txtDescrizione")).Text;
|
||||
}
|
||||
refreshControlli();
|
||||
// se in insert riporto orari e testo...
|
||||
if (stato == statoControllo.insert)
|
||||
{
|
||||
((mod_dateTime)grView.FooterRow.FindControl("dtInizio")).valoreDateTime = inizio;
|
||||
((mod_dateTime)grView.FooterRow.FindControl("dtFine")).valoreDateTime = fine;
|
||||
((TextBox)grView.FooterRow.FindControl("txtDescrizione")).Text = descr;
|
||||
try
|
||||
{
|
||||
DropDownList ddlFase_int = (DropDownList)grView.FooterRow.FindControl("ddlFase");
|
||||
ddlFase_int.SelectedIndex = 1;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
else
|
||||
{
|
||||
// se è edit...
|
||||
int idx = grView.EditIndex;
|
||||
((mod_dateTime)grView.Rows[idx].FindControl("dtInizio")).valoreDateTime = inizio;
|
||||
((mod_dateTime)grView.Rows[idx].FindControl("dtFine")).valoreDateTime = fine;
|
||||
((TextBox)grView.Rows[idx].FindControl("txtDescrizione")).Text = descr;
|
||||
try
|
||||
{
|
||||
DropDownList ddlFase_int = (DropDownList)grView.Rows[idx].FindControl("ddlFase");
|
||||
ddlFase_int.SelectedIndex = 1;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// progetto selezionato
|
||||
/// </summary>
|
||||
protected int idxProjSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxProjSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxProjSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// fase selezionata
|
||||
/// </summary>
|
||||
protected int idxFaseSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxFaseSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxFaseSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// generico comando riga
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
{
|
||||
switch (e.CommandName)
|
||||
{
|
||||
case "Cancel":
|
||||
stato = statoControllo.item;
|
||||
updateControl();
|
||||
break;
|
||||
case "Insert":
|
||||
doInsert();
|
||||
stato = statoControllo.item;
|
||||
updateControl();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
/// <summary>
|
||||
/// idxDipendente selezionato (0=tutti)
|
||||
/// </summary>
|
||||
public int idxDipCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxDipCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDipCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// progetto selezionato..
|
||||
/// </summary>
|
||||
public string idxProgetto
|
||||
{
|
||||
get
|
||||
{
|
||||
return idxProjSel.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// abilitato editing + nuovo + delete + clona
|
||||
/// </summary>
|
||||
public bool enableFull
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.BoolSessionObj("enableEditComm");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("enableEditComm", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stato attuale del controllo
|
||||
/// </summary>
|
||||
public statoControllo stato
|
||||
{
|
||||
get
|
||||
{
|
||||
statoControllo answ = statoControllo.item;
|
||||
try
|
||||
{
|
||||
answ = (statoControllo)memLayer.ML.objSessionObj("statoControlloRA");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("statoControlloRA", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore datetime selezionato!
|
||||
/// </summary>
|
||||
public DateTime valoreDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataRif", value);
|
||||
lblTitle.Text = string.Format("{0:dddd dd/MM/yyyy}", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// evento update valori
|
||||
/// </summary>
|
||||
public event EventHandler eh_nuovoValore;
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
refreshControlli();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// calcola idxProgetto da idxFase
|
||||
/// </summary>
|
||||
/// <param name="idxFase"></param>
|
||||
/// <returns></returns>
|
||||
public int idxPrjByFase(object idxFase)
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = DataProxy.DP.taAF.getByIdx(Convert.ToInt32(idxFase))[0].idxProgetto;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo eventuali "headers"
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlFase_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// cerco eventuali controlli tipo "ancestor" e li disattivo!
|
||||
DropDownList ddlFase_int = (DropDownList)sender;
|
||||
ListItem li = new ListItem();
|
||||
while (li != null)
|
||||
{
|
||||
li = ddlFase_int.Items.FindByValue("0");
|
||||
try
|
||||
{
|
||||
li.Attributes.Add("style", "color:gray;");
|
||||
li.Attributes.Add("disabled", "true");
|
||||
li.Value = "-1";
|
||||
li.Text = string.Format("[ {0} ]", li.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
try
|
||||
{
|
||||
ddlFase_int.SelectedIndex = 1;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// richiesta creazioen nuovo record
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
// controllo: se ho righe mostro il footer...
|
||||
stato = statoControllo.insert;
|
||||
refreshControlli();
|
||||
}
|
||||
else
|
||||
{
|
||||
// default: inizia ora la dichiarazione
|
||||
double oraStart = DateTime.Now.Hour;
|
||||
int durataMinuti = memLayer.ML.IntSessionObj("stdMinDurata");
|
||||
// se c'è timbratura ingresso prendo quella come ora inizio...
|
||||
try
|
||||
{
|
||||
DS_Applicazione.TimbratureRow riga = DataProxy.DP.taTimb.getByIdxDipPeriodo(DataProxy.idxDipendente, valoreDateTime, valoreDateTime.AddDays(1))[0];
|
||||
oraStart = Convert.ToDouble(riga.dataOra.Hour + riga.dataOra.Minute / 60);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// altrimenti duplico ultima entry utente..
|
||||
DataProxy.DP.taRA.clonaLastRA_Utente(DataProxy.idxDipendente, valoreDateTime.AddHours(oraStart), durataMinuti);
|
||||
updateControl();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// esegue ricerca progetto/fase x sovrascrivere
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtSearchFase_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
// recupero testo...
|
||||
string search = "";
|
||||
try
|
||||
{
|
||||
search = ((TextBox)sender).Text.Trim();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (search != "")
|
||||
{
|
||||
// faccio ricerca x progetto e fase...
|
||||
GPW_data.DS_Utility.stp_VSProjFasi_searchDataTable tabRes = DataProxy.DP.taVSProjFasiSearch.GetData(search);
|
||||
if (tabRes.Rows.Count > 0)
|
||||
{
|
||||
idxFaseSel = tabRes[0].idxFase;
|
||||
idxProjSel = tabRes[0].idxProgetto;
|
||||
}
|
||||
}
|
||||
//stato = statoControllo.edit;
|
||||
//refreshControlli();
|
||||
//stato = statoControllo.item;
|
||||
//minutiSel = -1;
|
||||
refreshControlli();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// formatta la durata in ore secondo web.config (centesimale/ore:min)
|
||||
/// </summary>
|
||||
/// <param name="oreCent"></param>
|
||||
/// <returns></returns>
|
||||
public string formatDurata(object oreCent)
|
||||
{
|
||||
decimal ore = 0;
|
||||
try
|
||||
{
|
||||
ore = Convert.ToDecimal(oreCent);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string answ = "";
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = utils.formOreMin(ore);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = ore.ToString("0.00");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_commAttivitaDesk {
|
||||
|
||||
/// <summary>
|
||||
/// pnlAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlAll;
|
||||
|
||||
/// <summary>
|
||||
/// pnlHeader control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlHeader;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitle control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTitle;
|
||||
|
||||
/// <summary>
|
||||
/// imgBtnNew control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ImageButton imgBtnNew;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// odsRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRA;
|
||||
|
||||
/// <summary>
|
||||
/// odsProgetto control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsProgetto;
|
||||
|
||||
/// <summary>
|
||||
/// odsFase control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsFase;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commUtLog.ascx.cs" Inherits="GPW.WebUserControls.mod_commUtLog" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="mod_menuTopFull.ascx" TagName="mod_menuTopFull" TagPrefix="uc1" %>
|
||||
<%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc2" %>
|
||||
<%@ Register Src="mod_commAttivitaDesk.ascx" TagName="mod_commAttivitaDesk" TagPrefix="uc3" %>
|
||||
<%@ Register Src="mod_commUtMancTimbr.ascx" TagName="mod_commUtMancTimbr" TagPrefix="uc4" %>
|
||||
<%@ Register Src="mod_elencoTimbr.ascx" TagName="mod_elencoTimbr" TagPrefix="uc5" %>
|
||||
<%@ Register Src="mod_TagCloudProgetti.ascx" TagName="mod_TagCloudProgetti" TagPrefix="uc6" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
|
||||
|
||||
<asp:HiddenField runat="server" ID="hfDataFrom" />
|
||||
<asp:HiddenField runat="server" ID="hfDataTo" />
|
||||
<asp:Panel runat="server" ID="pnlAll" Height="100%">
|
||||
<div style="height: 100%;">
|
||||
<div style="float: none;">
|
||||
<uc1:mod_menuTopFull ID="mod_menuTopFull1" runat="server" titolo="Gestione Commesse Utente" returnUrl="../Default.aspx" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="filtro_1 fontPiccolo" style="height: 26px;">
|
||||
<div class="divSx">
|
||||
<uc2:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" realtimeUpdate="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: none; text-align: center; margin: auto;">
|
||||
<div class="divDx">
|
||||
<asp:Panel ID="pnlEditCom" runat="server" Height="100%" Visible="false">
|
||||
<div style="padding: 5px; margin-bottom: 40px;">
|
||||
<div class="blockSizeXXXLarge divSx">
|
||||
<asp:Button runat="server" ID="btnCloseRA" Text="Chiudi" Font-Bold="true" OnClick="btnClose_Click" CssClass="btnRosso ui-corner-all shadowBox fontMedio btnChiudi" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlock blockSizeXXXLarge divSx">
|
||||
<%--<div id="accordion">
|
||||
<h3>
|
||||
Tag Cloud ultimi progetti</h3>
|
||||
<div style="background-color: White;">
|
||||
aaa
|
||||
</div>
|
||||
<h3>
|
||||
Task Aperti</h3>
|
||||
<div>
|
||||
<p>
|
||||
...
|
||||
</p>
|
||||
</div>
|
||||
</div>--%>
|
||||
<uc6:mod_TagCloudProgetti ID="mod_TagCloudProgetti1" runat="server" />
|
||||
<uc3:mod_commAttivitaDesk ID="mod_commAttivitaDesk1" runat="server" Visible="false" enableFull="true" />
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:Panel ID="pnlEditOre" runat="server" Height="100%" Visible="false">
|
||||
<div style="padding: 5px; margin-bottom: 40px;">
|
||||
<div class="blockSizeXLarge divSx">
|
||||
<asp:Button runat="server" ID="btnCloseTimb" Text="Chiudi" Font-Bold="true" OnClick="btnClose_Click" CssClass="btnRosso ui-corner-all shadowBox fontMedio btnChiudi" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 5px;">
|
||||
<div class="dataBlock blockSizeXLarge divSx">
|
||||
<div class="dataBlockHeader" style="height: 24px; text-align: center; margin: auto; font-size: 12pt;">
|
||||
Timbrature Approvate
|
||||
</div>
|
||||
<uc5:mod_elencoTimbr ID="mod_elencoTimbr1" runat="server" showUserName="false" showLongDateFormat="false" />
|
||||
</div>
|
||||
</div>
|
||||
<uc4:mod_commUtMancTimbr ID="mod_commUtMancTimbr1" runat="server" Visible="false" />
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div style="float: none;">
|
||||
<asp:GridView ID="grView" runat="server" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="Data,idxDipendente"
|
||||
CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="9pt" ViewStateMode="Disabled" AllowPaging="True" PageSize="50">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<EmptyDataTemplate>
|
||||
No record
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Data" HeaderText="Data" ReadOnly="True" SortExpression="Data" DataFormatString="{0:dd/MM/yy, ddd}"
|
||||
ItemStyle-Width="8em" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="8em">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: right; margin: auto; margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblHead_h_lav" runat="server" Text="Ore lavorate" /></b>
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="text-align: right; margin: auto; margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblIsOk" runat="server" Text="*" ForeColor="Red" Visible='<%# invBool(Eval("okTimbr")) %>' />
|
||||
</b><b>
|
||||
<asp:Label ID="lblh_lav" runat="server" Text='<%# formatDurata(Eval("h_lav")) %>' CssClass='<%# classByPerm(Eval("minPerm")) %>'
|
||||
ToolTip='<%# tooltipPermStra(Eval("minStra"),Eval("minPerm")) %>' /></b>
|
||||
<asp:ImageButton ID="imgEditTimbr" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Edit Timbrature"
|
||||
ImageUrl="../images/edit_s.png" OnClick="imgEditTimbr_Click" CommandArgument='<%# Eval("Data") %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="4em">
|
||||
<HeaderTemplate>
|
||||
<asp:Label runat="server" ID="lblGiust" Text="Giust" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="oreGiust" Text='<%# txtGiust(Eval("minPerm"),Eval("minFer"),Eval("minMal"),Eval("minFest"),Eval("minMpp")) %>'
|
||||
ToolTip='<%# tooltipGiust(Eval("minPerm"),Eval("minFer"),Eval("minMal"),Eval("minFest"),Eval("minMpp")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="8em">
|
||||
<HeaderTemplate>
|
||||
<div style="text-align: right; margin: auto; margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblHead_h_com" runat="server" Text="Ore caricate" /></b>
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="text-align: right; margin: auto; margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblh_com" runat="server" Text='<%# formatDurata(Eval("h_com")) %>' /></b>
|
||||
<asp:ImageButton ID="imgEditComm" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Edit Ore commesse"
|
||||
ImageUrl="../images/edit_s.png" OnClick="imgEditComm_Click" CommandArgument='<%# Eval("Data") %>' Visible='<%# regAttEnabled %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField SortExpression="progetti">
|
||||
<HeaderTemplate>
|
||||
<div style="margin-left: 8px;">
|
||||
<b>
|
||||
<asp:Label ID="lblHead_progetti" runat="server" Text="Progetti" /></b>
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin-left: 4px; font-size: 8pt;">
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Progetti") %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Height="24px" SortExpression="okLavCom" ItemStyle-Width="32px">
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin: 0px 8px 0px 8px; float: right;">
|
||||
<asp:Image runat="server" ID="imgChk" ImageUrl='<%# imgChk(Eval("okLavCom")) %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Height="24px" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByIdxDipDate"
|
||||
TypeName="GPW_data.DS_ApplicazioneTableAdapters.v_logCommUtTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDipendente" Name="idxDipendente" Type="Int32" DefaultValue="0" />
|
||||
<asp:ControlParameter DefaultValue="" Name="dataFrom" ControlID="hfDataFrom" PropertyName="Value" Type="DateTime" />
|
||||
<asp:ControlParameter DefaultValue="" Name="dataTo" ControlID="hfDataTo" PropertyName="Value" Type="DateTime" />
|
||||
<%--<asp:SessionParameter DefaultValue="" Name="dataFrom" SessionField="_inizio" Type="DateTime" />
|
||||
<asp:SessionParameter Name="dataTo" SessionField="_fine" Type="DateTime" />--%>
|
||||
<asp:SessionParameter SessionField="maxErrMin" Name="maxErrMin" Type="Int32" DefaultValue="-30" />
|
||||
<asp:SessionParameter SessionField="maxErrPlus" Name="maxErrPlus" Type="Int32" DefaultValue="30" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
@@ -0,0 +1,397 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using System.Globalization;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// modalità ammesse per il controllo
|
||||
/// </summary>
|
||||
public enum modoCommesse
|
||||
{
|
||||
/// <summary>
|
||||
/// elenco giornate e resoconto
|
||||
/// </summary>
|
||||
elenco,
|
||||
/// <summary>
|
||||
/// edit timbrature attivo
|
||||
/// </summary>
|
||||
editTimb,
|
||||
/// <summary>
|
||||
/// edit Registro Attività attivo
|
||||
/// </summary>
|
||||
editRegAtt
|
||||
}
|
||||
public partial class mod_commUtLog : System.Web.UI.UserControl
|
||||
{
|
||||
public modoCommesse activeMode
|
||||
{
|
||||
get
|
||||
{
|
||||
modoCommesse answ = modoCommesse.elenco;
|
||||
try
|
||||
{
|
||||
answ = (modoCommesse)memLayer.ML.objSessionObj("activeModeComm");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("activeModeComm", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("maxErrMin", memLayer.ML.confReadInt("maxErrMin"));
|
||||
memLayer.ML.setSessionVal("maxErrPlus", memLayer.ML.confReadInt("maxErrPlus"));
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
intervalloDate periodo = new intervalloDate();
|
||||
periodo.fine = DateTime.Now.AddDays(1);
|
||||
periodo.inizio = periodo.fine.AddDays(-10);
|
||||
mod_periodoAnalisi1.intervalloAnalisi = periodo;
|
||||
// salvo link in HF
|
||||
hfDataFrom.Value = periodo.inizio.ToString();
|
||||
hfDataTo.Value = periodo.fine.ToString();
|
||||
// imposto modo tag cloud
|
||||
string modoTC = memLayer.ML.confReadString("TagCloudMode");
|
||||
switch (modoTC)
|
||||
{
|
||||
case "elenco":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elenco;
|
||||
break;
|
||||
case "elencoCPF":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.elencoCPF;
|
||||
break;
|
||||
case "piramide":
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.piramide;
|
||||
break;
|
||||
case "standard":
|
||||
default:
|
||||
mod_TagCloudProgetti1.modo = TagCloudMode.standard;
|
||||
break;
|
||||
}
|
||||
}
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
mod_commUtMancTimbr1.eh_nuovoValore += new EventHandler(mod_commUtMancTimbr1_eh_nuovoValore);
|
||||
mod_commAttivitaDesk1.eh_nuovoValore += new EventHandler(mod_commAttivitaDesk1_eh_nuovoValore);
|
||||
mod_TagCloudProgetti1.eh_newVal += new EventHandler(mod_TagCloudProgetti1_eh_newVal);
|
||||
mod_TagCloudProgetti1.eh_refresh += mod_TagCloudProgetti1_eh_refresh;
|
||||
mod_periodoAnalisi1.eh_doUpdate += mod_periodoAnalisi1_eh_doUpdate;
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_refresh(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
|
||||
{
|
||||
// 2016.04.07: salvo intervallo nei 2 hidden field
|
||||
hfDataFrom.Value = mod_periodoAnalisi1.intervalloAnalisi.inizio.ToString();
|
||||
hfDataTo.Value= mod_periodoAnalisi1.intervalloAnalisi.fine.ToString();
|
||||
// update
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_TagCloudProgetti1_eh_newVal(object sender, EventArgs e)
|
||||
{
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commAttivitaDesk1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
mod_TagCloudProgetti1.doUpdate();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
void mod_commUtMancTimbr1_eh_nuovoValore(object sender, EventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// idxDipendente insessione
|
||||
/// </summary>
|
||||
protected int idxDip
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxDipBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxDipBCode", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit timbrature
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditTimbr_Click(object sender, EventArgs e)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commUtMancTimbr1.valoreDateTime = Convert.ToDateTime(dataRif, ita).AddHours(adesso.Hour).AddMinutes(adesso.Minute - adesso.Minute % 5);
|
||||
//salvo in sessione dati x detail timbrature
|
||||
memLayer.ML.setSessionVal("inizioDet", Convert.ToDateTime(dataRif, ita).Date);
|
||||
memLayer.ML.setSessionVal("fineDet", Convert.ToDateTime(dataRif, ita).Date.AddDays(1));
|
||||
memLayer.ML.setSessionVal("idxDip_det", DataProxy.idxDipendente);
|
||||
// imposto modalità
|
||||
activeMode = modoCommesse.editTimb;
|
||||
showPanels();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richiesta edit commesse
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgEditComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
string dataRif = ((ImageButton)sender).CommandArgument;
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
mod_commAttivitaDesk1.idxDipCurr = DataProxy.idxDipendente;
|
||||
mod_commAttivitaDesk1.valoreDateTime = Convert.ToDateTime(dataRif, ita);
|
||||
mod_TagCloudProgetti1.dataRif = Convert.ToDateTime(dataRif, ita);
|
||||
activeMode = modoCommesse.editRegAtt;
|
||||
showPanels();
|
||||
mod_commAttivitaDesk1.doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// indica se sia abilitato l'editing delle attività legate alle commesse
|
||||
/// </summary>
|
||||
public bool regAttEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadBool("regAttEnabled");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string classByPerm(object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
if (Convert.ToDouble(minPerm) > 0)
|
||||
{
|
||||
answ = "lblWarning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// prepara tooltip permessi/straordinarie
|
||||
/// </summary>
|
||||
/// <param name="minStra"></param>
|
||||
/// <param name="minPerm"></param>
|
||||
/// <returns></returns>
|
||||
public string tooltipPermStra(object minStra, object minPerm)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0} - Permessi: {1} (h:mm)", utils.formOreMin(Convert.ToDecimal(minStra) / 60), utils.formOreMin(Convert.ToDecimal(minPerm) / 60));
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = string.Format("Straordinarie: {0:0.##} h - Permessi: {1:0.##} h", Convert.ToDouble(minStra) / 60, Convert.ToDouble(minPerm) / 60);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta visualizzazione dei pannelli opzionali laterali a seocnda del modo attivo
|
||||
/// </summary>
|
||||
protected void showPanels()
|
||||
{
|
||||
// imposto valori default
|
||||
bool timbr = false;
|
||||
bool commesse = false;
|
||||
switch (activeMode)
|
||||
{
|
||||
case modoCommesse.editTimb:
|
||||
timbr = true;
|
||||
break;
|
||||
case modoCommesse.editRegAtt:
|
||||
commesse = true;
|
||||
break;
|
||||
case modoCommesse.elenco:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
pnlEditCom.Visible = commesse;
|
||||
pnlEditOre.Visible = timbr;
|
||||
mod_commUtMancTimbr1.Visible = timbr;
|
||||
mod_commAttivitaDesk1.Visible = commesse;
|
||||
}
|
||||
/// <summary>
|
||||
/// chiamata del button close (entrambi)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
activeMode = modoCommesse.elenco;
|
||||
showPanels();
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// fornisce img x check coerenza ore timbrate e commesse
|
||||
/// </summary>
|
||||
/// <param name="okLavCom"></param>
|
||||
/// <returns></returns>
|
||||
public string imgChk(object okLavCom)
|
||||
{
|
||||
string answ = "~/images/statoKo_m.png";
|
||||
try
|
||||
{
|
||||
if (Convert.ToBoolean(okLavCom))
|
||||
{
|
||||
answ = "~/images/statoOk_m.png";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string txtGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Pe ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Fe ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Ma ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Fs ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Mpp ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00} Pe ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00} Fe ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00} Ma ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00} Fs ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00} Mpp ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// formatta stringa tooltip giustificativi
|
||||
/// </summary>
|
||||
/// <param name="_minPerm">permessi</param>
|
||||
/// <param name="_minFer">ferie</param>
|
||||
/// <param name="_minMal">malattia</param>
|
||||
/// <param name="_minFest">festività</param>
|
||||
/// <param name="_minMPP">MPP</param>
|
||||
/// <returns></returns>
|
||||
public string tooltipGiust(object _minPerm, object _minFer, object _minMal, object _minFest, object _minMPP)
|
||||
{
|
||||
string answ = "";
|
||||
double minPerm = Convert.ToInt32(_minPerm);
|
||||
double minFer = Convert.ToInt32(_minFer);
|
||||
double minMal = Convert.ToInt32(_minMal);
|
||||
double minFest = Convert.ToInt32(_minFest);
|
||||
double minMpp = Convert.ToInt32(_minMPP);
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0} Permesso ", utils.formOreMin(Convert.ToDecimal(minPerm / 60)));
|
||||
if (minFer > 0) answ += string.Format("{0} Ferie ", utils.formOreMin(Convert.ToDecimal(minFer / 60)));
|
||||
if (minMal > 0) answ += string.Format("{0} Malattia ", utils.formOreMin(Convert.ToDecimal(minMal / 60)));
|
||||
if (minFest > 0) answ += string.Format("{0} Festività ", utils.formOreMin(Convert.ToDecimal(minFest / 60)));
|
||||
if (minMpp > 0) answ += string.Format("{0} Manc.Pausa Pranzo ", utils.formOreMin(Convert.ToDecimal(minMpp / 60)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minPerm > 0) answ += string.Format("{0:0.00}h Permesso ", minPerm / 60);
|
||||
if (minFer > 0) answ += string.Format("{0:0.00}h Ferie ", minFer / 60);
|
||||
if (minMal > 0) answ += string.Format("{0:0.00}h Malattia ", minMal / 60);
|
||||
if (minFest > 0) answ += string.Format("{0:0.00}h Festività ", minFest / 60);
|
||||
if (minMpp > 0) answ += string.Format("{0:0.00}h Manc.Pausa Pranzo ", minMpp / 60);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// formatta la durata in ore secondo web.config (centesimale/ore:min)
|
||||
/// </summary>
|
||||
/// <param name="oreCent"></param>
|
||||
/// <returns></returns>
|
||||
public string formatDurata(object oreCent)
|
||||
{
|
||||
decimal ore = 0;
|
||||
try
|
||||
{
|
||||
ore = Convert.ToDecimal(oreCent);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string answ = "";
|
||||
if (memLayer.ML.confReadBool("reviewShowOreMin"))
|
||||
{
|
||||
answ = utils.formOreMin(ore);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = ore.ToString("0.00");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_commUtLog {
|
||||
|
||||
/// <summary>
|
||||
/// hfDataFrom control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfDataFrom;
|
||||
|
||||
/// <summary>
|
||||
/// hfDataTo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfDataTo;
|
||||
|
||||
/// <summary>
|
||||
/// pnlAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlAll;
|
||||
|
||||
/// <summary>
|
||||
/// mod_menuTopFull1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_menuTopFull mod_menuTopFull1;
|
||||
|
||||
/// <summary>
|
||||
/// mod_periodoAnalisi1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_periodoAnalisi mod_periodoAnalisi1;
|
||||
|
||||
/// <summary>
|
||||
/// pnlEditCom control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlEditCom;
|
||||
|
||||
/// <summary>
|
||||
/// btnCloseRA control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCloseRA;
|
||||
|
||||
/// <summary>
|
||||
/// mod_TagCloudProgetti1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_TagCloudProgetti mod_TagCloudProgetti1;
|
||||
|
||||
/// <summary>
|
||||
/// mod_commAttivitaDesk1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_commAttivitaDesk mod_commAttivitaDesk1;
|
||||
|
||||
/// <summary>
|
||||
/// pnlEditOre control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlEditOre;
|
||||
|
||||
/// <summary>
|
||||
/// btnCloseTimb control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCloseTimb;
|
||||
|
||||
/// <summary>
|
||||
/// mod_elencoTimbr1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_elencoTimbr mod_elencoTimbr1;
|
||||
|
||||
/// <summary>
|
||||
/// mod_commUtMancTimbr1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_commUtMancTimbr mod_commUtMancTimbr1;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commUtMancTimbr.ascx.cs" Inherits="GPW.WebUserControls.mod_commUtMancTimbr" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Src="mod_menuTopFull.ascx" TagName="mod_menuTopFull" TagPrefix="uc1" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlAll" Height="100%">
|
||||
<div style="padding: 5px;">
|
||||
<div class="clearDiv dataBlock blockSizeXLarge divSx">
|
||||
<div class="dataBlockHeader" style="height: 24px; text-align: center; margin: auto; font-size: 12pt;">
|
||||
Gestione Mancate Timbrature
|
||||
</div>
|
||||
<div class="dataBlockReset" style="height: 24px; padding: 4px 0px 4px 0px;">
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockValue">
|
||||
<asp:RadioButtonList ID="rblEntrata" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="radioBtn">
|
||||
<asp:ListItem Text="IN" Value="true" />
|
||||
<asp:ListItem Text="OUT" Value="false" />
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockValue">
|
||||
<asp:TextBox runat="server" ID="txtData" Width="6em" />
|
||||
<asp:CalendarExtender ID="ceTxtData" runat="server" TargetControlID="txtData" FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
|
||||
</asp:CalendarExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset" style="height: 24px; padding: 4px 0px 4px 0px;">
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Ora:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:DropDownList runat="server" ID="ddlOra" name="Ora" DataSourceID="odsOra" DataTextField="Ora" DataValueField="Ora" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsOra" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getHoursTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
Min:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:DropDownList runat="server" ID="ddlMin" name="Min" DataSourceID="odsMin" DataTextField="Minuto" DataValueField="Minuto"
|
||||
data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsMin" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getMinTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="5" Name="interv" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockBtn">
|
||||
<asp:Button ID="btnRichMT" runat="server" Text="Richiesta" OnClick="btnRichMT_Click" CssClass="btnNew" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv dataBlock blockSizeXLarge divSx">
|
||||
<div class="dataBlockHeader" style="height: 24px; text-align: center; margin: auto; font-size: 12pt;">
|
||||
Richieste in corso:
|
||||
</div>
|
||||
<asp:GridView ID="grViewRichieste" nome="grView" runat="server" AllowPaging="True" DataSourceID="odsRichieste" AutoGenerateColumns="False"
|
||||
DataKeyNames="dataOra,idxDipendente" CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="Smaller" Width="100%"
|
||||
OnRowUpdated="grView_RowUpdated" OnRowDeleted="grViewRichieste_RowDeleted">
|
||||
<AlternatingRowStyle BackColor="White" />
|
||||
<EditRowStyle BackColor="#2461BF" />
|
||||
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
|
||||
<RowStyle BackColor="#EFF3FB" />
|
||||
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle BackColor="#F5F7FB" />
|
||||
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
|
||||
<SortedDescendingCellStyle BackColor="#E9EBEF" />
|
||||
<SortedDescendingHeaderStyle BackColor="#4870BE" />
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="dataOra" SortExpression="dataOra" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblData" runat="server" Text='<%# Eval("dataOra", "{0:ddd yyyy.MM.dd, HH:mm}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="IN" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblIn" runat="server" Text="X" Visible='<%# Eval("entrata") %>' ForeColor="#666666" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="scambia" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton runat="server" ID="btnSwapInOut" ToolTip="Scambia In/Out" CommandName="Update" ImageUrl="~/images/InOutArrows_m.png" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="OUT" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblOut" runat="server" Text="X" Visible='<%# invBool(Eval("entrata")) %>' ForeColor="#666666" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbDelete" Text="Elimina" CommandArgument="Elimina" CommandName="Delete" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="odsRichieste" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getNonApprByDip"
|
||||
TypeName="GPW_data.DS_ApplicazioneTableAdapters.TimbratureTableAdapter" DeleteMethod="DeleteNonAppr" UpdateMethod="updateSwapInOut">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDipendente" Name="idxDipendente" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
@@ -0,0 +1,224 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_commUtMancTimbr : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// data selezionata
|
||||
/// </summary>
|
||||
protected DateTime dataRif
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dataRif", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// imposto entrata
|
||||
rblEntrata.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore datetime selezionato!
|
||||
/// </summary>
|
||||
public DateTime valoreDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
int oreSel = Convert.ToInt32(ddlOra.SelectedValue);
|
||||
int minSel = Convert.ToInt32(ddlMin.SelectedValue);
|
||||
answ = Convert.ToDateTime(txtData.Text).AddHours(oreSel).AddMinutes(minSel);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtData.Text = value.Date.ToString("dd/MM/yyyy");
|
||||
ddlOra.SelectedValue = value.Hour.ToString();
|
||||
ddlMin.SelectedValue = value.Minute.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// evento riga caricata...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
// controllo la riga
|
||||
GridViewRow riga = e.Row;
|
||||
// se la data è quella rif...
|
||||
Label data = new Label();
|
||||
bool trovato = false;
|
||||
try
|
||||
{
|
||||
data = (Label)riga.FindControl("lblDataLav");
|
||||
trovato = (data.Text == Convert.ToDateTime(memLayer.ML.StringSessionObj("dataRif")).ToString("dd-MM"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo post eliminazione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// update post cancellazione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grViewRichieste_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua fix dell'ods
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
grViewRichieste.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo richiesta
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnRichMT_Click(object sender, EventArgs e)
|
||||
{
|
||||
logger.lg.scriviLog("Richiesta registrazione timbratura manuale", tipoLog.INFO);
|
||||
// salva una richiesta di timbratura (ovvero approvata = FALSE!!!)
|
||||
DateTime richiesta = DateTime.Now;
|
||||
try
|
||||
{
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
logger.lg.scriviLog(string.Format("Data: {0}", txtData.Text));
|
||||
richiesta = Convert.ToDateTime(txtData.Text, ita);
|
||||
double ora = Convert.ToDouble(ddlOra.SelectedValue);
|
||||
double minuto = Convert.ToDouble(ddlMin.SelectedValue);
|
||||
richiesta = richiesta.AddHours(ora).AddMinutes(minuto);
|
||||
bool isEntrata = Convert.ToBoolean(rblEntrata.SelectedValue);
|
||||
registraTimbraturaNonApp(isEntrata, richiesta);
|
||||
// aggiorno gridview
|
||||
checkFixOds();
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore conversione datetime!");
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// registro timbratura NON APPROVATA
|
||||
/// </summary>
|
||||
/// <param name="isEntrata"></param>
|
||||
/// <returns></returns>
|
||||
private void registraTimbraturaNonApp(bool isEntrata, DateTime dataOra)
|
||||
{
|
||||
// salvo evento entrata...
|
||||
string IPv4 = "";
|
||||
bool approvata = false; // è una richiesta!!!!
|
||||
if (DataProxy.idxDipendente > 0)
|
||||
{
|
||||
// recupero IP
|
||||
IPv4 = Request.UserHostName;
|
||||
DataProxy.DP.taTimb.stp_insTimbMan(DataProxy.idxDipendente, dataOra, isEntrata, IPv4, "NoTim", approvata);
|
||||
logger.lg.scriviLog(string.Format("Richiesta timbratura per il dipendente:{0} in data:{1} isEntrata:{2}", DataProxy.idxDipendente, dataOra, isEntrata), tipoLog.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.lg.scriviLog("IdxDipendente non trovato! inserimento timbratura mancante impossibile", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola cognome-nome da idx
|
||||
/// </summary>
|
||||
/// <param name="idxDip"></param>
|
||||
/// <returns></returns>
|
||||
public string cognomeNome(object idxDip)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
DS_Applicazione.DipendentiRow rigaDip = DataProxy.DP.taDipendenti.getByIdx(Convert.ToInt32(idxDip))[0];
|
||||
answ = string.Format("{0} {1}", rigaDip.Cognome, rigaDip.Nome);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// evento update valori
|
||||
/// </summary>
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_commUtMancTimbr {
|
||||
|
||||
/// <summary>
|
||||
/// pnlAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlAll;
|
||||
|
||||
/// <summary>
|
||||
/// rblEntrata control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rblEntrata;
|
||||
|
||||
/// <summary>
|
||||
/// txtData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtData;
|
||||
|
||||
/// <summary>
|
||||
/// ceTxtData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.CalendarExtender ceTxtData;
|
||||
|
||||
/// <summary>
|
||||
/// ddlOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlOra;
|
||||
|
||||
/// <summary>
|
||||
/// odsOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlMin;
|
||||
|
||||
/// <summary>
|
||||
/// odsMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsMin;
|
||||
|
||||
/// <summary>
|
||||
/// btnRichMT control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnRichMT;
|
||||
|
||||
/// <summary>
|
||||
/// grViewRichieste control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grViewRichieste;
|
||||
|
||||
/// <summary>
|
||||
/// odsRichieste control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRichieste;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dateTime.ascx.cs" Inherits="GPW.WebUserControls.mod_dateTime" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="divCenter" style="font-size: small; text-align: right;">
|
||||
<div class="divSx">
|
||||
<asp:Label runat="server" ID="lblData" />
|
||||
<asp:TextBox ID="txtData" TabIndex="1" runat="server" Width="6em" MaxLength="10" Font-Size="8pt" />
|
||||
<asp:CalendarExtender ID="ceTxtData" runat="server" TargetControlID="txtData" FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
|
||||
</asp:CalendarExtender>
|
||||
</div>
|
||||
<div class="divSx">
|
||||
<asp:Label runat="server" ID="lblOra" />
|
||||
<asp:DropDownList runat="server" ID="ddlOra" name="Ora" DataSourceID="odsOra" DataTextField="Ora" DataValueField="Ora" Font-Size="8pt">
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList runat="server" ID="ddlMin" name="Min" DataSourceID="odsMin" DataTextField="Minuto" DataValueField="Minuto"
|
||||
Font-Size="8pt">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="odsOra" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getHoursTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsMin" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getMinTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="lblSnapMin" DefaultValue="5" Name="interv" Type="Int32" PropertyName="Text" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label runat="server" Visible="false" ID="lblSnapMin" />
|
||||
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_dateTime : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// uuid univoco
|
||||
/// </summary>
|
||||
protected string uuid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.UniqueID.Replace("$", "_");
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime dataOra
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif")).AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
answ = answ.AddMinutes(-answ.Minute % snapMinuti);
|
||||
try
|
||||
{
|
||||
answ = (DateTime)memLayer.ML.objSessionObj(string.Format("dt_{0}", uuid));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("dt_{0}", uuid), value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)// || txtData.Text == "")
|
||||
{
|
||||
setInitVal();
|
||||
valoreDateTime = dataOra;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setInitVal()
|
||||
{
|
||||
// imposto un datetime di default ad adesso...
|
||||
DateTime adesso = DateTime.Now;
|
||||
try
|
||||
{
|
||||
adesso = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif")).AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
dataOra = adesso.AddMinutes(-adesso.Minute % snapMinuti);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Valore di arrotondamento x selettore minuti
|
||||
/// </summary>
|
||||
public int snapMinuti
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 5;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(lblSnapMin.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblSnapMin.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore datetime selezionato!
|
||||
/// </summary>
|
||||
public DateTime valoreDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
int oreSel = Convert.ToInt32(ddlOra.SelectedValue);
|
||||
int minSel = Convert.ToInt32(ddlMin.SelectedValue);
|
||||
answ = Convert.ToDateTime(txtData.Text).AddHours(oreSel).AddMinutes(minSel);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtData.Text = value.Date.ToShortDateString();
|
||||
ddlOra.SelectedValue = value.Hour.ToString();
|
||||
ddlMin.SelectedValue = value.Minute.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa data
|
||||
/// </summary>
|
||||
public string lblabelData
|
||||
{
|
||||
get
|
||||
{
|
||||
return lblData.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblData.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa ora
|
||||
/// </summary>
|
||||
public string lblabelOra
|
||||
{
|
||||
get
|
||||
{
|
||||
return lblOra.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblOra.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_dateTime {
|
||||
|
||||
/// <summary>
|
||||
/// lblData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblData;
|
||||
|
||||
/// <summary>
|
||||
/// txtData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtData;
|
||||
|
||||
/// <summary>
|
||||
/// ceTxtData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.CalendarExtender ceTxtData;
|
||||
|
||||
/// <summary>
|
||||
/// lblOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlMin;
|
||||
|
||||
/// <summary>
|
||||
/// odsOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsOra;
|
||||
|
||||
/// <summary>
|
||||
/// odsMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsMin;
|
||||
|
||||
/// <summary>
|
||||
/// lblSnapMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblSnapMin;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dateTimeJQM.ascx.cs" Inherits="GPW.WebUserControls.mod_dateTimeJQM" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link rel="stylesheet" type="text/css" href="../Content/jquery.mobile-1.4.5.min.css" />
|
||||
<script type="text/javascript" src="../Scripts/jquery-3.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../Scripts/jquery.mobile-1.4.5.min.js"></script>
|
||||
<% } %>
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a" style="font-size: xx-small; text-align: right;">
|
||||
<asp:Label runat="server" ID="lblData" />
|
||||
<asp:HyperLink ID="hlPUCal" runat="server" NavigateUrl="#popupBasic" data-rel="popup" data-role="button" data-mini="true">
|
||||
<asp:Label runat="server" ID="lblDataRif" Font-Size="11pt" />
|
||||
</asp:HyperLink>
|
||||
<asp:Panel runat="server" data-role="popup" ID="popupBasic">
|
||||
<p>
|
||||
<asp:Calendar runat="server" ID="calDataRif" OnSelectionChanged="calDataRif_SelectionChanged" />
|
||||
</p>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
<div class="ui-block-b" style="font-size: xx-small;">
|
||||
<asp:Label runat="server" ID="lblOra" />
|
||||
<fieldset data-role="controlgroup" data-type="horizontal">
|
||||
<asp:DropDownList runat="server" ID="ddlOra" name="Ora" DataSourceID="odsOra" DataTextField="Ora" DataValueField="Ora" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList runat="server" ID="ddlMin" name="Min" DataSourceID="odsMin" DataTextField="Minuto" DataValueField="Minuto"
|
||||
data-mini="true">
|
||||
</asp:DropDownList>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="odsOra" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getHoursTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsMin" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getMinTableAdapter">
|
||||
<SelectParameters>
|
||||
<%--<asp:Parameter DefaultValue="5" Name="interv" Type="Int32" />--%>
|
||||
<asp:ControlParameter ControlID="lblSnapMin" DefaultValue="5" Name="interv" Type="Int32" PropertyName="Text" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label runat="server" Visible="false" ID="lblSnapMin" />
|
||||
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_dateTimeJQM : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// cambio il target x il popup che mostrerà il selettore calendario...
|
||||
hlPUCal.NavigateUrl = string.Format("#{0}", popupBasic.UniqueID).Replace("$", "_");
|
||||
}
|
||||
/// <summary>
|
||||
/// Valore di arrotondamento x selettore minuti
|
||||
/// </summary>
|
||||
public int snapMinuti
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 5;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(lblSnapMin.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblSnapMin.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// valore datetime selezionato!
|
||||
/// </summary>
|
||||
public DateTime valoreDateTime
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
try
|
||||
{
|
||||
int oreSel = Convert.ToInt32(ddlOra.SelectedValue);
|
||||
int minSel = Convert.ToInt32(ddlMin.SelectedValue);
|
||||
answ = Convert.ToDateTime(lblDataRif.Text).AddHours(oreSel).AddMinutes(minSel);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblDataRif.Text = value.Date.ToShortDateString();
|
||||
ddlOra.SelectedValue = value.Hour.ToString();
|
||||
ddlMin.SelectedValue = value.Minute.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa data
|
||||
/// </summary>
|
||||
public string lblabelData
|
||||
{
|
||||
get
|
||||
{
|
||||
return lblData.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblData.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa ora
|
||||
/// </summary>
|
||||
public string lblabelOra
|
||||
{
|
||||
get
|
||||
{
|
||||
return lblOra.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblOra.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// aggiorno data selezionata!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void calDataRif_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
// recupero ore e minuti...
|
||||
int oreSel = Convert.ToInt32(ddlOra.SelectedValue);
|
||||
int minSel = Convert.ToInt32(ddlMin.SelectedValue);
|
||||
valoreDateTime = calDataRif.SelectedDate.AddHours(oreSel).AddMinutes(minSel);
|
||||
}
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_dateTimeJQM {
|
||||
|
||||
/// <summary>
|
||||
/// lblData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblData;
|
||||
|
||||
/// <summary>
|
||||
/// hlPUCal control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlPUCal;
|
||||
|
||||
/// <summary>
|
||||
/// lblDataRif control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDataRif;
|
||||
|
||||
/// <summary>
|
||||
/// popupBasic control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel popupBasic;
|
||||
|
||||
/// <summary>
|
||||
/// calDataRif control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Calendar calDataRif;
|
||||
|
||||
/// <summary>
|
||||
/// lblOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlMin;
|
||||
|
||||
/// <summary>
|
||||
/// odsOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsOra;
|
||||
|
||||
/// <summary>
|
||||
/// odsMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsMin;
|
||||
|
||||
/// <summary>
|
||||
/// lblSnapMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblSnapMin;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettaglioProgetto.ascx.cs" Inherits="GPW.WebUserControls.mod_dettaglioProgetto" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:FormView ID="fmView" runat="server" DataSourceID="ods">
|
||||
<ItemTemplate>
|
||||
<div class="dataBlockHeader">
|
||||
Resoconto progetto
|
||||
</div>
|
||||
<div class="dataBlock">
|
||||
<div class="blockSizeSmallest">
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Budget:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="oreBudgetLabel" runat="server" Text='<%# Bind("oreBudget","{0:0.##} h") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
Attivo:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:CheckBox runat="server" ID="chkAttivo" Checked='<%# Bind("Attivo") %>' AutoPostBack="true" OnCheckedChanged="chkAttivo_CheckedChanged" Enabled='<%# isWritable() %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Erogate:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="oreTotLabel" runat="server" Text='<%# Bind("oreTot","{0:0.##} h") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
% budget
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="lblPercErogate" runat="server" Text='<%# percRatio(Eval("oreTot"),Eval("oreBudget")) %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Mese corr:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="oreMeseLabel" runat="server" Text='<%# Bind("oreMese","{0:0.##} h") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
% erogate
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="lblPercMese" runat="server" Text='<%# percRatio(Eval("oreMese"),Eval("oreTot")) %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Mese prec:
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="oreMesePrecLabel" runat="server" Text='<%# Bind("oreMesePrec","{0:0.##} h") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
% erogate
|
||||
</div>
|
||||
<div class="dataBlockValue">
|
||||
<asp:Label ID="lblPercMesePrec" runat="server" Text='<%# percRatio(Eval("oreMesePrec"),Eval("oreTot")) %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockSx">
|
||||
<div class="dataBlockLabel">
|
||||
Starred
|
||||
</div>
|
||||
<%--<div class="dataBlockValue">
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("oreMesePrec","{0:0.##} h") %>' />
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="dataBlockDx">
|
||||
<div class="dataBlockLabel">
|
||||
<asp:CheckBox runat="server" ID="chkStarred" Checked='<%# Bind("starred") %>' AutoPostBack="true" OnCheckedChanged="chkStarred_CheckedChanged" Enabled='<%# isWritable() %>' />
|
||||
</div>
|
||||
<%--<div class="dataBlockValue">
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# percRatio(Eval("oreMesePrec"),Eval("oreTot")) %>' />
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="dataBlockReset">
|
||||
</div>
|
||||
<div class="dataBlockBtn">
|
||||
<asp:Button runat="server" ID="btnFasi" Text="Dettaglio Fasi" OnClick="btnFasi_Click" CssClass="btnNaviga" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_statsProjTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="idxProgetto" SessionField="idxProgetto_sel" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using GPW_data;
|
||||
using SteamWare;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_dettaglioProgetto : System.Web.UI.UserControl
|
||||
{
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// pagina corrente (URL finale)
|
||||
/// </summary>
|
||||
public string _paginaCorrente { get; set; }
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
PagCorrente();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salva in variabile pagina il nome della pagina corrente
|
||||
/// </summary>
|
||||
protected void PagCorrente()
|
||||
{
|
||||
Uri MyUrl = Request.Url;
|
||||
string delimStr = "/";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||
int n = finalUrl.Length;
|
||||
_paginaCorrente = finalUrl[n - 1].ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola il rapporto, in %, tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="numeratore"></param>
|
||||
/// <param name="divisore"></param>
|
||||
/// <returns></returns>
|
||||
public string percRatio(object numeratore, object divisore)
|
||||
{
|
||||
string answ = "";
|
||||
double num = 0;
|
||||
double div = 1;
|
||||
try
|
||||
{
|
||||
num = Convert.ToDouble(numeratore);
|
||||
div = Convert.ToDouble(divisore);
|
||||
if (div <= 0)
|
||||
{
|
||||
answ = "n.a.";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = string.Format("{0:P1}", num / div);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// rimanda a pagina fasi!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnFasi_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("fasi.aspx");
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo check attivazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkAttivo_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo update attivo/non attivo...
|
||||
CheckBox chkBox = (CheckBox)sender;
|
||||
DataProxy.DP.taAP.updateAttivo(chkBox.Checked, memLayer.ML.IntSessionObj("idxProgetto_sel"));
|
||||
fmView.DataBind();
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo check attivazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkStarred_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo update attivo/non attivo...
|
||||
CheckBox chkBox = (CheckBox)sender;
|
||||
DataProxy.DP.taAP.updateStarred(chkBox.Checked, memLayer.ML.IntSessionObj("idxProgetto_sel"));
|
||||
fmView.DataBind();
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool isWritable()
|
||||
{
|
||||
bool answ = false;
|
||||
if (_paginaCorrente == null)
|
||||
{
|
||||
PagCorrente();
|
||||
}
|
||||
answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_dettaglioProgetto {
|
||||
|
||||
/// <summary>
|
||||
/// fmView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.FormView fmView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_elencoTimbr.ascx.cs" Inherits="GPW.WebUserControls.mod_elencoTimbr" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:GridView ID="grView" runat="server" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="dataOra,idxDipendente"
|
||||
CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="Smaller" Width="100%" OnRowDeleted="grView_RowDeleted"
|
||||
OnRowUpdated="grView_RowUpdated">
|
||||
<AlternatingRowStyle CssClass="alternatingRowStyle" />
|
||||
<EditRowStyle CssClass="editRowStyle" />
|
||||
<FooterStyle CssClass="footerStyle" ForeColor="White" />
|
||||
<HeaderStyle CssClass="headerStyle" ForeColor="White" />
|
||||
<PagerStyle CssClass="pagerStyle" ForeColor="White" />
|
||||
<RowStyle CssClass="rowStyle" />
|
||||
<SelectedRowStyle CssClass="selectedRowStyle" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle CssClass="sortAscCell" />
|
||||
<SortedAscendingHeaderStyle CssClass="sortAscHead" />
|
||||
<SortedDescendingCellStyle CssClass="sortDescCell" />
|
||||
<SortedDescendingHeaderStyle CssClass="sortDescHead" />
|
||||
<EmptyDataTemplate>
|
||||
<div style="background-color: #ACACAC;">
|
||||
Nessun record TIMBRATURA
|
||||
</div>
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDip" runat="server" Text='<%# cognomeNome(Eval("idxDipendente")) %>' Visible='<%# showUserName %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="data - ora" SortExpression="dataOra" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblData" runat="server" Text='<%# Eval("dataOra", "{0:MM/dd - HH:mm}") %>' Visible='<%# invBool(showLongDateFormat) %>' />
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("dataOra", "{0:yyyy/MM/dd ddd - HH:mm}") %>' Visible='<%# showLongDateFormat %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label runat="server" ID="lblHeadIn" Text="IN" />
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label ID="lblIn" runat="server" Text="X" Visible='<%# Eval("entrata") %>' ForeColor="#666666" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:ImageButton runat="server" ID="btnSwapInOut" ToolTip="Scambia In/Out" CommandName="Update" ImageUrl="~/images/InOutArrows_m.png" Visible='<%# userCanDelete(Eval("Approv")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="cbeSwapInOut" runat="server" ConfirmText="Procedo con scambio Entrata/Uscita della timbratura?"
|
||||
TargetControlID="btnSwapInOut">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label runat="server" ID="lblHeadOut" Text="OUT" />
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<asp:Label ID="lblOut" runat="server" Text="X" Visible='<%# invBool(Eval("entrata")) %>' ForeColor="#666666" />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<div style="padding: 10px;">
|
||||
<asp:LinkButton runat="server" ID="lbDelete" Text="Elimina" CommandArgument="Elimina" CommandName="Delete" CssClass="btnDelete btnRosso" Visible='<%# userCanDelete(Eval("Approv")) %>' />
|
||||
<asp:ConfirmButtonExtender ID="cbeDelete" runat="server" ConfirmText="Sicuro di voler eliminare la timbratura? non è possibile annullare l'operazione."
|
||||
TargetControlID="lbDelete">
|
||||
</asp:ConfirmButtonExtender>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByIdxDipPeriodo"
|
||||
TypeName="GPW_data.DS_ApplicazioneTableAdapters.TimbratureTableAdapter" DeleteMethod="DeleteNonAppr" UpdateMethod="updateSwapInOut">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDip_det" Name="idxDipendente" Type="Int32" DefaultValue="0" />
|
||||
<asp:SessionParameter SessionField="inizioDet" Name="inizio" Type="DateTime" />
|
||||
<asp:SessionParameter SessionField="fineDet" Name="fine" Type="DateTime" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using GPW_data;
|
||||
using SteamWare;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_elencoTimbr : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// evento update valori
|
||||
/// </summary>
|
||||
public event EventHandler eh_nuovoValore;
|
||||
/// <summary>
|
||||
/// evento update righe
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
raiseUpdate();
|
||||
}
|
||||
|
||||
private void raiseUpdate()
|
||||
{
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// evento cancellazione riga
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
raiseUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// imposto ODS
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
ods.DataBind();
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola cognome-nome da idx
|
||||
/// </summary>
|
||||
/// <param name="idxDip"></param>
|
||||
/// <returns></returns>
|
||||
public string cognomeNome(object idxDip)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
DS_Applicazione.DipendentiRow rigaDip = DataProxy.DP.taDipendenti.getByIdx(Convert.ToInt32(idxDip))[0];
|
||||
answ = string.Format("{0} {1}", rigaDip.Cognome, rigaDip.Nome);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// converte valore in booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool toBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se l'utente possa approvare la modifica oraria
|
||||
/// </summary>
|
||||
public bool userCanApprove
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = user_std.UtSn.userHasRight("GPW_admin");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se l'utente possa eliminare il record:
|
||||
/// - se non approvato
|
||||
/// - se admin
|
||||
/// </summary>
|
||||
public bool userCanDelete(object approvata)
|
||||
{
|
||||
bool answ = !Convert.ToBoolean(approvata);
|
||||
try
|
||||
{
|
||||
answ = user_std.UtSn.userHasRight("GPW_admin");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia visibile username
|
||||
/// </summary>
|
||||
public bool showUserName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia visibile formato data estesa
|
||||
/// </summary>
|
||||
public bool showLongDateFormat { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_elencoTimbr {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByAuthKey.ascx.cs"
|
||||
Inherits="GPW.WebUserControls.mod_enrollByAuthKey" %>
|
||||
<h3>
|
||||
Registrazione Con AuthKey Personale</h3>
|
||||
<label for="ddlIdxDipendente">
|
||||
Selezionare Dipendente:</label>
|
||||
<asp:DropDownList ID="ddlIdxDipendente" runat="server" DataSourceID="odsDipendenti"
|
||||
DataTextField="label" DataValueField="value">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsDipendenti" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.v_selDipendentiTableAdapter">
|
||||
</asp:ObjectDataSource>
|
||||
<br />
|
||||
<label for="UserAuthKey">
|
||||
UserAuthKey:</label>
|
||||
<asp:TextBox runat="server" ID="txtUserAuthKey" TextMode="Password" />
|
||||
<br />
|
||||
<asp:Label runat="server" ID="lblWarning" Visible="false" />
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:Button runat="server" ID="btnConferma" Text="Salva" data-theme="b" OnClick="btnConferma_Click" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" data-theme="e" CausesValidation="false"
|
||||
OnClick="btnAnnulla_Click" />
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
|
||||
<h3>
|
||||
Spiegazione</h3>
|
||||
Questa funzione permette di inserire un devices tra quelli gestiti tramite la AuthKey
|
||||
personale (da richiedere all'admin se non nota).
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_enrollByAuthKey : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo nuovo device...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnConferma_Click(object sender, EventArgs e)
|
||||
{
|
||||
// controllo se ho i dati...
|
||||
string plainUserAuthKey = txtUserAuthKey.Text.Trim();
|
||||
// in primis cerco il dipendente data la authKey...
|
||||
int idxDipendente = 0;
|
||||
try
|
||||
{
|
||||
idxDipendente = Convert.ToInt32(ddlIdxDipendente.SelectedValue);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
// controllo dipendente... che sia selezionato uno valido
|
||||
if (idxDipendente > 0)
|
||||
{
|
||||
// dichiarazione variabili
|
||||
string userAgent = "";
|
||||
bool fatto = false;
|
||||
string DeviceName = "";
|
||||
string IPv4 = "";
|
||||
string md5UserAuthKey = "";
|
||||
int trovate = 0;
|
||||
try
|
||||
{
|
||||
// recupero dati da session
|
||||
userAgent = Request.UserAgent;
|
||||
DeviceName = Request.UserHostName;
|
||||
IPv4 = Request.UserHostName;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore recupero dati da sessione x user, device, IP", tipoLog.ERROR);
|
||||
}
|
||||
// calcolo authKey... cerco se ne trovo x utente encrypted o unencrypted
|
||||
md5UserAuthKey = SteamCrypto.EncryptString(plainUserAuthKey, "AuthGPW");
|
||||
logger.lg.scriviLog(string.Format("Richiesta auth smart device per idxDipendente {0} con key MD5 {1}", idxDipendente, md5UserAuthKey), tipoLog.INFO);
|
||||
try
|
||||
{
|
||||
trovate = DataProxy.DP.taDipendenti.getByAuthKey(idxDipendente, md5UserAuthKey).Rows.Count + DataProxy.DP.taDipendenti.getByAuthKey(idxDipendente, plainUserAuthKey).Rows.Count;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore ricerca key in chiaro/MD5 x utente", tipoLog.ERROR);
|
||||
}
|
||||
if (trovate > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
fatto = DataProxy.DP.enrollDevice(md5UserAuthKey, IPv4, DeviceName, userAgent, idxDipendente);
|
||||
if (fatto)
|
||||
{
|
||||
Response.Redirect("~/Timbrature.aspx");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in registrazione nuovo device con AuthKey CIFRATA x utente: {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "AuthKey non trovata! richiedere reset ad Admin.";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "Dipendente non trovato!";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in registrazione device: {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// resetto tutto
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAnnulla_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtUserAuthKey.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_enrollByAuthKey {
|
||||
|
||||
/// <summary>
|
||||
/// ddlIdxDipendente control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlIdxDipendente;
|
||||
|
||||
/// <summary>
|
||||
/// odsDipendenti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsDipendenti;
|
||||
|
||||
/// <summary>
|
||||
/// txtUserAuthKey control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtUserAuthKey;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// btnConferma control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnConferma;
|
||||
|
||||
/// <summary>
|
||||
/// btnAnnulla control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnAnnulla;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByEmail.ascx.cs"
|
||||
Inherits="GPW.WebUserControls.mod_enrollByEmail" %>
|
||||
<h3>
|
||||
Reset AuthKey via email</h3>
|
||||
<label for="txtUserEmail">
|
||||
Email utente:</label>
|
||||
<asp:TextBox runat="server" ID="txtUserEmail" />
|
||||
<br />
|
||||
<asp:Label runat="server" ID="lblWarning" Visible="false" />
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:Button runat="server" ID="btnConferma" Text="Salva" data-theme="b" OnClick="btnConferma_Click" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" data-theme="e" CausesValidation="false"
|
||||
OnClick="btnAnnulla_Click" />
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
|
||||
<h3>
|
||||
Spiegazione</h3>
|
||||
Questa funzione permette di inserire un email e se questa è tra quelle registrate
|
||||
per i dipendenti sarà generata una nuova AuthKey personale e verrà inviato all'email
|
||||
stessa il link con tale key di autoenroll.
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_enrollByEmail : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo nuovo device...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnConferma_Click(object sender, EventArgs e)
|
||||
{
|
||||
// cerco se esista l'utente data la sua email...
|
||||
int idxDipendente = 0;
|
||||
string UserAuthKey = "";
|
||||
string destinatario = "";
|
||||
DS_Applicazione.DipendentiRow dipendente = null;
|
||||
try
|
||||
{
|
||||
dipendente = DataProxy.DP.taDipendenti.getByEmail(txtUserEmail.Text.Trim())[0];
|
||||
idxDipendente = dipendente.idxDipendente;
|
||||
UserAuthKey = dipendente.authKey;
|
||||
destinatario = dipendente.email;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (destinatario != "" && idxDipendente > 0)
|
||||
{
|
||||
// invio email...
|
||||
DataProxy.DP.sendUserAuthEmail(destinatario, UserAuthKey, idxDipendente);
|
||||
logger.lg.scriviLog(string.Format("Inviata mail x auth smart device: destinatario: {0}, authKey: {1}, idxDip: {2}", destinatario, UserAuthKey, idxDipendente), tipoLog.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "Email non valida/dipendente non trovato!";
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// resetto tutto
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAnnulla_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtUserEmail.Text = "";
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_enrollByEmail {
|
||||
|
||||
/// <summary>
|
||||
/// txtUserEmail control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtUserEmail;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// btnConferma control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnConferma;
|
||||
|
||||
/// <summary>
|
||||
/// btnAnnulla control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnAnnulla;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByJumperAuthKey.ascx.cs" Inherits="GPW.WebUserControls.mod_enrollByJumperAuthKey" %>
|
||||
<%--è una procedura automatica, niente elementi grafici!--%>
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_enrollByJumperAuthKey : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// procedo alla ricerca di dati via sessione x User AuthKey
|
||||
tryAutoEnroll();
|
||||
}
|
||||
/// <summary>
|
||||
/// prova a fare auto enroll
|
||||
/// </summary>
|
||||
public void tryAutoEnroll()
|
||||
{
|
||||
// recupero dati da session
|
||||
string UserAuthKey = "";
|
||||
int idxDipendente = 0;
|
||||
string userAgent = "";
|
||||
bool fatto = false;
|
||||
string DeviceName = "";
|
||||
string IPv4 = "";
|
||||
try
|
||||
{
|
||||
UserAuthKey = memLayer.ML.StringSessionObj("UserAuthKey");
|
||||
idxDipendente = memLayer.ML.IntSessionObj("idxDipendente");
|
||||
userAgent = Request.UserAgent;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// se ci sono i dati effettua tentativo di AutoEnroll del device
|
||||
if (idxDipendente > 0 && UserAuthKey != "")
|
||||
{
|
||||
DeviceName = Request.UserHostName;
|
||||
IPv4 = Request.UserHostName;
|
||||
fatto = DataProxy.DP.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, idxDipendente);
|
||||
if (fatto)
|
||||
{
|
||||
Response.Redirect("Timbrature.aspx");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_enrollByJumperAuthKey
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_filtro" CodeBehind="mod_filtro.ascx.cs" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<div>
|
||||
<div style="float: left;">
|
||||
<asp:CheckBox ID="chkFilt" runat="server" Checked="false" AutoPostBack="True" CssClass='<%# css %>' OnCheckedChanged="chkFilt_CheckedChanged" />
|
||||
</div>
|
||||
<div style="float: left;">
|
||||
<asp:ComboBox ID="dlFilt" runat="server" Visible="False" DataTextField="label" DataValueField="value" AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" AutoPostBack="True" OnSelectedIndexChanged="dlFilt_SelectedIndexChanged" CssClass="Windows" />
|
||||
</div>
|
||||
<div style="float: left;">
|
||||
<asp:Label ID="where" runat="server" Visible="false" Text="" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,446 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using SteamWare;
|
||||
|
||||
public partial class mod_filtro : ApplicationUserControl
|
||||
{
|
||||
protected string _css;
|
||||
protected ObjectDataSource _ods;
|
||||
protected string _valore
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj(string.Format("valFiltro_{0}", this.ID));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), value, false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola se ci sia in sessione il valore del filtro
|
||||
/// </summary>
|
||||
protected bool valueInSession
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ=false;
|
||||
try
|
||||
{
|
||||
memLayer.ML.isInSessionObject(string.Format("valFiltro_{0}", this.ID));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected bool _changeCheckEnabled = true;
|
||||
protected bool _changeCheckVisible = true;
|
||||
protected bool _changeSelEnabled = true;
|
||||
protected string _where = "";
|
||||
protected string _showFiltered
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj(string.Format("_showFiltered_{0}", this.ID));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("_showFiltered_{0}", this.ID), value);
|
||||
traduciObj();
|
||||
}
|
||||
}
|
||||
protected string _showAll
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj(string.Format("_showAll_{0}", this.ID));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("_showAll_{0}", this.ID), value);
|
||||
traduciObj();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (_showFiltered == "") _showFiltered = "mostraSoloSelez";
|
||||
if (_showAll == "") _showAll = "mostraTutti";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// traduzione oggetti
|
||||
/// </summary>
|
||||
protected override void traduciObj()
|
||||
{
|
||||
if (_changeCheckVisible)
|
||||
{
|
||||
if (!chkFilt.Checked)
|
||||
{
|
||||
chkFilt.Text = traduci(_showFiltered);
|
||||
}
|
||||
else
|
||||
{
|
||||
chkFilt.Text = traduci(_showAll);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// get/set messaggio di attivazione filtraggio
|
||||
/// </summary>
|
||||
public string filterChekText
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showFiltered;
|
||||
}
|
||||
set
|
||||
{
|
||||
_showFiltered = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// get/set messaggio di disattivazione filtraggio
|
||||
/// </summary>
|
||||
public string filterUnchekText
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showAll;
|
||||
}
|
||||
set
|
||||
{
|
||||
_showAll = value;
|
||||
}
|
||||
}
|
||||
protected void chkFilt_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// cambio modalità visualizzazione del filtro...
|
||||
dlFilt.Visible = !dlFilt.Visible;
|
||||
raiseSelEvent();
|
||||
}
|
||||
|
||||
protected void raiseSelEvent()
|
||||
{
|
||||
if (!dlFilt.Visible)
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), "", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_valore = dlFilt.SelectedValue;
|
||||
}
|
||||
if (eh_selValore != null)
|
||||
{
|
||||
eh_selValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
protected void updateChk()
|
||||
{
|
||||
chkFilt.Enabled = _changeCheckEnabled;
|
||||
if (!_changeCheckEnabled)
|
||||
{
|
||||
chkFilt.Checked = true;
|
||||
dlFilt.Visible = true;
|
||||
}
|
||||
}
|
||||
protected void updateSel()
|
||||
{
|
||||
dlFilt.Enabled = _changeSelEnabled;
|
||||
}
|
||||
protected void updateChkLbl()
|
||||
{
|
||||
chkFilt.Visible = _changeCheckVisible;
|
||||
}
|
||||
protected override void bindControlli()
|
||||
{
|
||||
updateChk();
|
||||
fixValore();
|
||||
where.Text = _where;
|
||||
traduciObj();
|
||||
}
|
||||
protected SteamWare.tipoVistaMod _modo = SteamWare.tipoVistaMod.editing;
|
||||
protected void dlFilt_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseSelEvent();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// condizione where per ridurre elementi mostrati in selettore
|
||||
/// </summary>
|
||||
public string condizione
|
||||
{
|
||||
get
|
||||
{
|
||||
return _where;
|
||||
}
|
||||
set
|
||||
{
|
||||
_where = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// fornisce il valore scelto o "*" se nulla selezionato
|
||||
/// </summary>
|
||||
public string valore
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
if (chkFilt.Checked)
|
||||
{
|
||||
answ = dlFilt.SelectedValue;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
_valore = value;
|
||||
//fixValore();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// primo valore di una chiave multicampo
|
||||
/// </summary>
|
||||
public string val_1
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (chkFilt.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] _dataKey = dlFilt.SelectedValue.Split('#');
|
||||
answ = _dataKey[0];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "*";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// secondo valore di una chiave multicampo
|
||||
/// </summary>
|
||||
public string val_2
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (chkFilt.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] _dataKey = dlFilt.SelectedValue.Split('#');
|
||||
answ = _dataKey[1];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "*";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// fornisce il valore scelto o "0" se nulla selezionato o non valido
|
||||
/// </summary>
|
||||
public int valoreInt
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = -1;
|
||||
try
|
||||
{
|
||||
if (chkFilt.Checked)
|
||||
{
|
||||
answ = Convert.ToInt32(dlFilt.SelectedValue);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema visualizzazione
|
||||
/// </summary>
|
||||
protected void fixValore()
|
||||
{
|
||||
if (_ods != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
dlFilt.DataSource = _ods;
|
||||
dlFilt.DataBind();
|
||||
if (_valore != "")
|
||||
{
|
||||
|
||||
dlFilt.SelectedValue = _valore;
|
||||
dlFilt.Visible = true;
|
||||
chkFilt.Checked = true;
|
||||
}
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
dlFilt.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia possibile (de)selezionare il check di filtraggio, altrimenti sempre attivo
|
||||
/// </summary>
|
||||
public bool changeCheckEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _changeCheckEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
_changeCheckEnabled = value;
|
||||
updateChk();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia possibile modificare la selezione
|
||||
/// </summary>
|
||||
public bool changeSelEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _changeSelEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
_changeSelEnabled = value;
|
||||
updateSel();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se sia possibile visibile il check di filtraggio
|
||||
/// </summary>
|
||||
public bool changeCheckVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
return _changeCheckVisible;
|
||||
}
|
||||
set
|
||||
{
|
||||
_changeCheckVisible = value;
|
||||
updateChkLbl();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// get/set della checkbox
|
||||
/// </summary>
|
||||
public bool isChecked
|
||||
{
|
||||
get
|
||||
{
|
||||
return chkFilt.Checked;
|
||||
}
|
||||
set
|
||||
{
|
||||
chkFilt.Checked = value;
|
||||
dlFilt.Visible = value;
|
||||
updateChkLbl();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oggetto ODS con cui popolare il selettore, VINCOLO abbia campi value(key) / label
|
||||
/// </summary>
|
||||
public ObjectDataSource ods
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ods;
|
||||
}
|
||||
set
|
||||
{
|
||||
_ods = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// css applicato agli elementi del controllo
|
||||
/// </summary>
|
||||
public string css
|
||||
{
|
||||
get
|
||||
{
|
||||
return _css;
|
||||
}
|
||||
set
|
||||
{
|
||||
_css = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta il controllo (un-checked)
|
||||
/// </summary>
|
||||
public void reset()
|
||||
{
|
||||
chkFilt.Checked = false;
|
||||
dlFilt.Visible = false;
|
||||
memLayer.ML.emptySessionVal(string.Format("valFiltro_{0}", this.ID));
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta e seleziona primo valore
|
||||
/// </summary>
|
||||
public void reselFirst()
|
||||
{
|
||||
dlFilt.DataBind();
|
||||
bindControlli();
|
||||
try
|
||||
{
|
||||
dlFilt.SelectedIndex = 0;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// get/set per la larghezza della combo dropdown
|
||||
/// </summary>
|
||||
public int comboWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return Convert.ToInt32(dlFilt.Width);
|
||||
}
|
||||
set
|
||||
{
|
||||
dlFilt.Width = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_filtro {
|
||||
|
||||
/// <summary>
|
||||
/// chkFilt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkFilt;
|
||||
|
||||
/// <summary>
|
||||
/// dlFilt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.ComboBox dlFilt;
|
||||
|
||||
/// <summary>
|
||||
/// where control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label where;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_footer.ascx.cs" Inherits="GPW.WebUserControls.mod_footer" %>
|
||||
<div data-role="navbar" data-iconpos="top">
|
||||
<ul>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnTimbra" data-role="button" data-icon="home" NavigateUrl="~/A3/Timbrature.aspx" rel="external">Timbra</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnProgetti" data-role="button" data-icon="grid" NavigateUrl="~/A3/Progetti.aspx" rel="external">Progetti</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink runat="server" ID="btnAdmin" data-role="button" data-icon="gear" NavigateUrl="~/A3/Admin.aspx" rel="external">Admin</asp:HyperLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_footer : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_footer {
|
||||
|
||||
/// <summary>
|
||||
/// btnTimbra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink btnTimbra;
|
||||
|
||||
/// <summary>
|
||||
/// btnProgetti control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink btnProgetti;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdmin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink btnAdmin;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" CodeBehind="mod_login.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel ID="pnlForceUser" runat="server">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="chPwdTitle">
|
||||
<asp:Label runat="server" ID="lblTitolo" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="authKey" TextMode="Password" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblDominio" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="dominio" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="user" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Button Width="100%" runat="server" ID="btnOk" CommandName="ok" CommandArgument="ok"
|
||||
OnClick="btnOk_Click"></asp:Button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Label CssClass="chPwdTxt" ID="lblMessage" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<asp:HyperLink ID="HypLinkSSO" runat="server" NavigateUrl="~/login.aspx" Text="Single-Sign-On Login"></asp:HyperLink>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,241 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using SteamWare;
|
||||
|
||||
/// <summary>
|
||||
/// classe gestione login e forzatura login
|
||||
/// </summary>
|
||||
public partial class mod_login : ApplicationUserControl
|
||||
{
|
||||
#region area protected/private
|
||||
|
||||
#region area proprietà
|
||||
|
||||
private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area metodi
|
||||
|
||||
/// <summary>
|
||||
/// imposta la modalità di login tra normale / forceUser
|
||||
/// </summary>
|
||||
private void setLoginMode()
|
||||
{
|
||||
if (_isForceUser == SteamWare.loginMode.forceUser)
|
||||
{
|
||||
pnlForceUser.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlForceUser.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void traduciObj()
|
||||
{
|
||||
lblPwd.Text = user_std.UtSn.Traduci("lblPwd");
|
||||
lblUser.Text = user_std.UtSn.Traduci("lblUser");
|
||||
lblDominio.Text = user_std.UtSn.Traduci("lblDominio");
|
||||
lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente");
|
||||
btnOk.Text = user_std.UtSn.Traduci("btnCommit");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// prova a verificare se l'utente sia ok x AD credentials
|
||||
/// </summary>
|
||||
private void AdLogin()
|
||||
{
|
||||
lblMessage.Text = traduci("UserNotAuth");
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
//recupera user windows se c'è...
|
||||
string ad_name = Page.User.Identity.Name;
|
||||
string delimStr = "\\";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] dom_user = ad_name.Split(delimiter, 2);
|
||||
// passo al controllo di verifica ADuserOk...
|
||||
user_std _utente = new user_std();
|
||||
if (_utente.ADuserOk(dom_user[0], dom_user[1]))
|
||||
{
|
||||
bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]);
|
||||
if (fatto)
|
||||
{
|
||||
SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO);
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("{0}<br>There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
|
||||
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (memLayer.ML.confReadBool("autoEnrollEnabled"))
|
||||
{
|
||||
// rimando al modulo di auto enroll...
|
||||
Response.Redirect("autoEnroll.aspx");
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("{0}<br>user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
|
||||
SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
|
||||
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua verifiche e se concesso permette di forzare l'accesso utente
|
||||
/// </summary>
|
||||
private void ForceUserIdentity()
|
||||
{
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
bool _allowForceUser = false;
|
||||
try
|
||||
{
|
||||
_allowForceUser = SteamWare.memLayer.ML.confReadBool("_allowForceUser");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_allowForceUser = false;
|
||||
}
|
||||
if (_allowForceUser)
|
||||
{
|
||||
if (authKey.Text == "triplete") // verifica passphrase...
|
||||
{
|
||||
user_std _utente = new user_std();
|
||||
user_std.UtSn.isForcedUser = true;
|
||||
bool fatto = _utente.startUpUtente(dominio.Text, user.Text);
|
||||
if (fatto)
|
||||
{
|
||||
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("{0}<br>key not allowed for operation!!! operation logged!!!", user_std.UtSn.Traduci("AccessFail"));
|
||||
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
ForceUserIdentity();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
#region eventi pubblici esposti
|
||||
|
||||
public event EventHandler Login_ok;
|
||||
public event EventHandler Login_Error;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area proprietà
|
||||
|
||||
/// <summary>
|
||||
/// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
|
||||
/// </summary>
|
||||
public SteamWare.loginMode modoLogin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isForceUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isForceUser = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
protected override void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
base.Page_Load(sender, e);
|
||||
//carico da web.config i default values
|
||||
loadDefaultsWebConfig();
|
||||
// procedo...
|
||||
setLoginMode();
|
||||
Session.RemoveAll();
|
||||
if (_isForceUser == SteamWare.loginMode.normale)
|
||||
{
|
||||
AdLogin();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_login {
|
||||
|
||||
/// <summary>
|
||||
/// pnlForceUser control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlForceUser;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitolo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTitolo;
|
||||
|
||||
/// <summary>
|
||||
/// lblPwd control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPwd;
|
||||
|
||||
/// <summary>
|
||||
/// authKey control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox authKey;
|
||||
|
||||
/// <summary>
|
||||
/// lblDominio control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDominio;
|
||||
|
||||
/// <summary>
|
||||
/// dominio control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox dominio;
|
||||
|
||||
/// <summary>
|
||||
/// lblUser control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblUser;
|
||||
|
||||
/// <summary>
|
||||
/// user control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox user;
|
||||
|
||||
/// <summary>
|
||||
/// btnOk control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnOk;
|
||||
|
||||
/// <summary>
|
||||
/// lblMessage control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMessage;
|
||||
|
||||
/// <summary>
|
||||
/// HypLinkSSO control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO;
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_mancTimb.ascx.cs" Inherits="GPW.WebUserControls.mod_mancTimb" %>
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:RadioButtonList ID="rblEntrata" runat="server" data-role="controlgroup" data-type="horizontal" RepeatDirection="Horizontal">
|
||||
<asp:ListItem Text="IN" Value="true" />
|
||||
<asp:ListItem Text="OUT" Value="false" />
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:DropDownList runat="server" ID="ddlData" name="Data" DataSourceID="odsDateValide" DataTextField="Data" DataValueField="Data" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsDateValide" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getLastDaysTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter Name="lastDate" SessionField="today" Type="DateTime" />
|
||||
<asp:Parameter DefaultValue="10" Name="numD" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<label for="Ora">
|
||||
Ora:</label>
|
||||
<asp:DropDownList runat="server" ID="ddlOra" name="Ora" DataSourceID="odsOra" DataTextField="Ora" DataValueField="Ora" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsOra" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getHoursTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<label for="Min">
|
||||
Min:</label>
|
||||
<asp:DropDownList runat="server" ID="ddlMin" name="Min" DataSourceID="odsMin" DataTextField="Minuto" DataValueField="Minuto" data-mini="true">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsMin" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.stp_getMinTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:Parameter DefaultValue="5" Name="interv" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<asp:Button ID="btnRichMT" runat="server" Text="Richiesta" data-theme="b" data-icon="check" OnClick="btnRichMT_Click" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:HyperLink runat="server" ID="hlMancateTimbr" data-role="button" data-theme="a" rel="external" data-icon="back" Text="Return" NavigateUrl="~/A3/Timbrature.aspx" />
|
||||
</div>
|
||||
</div>
|
||||
<label for="grView">
|
||||
Richieste in corso:
|
||||
</label>
|
||||
<asp:GridView ID="grView" nome="grView" runat="server" AllowPaging="True" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="dataOra,idxDipendente" CellPadding="4" ForeColor="#333333" GridLines="None" Font-Size="Smaller" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowUpdated="grView_RowUpdated">
|
||||
<AlternatingRowStyle BackColor="White" />
|
||||
<EditRowStyle BackColor="#2461BF" />
|
||||
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
|
||||
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
|
||||
<RowStyle BackColor="#EFF3FB" />
|
||||
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
|
||||
<SortedAscendingCellStyle BackColor="#F5F7FB" />
|
||||
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
|
||||
<SortedDescendingCellStyle BackColor="#E9EBEF" />
|
||||
<SortedDescendingHeaderStyle BackColor="#4870BE" />
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDip" runat="server" Text='<%# cognomeNome(Eval("idxDipendente")) %>' Visible='<%# userCanApprove %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="dataOra" SortExpression="dataOra" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblData" runat="server" Text='<%# Eval("dataOra", "{0:MM-dd ddd<br> HH:mm}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="IN" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblIn" runat="server" Text="X" Visible='<%# Eval("entrata") %>' ForeColor="#666666" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="OUT" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblOut" runat="server" Text="X" Visible='<%# invBool(Eval("entrata")) %>' ForeColor="#666666" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbDelete" Text="Elimina" data-role="button" data-mini="true" CommandArgument="Elimina" CommandName="Delete" data-inline="true" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbApprova" Visible='<%# userCanApprove %>' Text="Approva" data-role="button" data-mini="true" CommandArgument="approva" CommandName="Select" data-inline="true" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getNonApprByDip" TypeName="GPW_data.DS_ApplicazioneTableAdapters.TimbratureTableAdapter" DeleteMethod="DeleteNonAppr">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxDipendente" Type="Int32" />
|
||||
<asp:Parameter Name="Original_dataOra" Type="DateTime" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter SessionField="idxDipendente" Name="idxDipendente" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a">
|
||||
<div data-role="fieldcontain">
|
||||
<label for="arrot">
|
||||
Min. arrot.
|
||||
</label>
|
||||
<asp:TextBox runat="server" ID="txtArrot" name="arrot" Text="5" Width="2em" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<asp:CheckBox runat="server" ID="chkShowAll" Text="Mostra tutti" AutoPostBack="True" OnCheckedChanged="chkShowAll_CheckedChanged" data-mini="true" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,210 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_mancTimb : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// salvo data corrente x filtraggi...
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
memLayer.ML.setSessionVal("today", DateTime.Now.ToShortDateString());
|
||||
// imposto entrata
|
||||
rblEntrata.SelectedIndex = 0;
|
||||
// imposto valori selezionati a metà
|
||||
DateTime adesso = DateTime.Now;
|
||||
ddlOra.SelectedValue = adesso.Hour.ToString();
|
||||
ddlMin.SelectedValue = "30";
|
||||
chkShowAll.Visible = userCanApprove;
|
||||
}
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// registro timbratura NON APPROVATA
|
||||
/// </summary>
|
||||
/// <param name="isEntrata"></param>
|
||||
/// <returns></returns>
|
||||
private void registraTimbraturaNonApp(bool isEntrata, DateTime dataOra)
|
||||
{
|
||||
// salvo evento entrata...
|
||||
string IPv4 = "";
|
||||
bool approvata = false; // è una richiesta!!!!
|
||||
if (DataProxy.idxDipendente > 0)
|
||||
{
|
||||
// recupero IP
|
||||
IPv4 = Request.UserHostName;
|
||||
DataProxy.DP.taTimb.stp_insTimbMan(DataProxy.idxDipendente, dataOra, isEntrata, IPv4, "NoTim", approvata);
|
||||
logger.lg.scriviLog(string.Format("Richiesta timbratura per il dipendente:{0} in data:{1} isEntrata:{2}", DataProxy.idxDipendente, dataOra, isEntrata), tipoLog.INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.lg.scriviLog("IdxDipendente non trovato! inserimento timbratura mancante impossibile", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo richiesta
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnRichMT_Click(object sender, EventArgs e)
|
||||
{
|
||||
logger.lg.scriviLog("Richiesta registrazione timbratura manuale", tipoLog.INFO);
|
||||
// salva una richiesta di timbratura (ovvero approvata = FALSE!!!)
|
||||
DateTime richiesta = DateTime.Now;
|
||||
try
|
||||
{
|
||||
CultureInfo ita = new CultureInfo("it-IT");
|
||||
logger.lg.scriviLog(string.Format("Data: {0}", ddlData.SelectedValue));
|
||||
richiesta = Convert.ToDateTime(ddlData.SelectedValue, ita);
|
||||
|
||||
|
||||
double ora = Convert.ToDouble(ddlOra.SelectedValue);
|
||||
double minuto = Convert.ToDouble(ddlMin.SelectedValue);
|
||||
richiesta = richiesta.AddHours(ora).AddMinutes(minuto);
|
||||
bool isEntrata = Convert.ToBoolean(rblEntrata.SelectedValue);
|
||||
registraTimbraturaNonApp(isEntrata, richiesta);
|
||||
// aggiorno gridview
|
||||
grView.DataBind();
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore conversione datetime!");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inverte valore booleano
|
||||
/// </summary>
|
||||
/// <param name="isEnt"></param>
|
||||
/// <returns></returns>
|
||||
public bool invBool(object valore)
|
||||
{
|
||||
bool answ = true;
|
||||
try
|
||||
{
|
||||
answ = !Convert.ToBoolean(valore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se l'utente possa approvare la modifica oraria
|
||||
/// </summary>
|
||||
public bool userCanApprove
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = DataProxy.DP.taDip2Ruoli.getByDipRuolo(DataProxy.idxDipendente, "AppMancTimb").Rows.Count > 0;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola cognome-nome da idx
|
||||
/// </summary>
|
||||
/// <param name="idxDip"></param>
|
||||
/// <returns></returns>
|
||||
public string cognomeNome(object idxDip)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
DS_Applicazione.DipendentiRow rigaDip = DataProxy.DP.taDipendenti.getByIdx(Convert.ToInt32(idxDip))[0];
|
||||
answ = string.Format("{0} {1}", rigaDip.Cognome, rigaDip.Nome);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// cambia tipo di visualizzaizone
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkFixOds();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua fix dell'ods
|
||||
/// </summary>
|
||||
private void checkFixOds()
|
||||
{
|
||||
if (chkShowAll.Checked)
|
||||
{
|
||||
ods.SelectMethod = "getNonAppr";
|
||||
}
|
||||
else
|
||||
{
|
||||
ods.SelectMethod = "getNonApprByDip";
|
||||
}
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper x salvare approvazioni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo approvazione
|
||||
DateTime dataOra = DateTime.Now;
|
||||
int idxDip = 0;
|
||||
try
|
||||
{
|
||||
dataOra = Convert.ToDateTime(grView.SelectedDataKey["dataOra"].ToString());
|
||||
idxDip = Convert.ToInt32(grView.SelectedDataKey["idxDipendente"].ToString());
|
||||
logger.lg.scriviLog(string.Format("Approvazione per dip {0} in data/ora {1}", idxDip, dataOra), tipoLog.INFO);
|
||||
// recupero tab timbr non approvate x dip
|
||||
DS_Applicazione.TimbratureRow rigaTimb = DataProxy.DP.taTimb.getByDipDataOra(idxDip, dataOra)[0];
|
||||
// effettua arrotondamento (aggiunge/toglie)
|
||||
int minOrig = dataOra.Minute;
|
||||
int secOrig = dataOra.Second;
|
||||
int minArr = 0;
|
||||
int step = Convert.ToInt32(txtArrot.Text);
|
||||
if (rigaTimb.entrata)
|
||||
{
|
||||
|
||||
minArr = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(minOrig / step))) * step;
|
||||
}
|
||||
else
|
||||
{
|
||||
minArr = Convert.ToInt32(Math.Floor(Convert.ToDouble(minOrig / step))) * step;
|
||||
}
|
||||
// modifico data del record
|
||||
DataProxy.DP.taTimb.stp_Timbr_modifica(idxDip, dataOra, dataOra.AddMinutes(minArr - minOrig).AddSeconds(-secOrig));
|
||||
// approvo con data modificata
|
||||
DataProxy.DP.taTimb.stp_Timbr_Approva(idxDip, dataOra.AddMinutes(minArr - minOrig).AddSeconds(-secOrig));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// update!
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistemo post eliminazione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
chkShowAll.Checked = true;
|
||||
checkFixOds();
|
||||
}
|
||||
}
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_mancTimb {
|
||||
|
||||
/// <summary>
|
||||
/// rblEntrata control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList rblEntrata;
|
||||
|
||||
/// <summary>
|
||||
/// ddlData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlData;
|
||||
|
||||
/// <summary>
|
||||
/// odsDateValide control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsDateValide;
|
||||
|
||||
/// <summary>
|
||||
/// ddlOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlOra;
|
||||
|
||||
/// <summary>
|
||||
/// odsOra control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsOra;
|
||||
|
||||
/// <summary>
|
||||
/// ddlMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlMin;
|
||||
|
||||
/// <summary>
|
||||
/// odsMin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsMin;
|
||||
|
||||
/// <summary>
|
||||
/// btnRichMT control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnRichMT;
|
||||
|
||||
/// <summary>
|
||||
/// hlMancateTimbr control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlMancateTimbr;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// txtArrot control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtArrot;
|
||||
|
||||
/// <summary>
|
||||
/// chkShowAll control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkShowAll;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_menuBottom" CodeBehind="mod_menuBottom.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlCheck">
|
||||
<div style="padding: 4px; margin: 2px; height: 1.2em;">
|
||||
<div class="divSx">
|
||||
<asp:Label ID="lblDateTime" runat="server" Text="..." />
|
||||
|
|
||||
<asp:Label ID="lblInfo" runat="server" Text="-" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:HyperLink runat="server" ID="hlInfo" NavigateUrl="~/infoPage.aspx">
|
||||
<asp:Label runat="server" ID="lblApp" Text="." /><asp:Label ID="lblrev" runat="server"> - </asp:Label>
|
||||
<asp:Label runat="server" ID="lblCopyRight" Text="..." />
|
||||
© 2006-<%: DateTime.Now.Year %>
|
||||
</asp:HyperLink>
|
||||
</div>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblWarning" CssClass="topMenuMess" Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
public partial class mod_menuBottom : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// sistemo le stringhe...
|
||||
//lblApp.Text = string.Format("<b>{0}</b> v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
|
||||
lblApp.Text = string.Format("<b>{0}</b> v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
lblCopyRight.Text = string.Format("<b>{0}</b>", ConfigurationManager.AppSettings.Get("copyRight"));
|
||||
string postazione_IP = Request.UserHostName;
|
||||
lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
lblInfo.Text = "";
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format("{0}", dnsUtils.DetermineCompName(postazione_IP));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format(" ({0})", postazione_IP);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (licenzeGPW.checkLicenze)
|
||||
{
|
||||
pnlCheck.CssClass = "btnVerdeGrad ui-corner-all shadowBox";
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlCheck.CssClass = "btnRossoGrad ui-corner-all shadowBox";
|
||||
lblWarning.Text = "Attenzione: numero licenze superato! MR attiva.";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_menuBottom {
|
||||
|
||||
/// <summary>
|
||||
/// pnlCheck control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlCheck;
|
||||
|
||||
/// <summary>
|
||||
/// lblDateTime control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// lblInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblInfo;
|
||||
|
||||
/// <summary>
|
||||
/// hlInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlInfo;
|
||||
|
||||
/// <summary>
|
||||
/// lblApp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblApp;
|
||||
|
||||
/// <summary>
|
||||
/// lblrev control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblrev;
|
||||
|
||||
/// <summary>
|
||||
/// lblCopyRight control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCopyRight;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_menuBottomFullBCode.ascx.cs" Inherits="GPW.WebUserControls.mod_menuBottomFullBCode" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlCheck">
|
||||
<div style="padding: 4px; margin: 2px; height: 1.2em;">
|
||||
<div class="divSx">
|
||||
<asp:Label ID="lblDateTime" runat="server" Text="..." Font-Size="1.6em" ForeColor="White" />
|
||||
|
|
||||
<asp:Label ID="lblInfo" runat="server" Text="-" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:HyperLink runat="server" ID="hlInfo" NavigateUrl="~/Default.aspx">
|
||||
<asp:Label runat="server" ID="lblApp" Text="." /><asp:Label ID="lblrev" runat="server"> - </asp:Label>
|
||||
<asp:Label runat="server" ID="lblCopyRight" Text="..." />
|
||||
© 2006-<%: DateTime.Now.Year %>
|
||||
</asp:HyperLink></div><div>
|
||||
<asp:Label runat="server" ID="lblWarning" CssClass="topMenuMess" Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer>
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
using System.Configuration;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_menuBottomFullBCode : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
contatorePag = 0;
|
||||
// sistemo le stringhe...
|
||||
//lblApp.Text = string.Format("<b>{0}</b> v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
|
||||
lblApp.Text = string.Format("<b>{0}</b> v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
|
||||
lblCopyRight.Text = string.Format("<b>{0}</b>", ConfigurationManager.AppSettings.Get("copyRight"));
|
||||
setClock();
|
||||
setTimer();
|
||||
}
|
||||
if (licenzeGPW.checkLicenze)
|
||||
{
|
||||
pnlCheck.CssClass = "btnVerdeGrad ui-corner-all shadowBox";
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlCheck.CssClass = "btnRossoGrad ui-corner-all shadowBox";
|
||||
//lblWarning.Text = "Attenzione: numero licenze superato! MR attiva.";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta il tempo di scadenza del timer x il refresh della pagina per refresh orario mostrato
|
||||
/// </summary>
|
||||
private void setTimer()
|
||||
{
|
||||
Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdateFooter_ms");
|
||||
}
|
||||
protected void Timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
setClock();
|
||||
}
|
||||
protected int contatorePag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("numChiamatePaginaBCode");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("numChiamatePaginaBCode", value);
|
||||
}
|
||||
}
|
||||
private void setClock()
|
||||
{
|
||||
// controllo numero di "ri-chiamate": ogni tot (std = 100, 100sec di default quindi) ricarico pagina
|
||||
if (contatorePag < memLayer.ML.confReadInt("maxRefreshToReload"))
|
||||
{
|
||||
contatorePag++;
|
||||
}
|
||||
else
|
||||
{
|
||||
contatorePag = 0;
|
||||
Response.Redirect("Barcode.aspx");
|
||||
}
|
||||
|
||||
string postazione_IP = Request.UserHostName;
|
||||
lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
lblInfo.Text = "";
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format("{0}", dnsUtils.DetermineCompName(postazione_IP));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format(" ({0})", postazione_IP);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_menuBottomFullBCode {
|
||||
|
||||
/// <summary>
|
||||
/// pnlCheck control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlCheck;
|
||||
|
||||
/// <summary>
|
||||
/// lblDateTime control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// lblInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblInfo;
|
||||
|
||||
/// <summary>
|
||||
/// hlInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlInfo;
|
||||
|
||||
/// <summary>
|
||||
/// lblApp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblApp;
|
||||
|
||||
/// <summary>
|
||||
/// lblrev control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblrev;
|
||||
|
||||
/// <summary>
|
||||
/// lblCopyRight control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCopyRight;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// Timer1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer Timer1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_menuBottomFullpage.ascx.cs" Inherits="GPW.WebUserControls.mod_menuBottomFullpage" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlCheck">
|
||||
<div style="padding: 4px; margin: 2px; height: 1.2em;">
|
||||
<div class="divSx">
|
||||
<asp:Label ID="lblDateTime" runat="server" Text="..." />
|
||||
|
|
||||
<asp:Label ID="lblInfo" runat="server" Text="-" />
|
||||
</div>
|
||||
<div class="divDx">
|
||||
<asp:HyperLink runat="server" ID="hlInfo" NavigateUrl="~/Default.aspx">
|
||||
<asp:Label runat="server" ID="lblApp" Text="." /><asp:Label ID="lblrev" runat="server"> - </asp:Label>
|
||||
<asp:Label runat="server" ID="lblCopyRight" Text="..." />
|
||||
© 2006-<%: DateTime.Now.Year %>
|
||||
</asp:HyperLink>
|
||||
</div>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblWarning" CssClass="topMenuMess" Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Timer ID="Timer1" runat="server" Interval="10000" OnTick="Timer1_Tick">
|
||||
</asp:Timer>
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_menuBottomFullpage : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// sistemo le stringhe...
|
||||
//lblApp.Text = string.Format("<b>{0}</b> v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
|
||||
lblApp.Text = string.Format("<b>{0}</b> v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
|
||||
lblCopyRight.Text = string.Format("<b>{0}</b>", ConfigurationManager.AppSettings.Get("copyRight"));
|
||||
setTimer();
|
||||
setClock();
|
||||
if (licenzeGPW.checkLicenze)
|
||||
{
|
||||
pnlCheck.CssClass = "btnVerdeGrad ui-corner-all shadowBox";
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlCheck.CssClass = "btnRossoGrad ui-corner-all shadowBox";
|
||||
lblWarning.Text = "Attenzione: numero licenze superato! MR attiva.";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta il tempo di scadenza del timer x il refresh della pagina per refresh orario mostrato
|
||||
/// </summary>
|
||||
private void setTimer()
|
||||
{
|
||||
Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms");
|
||||
}
|
||||
protected void Timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
setClock();
|
||||
}
|
||||
|
||||
private void setClock()
|
||||
{
|
||||
string postazione_IP = Request.UserHostName;
|
||||
lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
lblInfo.Text = "";
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format("{0}", dnsUtils.DetermineCompName(postazione_IP));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
lblInfo.Text += string.Format(" ({0})", postazione_IP);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_menuBottomFullpage {
|
||||
|
||||
/// <summary>
|
||||
/// pnlCheck control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlCheck;
|
||||
|
||||
/// <summary>
|
||||
/// lblDateTime control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// lblInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblInfo;
|
||||
|
||||
/// <summary>
|
||||
/// hlInfo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlInfo;
|
||||
|
||||
/// <summary>
|
||||
/// lblApp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblApp;
|
||||
|
||||
/// <summary>
|
||||
/// lblrev control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblrev;
|
||||
|
||||
/// <summary>
|
||||
/// lblCopyRight control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCopyRight;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// Timer1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer Timer1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_menuSx" Codebehind="mod_menuSx.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel ID="pnlTree" runat="server" HorizontalAlign="Left" CssClass="pnlMenuSx" >
|
||||
<asp:TreeView ID="tvMenuSx" runat="server" ImageSet="Simple" NodeIndent="10" DataSourceID="XmlDataSource1">
|
||||
<DataBindings>
|
||||
<asp:TreeNodeBinding DataMember="menu" TextField="title" NavigateUrlField="url" ToolTipField="description" />
|
||||
<asp:TreeNodeBinding DataMember="voce" TextField="title" NavigateUrlField="url" ToolTipField="description" />
|
||||
</DataBindings>
|
||||
<ParentNodeStyle Font-Bold="False" />
|
||||
<HoverNodeStyle Font-Underline="True" ForeColor="#DD5555" />
|
||||
<SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px"
|
||||
ForeColor="#DD5555" />
|
||||
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="0px"
|
||||
NodeSpacing="0px" VerticalPadding="0px" />
|
||||
</asp:TreeView>
|
||||
</asp:Panel>
|
||||
<asp:XmlDataSource ID="XmlDataSource1" runat="server" EnableCaching="false"></asp:XmlDataSource>
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using SteamWare;
|
||||
|
||||
public partial class mod_menuSx : ApplicationUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// stringa da pre-mettere all'URL x corretta generazione
|
||||
/// </summary>
|
||||
public string preUrlString
|
||||
{
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("preUrlString", value);
|
||||
}
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("preUrlString");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void aggiornaControlliDataGL()
|
||||
{
|
||||
// se l'utente c'è...
|
||||
if (user_std.UtSn.isAuth && !Page.IsPostBack)
|
||||
{
|
||||
updateTreeMenu();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiornamento del menù
|
||||
/// </summary>
|
||||
private void updateTreeMenu()
|
||||
{
|
||||
fixPreMenuString();
|
||||
// sostituisco stringa "url="~/ la stringa pre richiesta
|
||||
XmlDataSource1.Data = user_std.UtSn.mappaSito.Replace("url=\"~/", string.Format("url=\"~/{0}/", preUrlString));
|
||||
XmlDataSource1.XPath = "mainMenu/menu";
|
||||
XmlDataSource1.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema stringa pre del menù
|
||||
/// </summary>
|
||||
private void fixPreMenuString()
|
||||
{
|
||||
// controllo url
|
||||
Uri MyUrl = Request.Url;
|
||||
// aggiorno carattere pre del menù!
|
||||
string delimStr = "/";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||
int n = finalUrl.Length;
|
||||
if (n >= 2)
|
||||
{
|
||||
preUrlString = finalUrl[n - 2].ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// forza l'update del menù sx
|
||||
/// </summary>
|
||||
public void forzaUpdateMenu()
|
||||
{
|
||||
user_std.UtSn.ricaricaMappaSito();
|
||||
updateTreeMenu();
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_menuSx {
|
||||
|
||||
/// <summary>
|
||||
/// pnlTree control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlTree;
|
||||
|
||||
/// <summary>
|
||||
/// tvMenuSx control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TreeView tvMenuSx;
|
||||
|
||||
/// <summary>
|
||||
/// XmlDataSource1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.XmlDataSource XmlDataSource1;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_menuTop" CodeBehind="mod_menuTop.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Timer ID="Timer1" runat="server" Interval="10000" OnTick="Timer1_Tick">
|
||||
</asp:Timer>
|
||||
<div style="width: 100%; vertical-align: bottom; margin: 0px; padding: 0px;">
|
||||
<div class="topTitle" style="width: 100%; height:28px;">
|
||||
<div style="float: left; width: 20%; text-align: left;">
|
||||
<asp:LinkButton ID="btnLogOut" runat="server" CssClass="dxButtonClass" Visible="False" OnClick="btnLogOut_Click"></asp:LinkButton>
|
||||
</div>
|
||||
<div style="float: right; width: 20%; text-align: right;">
|
||||
<asp:LinkButton ID="btnUpdate" runat="server" CssClass="dxButtonClass" OnClick="btnUpdate_Click"></asp:LinkButton>
|
||||
<asp:Label ID="lblDateTime" runat="server" CssClass="smallTimeClock" />
|
||||
<asp:HyperLink runat="server" ID="lnkHelp" CssClass="dxButtonClass" NavigateUrl="~/help/index.html" Target="_blank">
|
||||
<asp:Image ID="imgHelp" runat="server" ImageUrl="~/images/help_22.png" ImageAlign="AbsBottom" /></asp:HyperLink>
|
||||
</div>
|
||||
<div style="width: 60%; text-align: center; margin: auto;">
|
||||
<asp:Label ID="lblTitle" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDiv barraTitolo" style="width: 100%;">
|
||||
<div style="float: left; width: 20%; text-align: left;">
|
||||
<asp:LinkButton CssClass="dxButtonClass" ID="lnkShowHide" runat="server" OnClick="lnkShowHide_Click" Text="Menu" />
|
||||
</div>
|
||||
<div style="float: right; width: 20%; text-align: right;">
|
||||
<asp:LinkButton ID="lblUser" runat="server" CssClass="userClass" OnClick="lblUser_Click" />
|
||||
</div>
|
||||
<div style="width: 60%; text-align: center; margin: auto;">
|
||||
<asp:Label ID="lblMessUtente" CssClass="topMenuMess" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.Collections.Generic;
|
||||
using SteamWare;
|
||||
|
||||
public partial class mod_menuTop : ApplicationUserControl
|
||||
{
|
||||
private string _titleString;
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_toggleMenuSx;
|
||||
public event EventHandler eh_reqUpdateMenu;
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
base.Page_Load(sender, e);
|
||||
btnLogOut.Visible = user_std.UtSn.isForcedUser;
|
||||
if(memLayer.ML.isInSessionObject("doUpdateNow"))
|
||||
{
|
||||
doFullDataUpdate();
|
||||
memLayer.ML.emptySessionVal("doUpdateNow");
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnLogOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Session.Abandon();
|
||||
Response.Redirect("forceUser.aspx");
|
||||
}
|
||||
protected void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
doFullDataUpdate();
|
||||
}
|
||||
|
||||
private void doFullDataUpdate()
|
||||
{
|
||||
// salvo i dati attuali...
|
||||
string cod_cdc = SteamWare.memLayer.ML.StringSessionObj("valRicercaCdC");
|
||||
string lingua = user_std.UtSn.lingua;
|
||||
string USER_NAME = SteamWare.memLayer.ML.StringSessionObj("USER_NAME");
|
||||
string DOMINIO = SteamWare.memLayer.ML.StringSessionObj("DOMINIO");
|
||||
bool isForceUser = user_std.UtSn.isForcedUser;
|
||||
// salvo i valori delle tab in session...
|
||||
Dictionary<string, string> sessionParam = SteamWare.memLayer.ML.valSess2SurvUpd;
|
||||
|
||||
// svuoto session e cache per rileggere i dati da Db
|
||||
Session.RemoveAll();
|
||||
|
||||
SteamWare.memLayer.ML.flushRegisteredCache();
|
||||
|
||||
// rimemorizzo
|
||||
SteamWare.memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc);
|
||||
user_std.UtSn.startUpUtente(DOMINIO, USER_NAME);
|
||||
user_std.UtSn.lingua = lingua;
|
||||
user_std.UtSn.isForcedUser = isForceUser;
|
||||
DataWrap.DW.resetVocabolario();
|
||||
|
||||
// risalvo in session i valori...
|
||||
foreach (KeyValuePair<string, string> kvp in sessionParam)
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true);
|
||||
}
|
||||
|
||||
// cambio visibilità del menù laterale...
|
||||
if (eh_reqUpdateMenu != null)
|
||||
{
|
||||
eh_reqUpdateMenu(this, new EventArgs());
|
||||
}
|
||||
|
||||
Response.Redirect(_paginaCorrente);
|
||||
}
|
||||
|
||||
protected override void loadSessionData()
|
||||
{
|
||||
base.loadSessionData();
|
||||
_titleString = SteamWare.memLayer.ML.StringSessionObj("_titleString");
|
||||
}
|
||||
|
||||
protected override void bindControlli()
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
lnkHelp.ToolTip = traduci("ApriManualeHelp");
|
||||
// solo se user è auth...
|
||||
if (user_std.UtSn.isAuth)
|
||||
{
|
||||
lnkShowHide.Text = user_std.UtSn.Traduci("lnkShowHide");
|
||||
lblTitle.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("titleApp"));
|
||||
if (_titleString != "")
|
||||
{
|
||||
// traduzione di tutti i termini
|
||||
lblMessUtente.Text = user_std.UtSn.Traduci(_titleString);
|
||||
//doppio in english!
|
||||
_titleString = "";
|
||||
Session["_titleString"] = _titleString;
|
||||
Session["SessionUpdateMenu"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string titolo = user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("welcomeApp"));
|
||||
lblMessUtente.Text = string.Format("{0} - {1}", titolo, memLayer.ML.confReadString("SiteName"));
|
||||
Session["SessionUpdateMenu"] = false;
|
||||
}
|
||||
btnLogOut.Text = user_std.UtSn.Traduci("LogOut");
|
||||
btnUpdate.Text = user_std.UtSn.Traduci("Update");
|
||||
lblUser.Text = String.Format("{0}: {1}", user_std.UtSn.Traduci("User"), user_std.UtSn.CognomeNome);
|
||||
setTimer();
|
||||
setClock();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
|
||||
/// </summary>
|
||||
private void setTimer()
|
||||
{
|
||||
Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms");
|
||||
}
|
||||
protected void lnkShowHide_Click(object sender, EventArgs e)
|
||||
{
|
||||
// cambio visibilità del menù laterale...
|
||||
if (eh_toggleMenuSx != null)
|
||||
{
|
||||
eh_toggleMenuSx(this, new EventArgs());
|
||||
}
|
||||
|
||||
}
|
||||
protected void Timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
setClock();
|
||||
}
|
||||
|
||||
private void setClock()
|
||||
{
|
||||
lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
}
|
||||
protected void lblUser_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("./chLang.aspx");
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_menuTop {
|
||||
|
||||
/// <summary>
|
||||
/// Timer1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer Timer1;
|
||||
|
||||
/// <summary>
|
||||
/// btnLogOut control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnLogOut;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdate control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// lblDateTime control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// lnkHelp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink lnkHelp;
|
||||
|
||||
/// <summary>
|
||||
/// imgHelp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Image imgHelp;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitle control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTitle;
|
||||
|
||||
/// <summary>
|
||||
/// lnkShowHide control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lnkShowHide;
|
||||
|
||||
/// <summary>
|
||||
/// lblUser control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lblUser;
|
||||
|
||||
/// <summary>
|
||||
/// lblMessUtente control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMessUtente;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_menuTopFull.ascx.cs" Inherits="GPW.WebUserControls.mod_menuTopFull" %>
|
||||
<%@ Register src="mod_reportUtenteAD.ascx" tagname="mod_reportUtenteAD" tagprefix="uc1" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="fullPageHeader" style="padding: 2px 4px 2px; background-color: #333; text-align: center; margin: auto; min-height: 32px;">
|
||||
<div style="float: left; text-align: left; vertical-align: bottom; margin-top: 10px;">
|
||||
<asp:Label runat="server" ID="lblPostazione" ForeColor="#CDCDCD" />
|
||||
</div>
|
||||
<div style="float: right; vertical-align: bottom; margin-top: 10px;">
|
||||
<asp:Label runat="server" ID="lblUtente" ForeColor="#CDCDCD" />
|
||||
</div>
|
||||
<div class="divCenter" style="width:600px; margin: auto; text-align: center; white-space: nowrap;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:ImageButton ID="imgReturn" runat="server" ImageUrl="~/images/back_l.png" Visible="false" OnClick="imgReturn_Click" />
|
||||
<asp:Label runat="server" ID="lblCurrentPage" Text="..." Font-Size="20pt" ForeColor="White" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:UpdateProgress ID="updtTop" runat="server" DisplayAfter="10" DynamicLayout="false">
|
||||
<ProgressTemplate>
|
||||
<div id="progress_back">
|
||||
</div>
|
||||
<div id="progress_top">
|
||||
<asp:Image ID="ProgressBar" ImageUrl="~/images/ajax-loader.gif" runat="server" />
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</td>
|
||||
<td>
|
||||
<uc1:mod_reportUtenteAD ID="mod_reportUtenteAD1" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using GPW_data;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_menuTopFull : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
checkUser();
|
||||
setMenuData();
|
||||
}
|
||||
/// <summary>
|
||||
/// titolo pagina
|
||||
/// </summary>
|
||||
public string titolo
|
||||
{
|
||||
get
|
||||
{
|
||||
return lblCurrentPage.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblCurrentPage.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// url per ritorno a pagina precedente
|
||||
/// </summary>
|
||||
public string returnUrl
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value != "")
|
||||
{
|
||||
memLayer.ML.setSessionVal("returnUrl", value);
|
||||
imgReturn.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica ci sia user in sessione...
|
||||
/// </summary>
|
||||
private void checkUser()
|
||||
{
|
||||
if (user_std.UtSn.CognomeNome == "")
|
||||
{
|
||||
// fix
|
||||
memLayer.ML.setSessionVal("preUrlString", "A4", true);
|
||||
memLayer.ML.setSessionVal("nextPage", "commesseUtente.aspx");
|
||||
Response.Redirect("login.aspx");
|
||||
}
|
||||
else
|
||||
{
|
||||
// ricavo e salvo idxDipendente
|
||||
int idxDip = -1;
|
||||
try
|
||||
{
|
||||
idxDip = DataProxy.DP.taDipendenti.getByUserDominio(user_std.UtSn.dominio, user_std.UtSn.utente)[0].idxDipendente;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// loggo!
|
||||
logger.lg.scriviLog(string.Format("Errore dipendente non trovato:{0}dominio\\utente: {1}\\{2}", Environment.NewLine, user_std.UtSn.dominio, user_std.UtSn.utente), tipoLog.STARTUP);
|
||||
}
|
||||
DataProxy.idxDipendente = idxDip;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// imposta valori mostrati
|
||||
/// </summary>
|
||||
private void setMenuData()
|
||||
{
|
||||
string postazione_IP = Request.UserHostName;
|
||||
lblUtente.Text = user_std.UtSn.CognomeNome;
|
||||
lblPostazione.Text = "";
|
||||
try
|
||||
{
|
||||
lblPostazione.Text += string.Format("{0}", dnsUtils.DetermineCompName(postazione_IP));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
try
|
||||
{
|
||||
lblPostazione.Text += string.Format(" ({0})", postazione_IP);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
/// <summary>
|
||||
/// rimanda a pagina precedente
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void imgReturn_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
Response.Redirect(memLayer.ML.StringSessionObj("returnUrl"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_menuTopFull {
|
||||
|
||||
/// <summary>
|
||||
/// lblPostazione control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPostazione;
|
||||
|
||||
/// <summary>
|
||||
/// lblUtente control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblUtente;
|
||||
|
||||
/// <summary>
|
||||
/// imgReturn control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ImageButton imgReturn;
|
||||
|
||||
/// <summary>
|
||||
/// lblCurrentPage control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCurrentPage;
|
||||
|
||||
/// <summary>
|
||||
/// updtTop control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdateProgress updtTop;
|
||||
|
||||
/// <summary>
|
||||
/// mod_reportUtenteAD1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW.WebUserControls.mod_reportUtenteAD mod_reportUtenteAD1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_pageSize.ascx.cs" Inherits="GPW.WebUserControls.mod_pageSize" %>
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged"
|
||||
AutoPostBack="True" DataSourceID="odsPageSize" DataTextField="label" DataValueField="value">
|
||||
</asp:DropDownList>
|
||||
<asp:ObjectDataSource ID="odsPageSize" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="GetData" TypeName="GPW_data.DS_UtilityTableAdapters.v_selPageSizeTableAdapter"></asp:ObjectDataSource>
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW.WebUserControls
|
||||
{
|
||||
public partial class mod_pageSize : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
public event EventHandler eh_nuovaSize;
|
||||
/// <summary>
|
||||
/// dim pagina gridView
|
||||
/// </summary>
|
||||
protected int pageSize
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 20;
|
||||
try
|
||||
{
|
||||
answ = SteamWare.memLayer.ML.IntSessionObj("pageSize");
|
||||
if (answ <= 0) answ = 20;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("pageSize", value, true);
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
ddlPageSize.SelectedValue = pageSize.ToString(); ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio page size!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo pageSize desiderata
|
||||
SteamWare.memLayer.ML.setSessionVal("pageSize", ddlPageSize.SelectedValue);
|
||||
// raise dell'evento
|
||||
if (eh_nuovaSize != null)
|
||||
{
|
||||
eh_nuovaSize(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GPW.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_pageSize {
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// odsPageSize control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsPageSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_pageTitleAndSearch" CodeBehind="mod_pageTitleAndSearch.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<div class="topContrSx">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label ID="lblTitolo" runat="server" />
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<asp:UpdateProgress ID="updtRicerca" runat="server" DisplayAfter="10" DynamicLayout="false">
|
||||
<ProgressTemplate>
|
||||
<div id="progress_back">
|
||||
</div>
|
||||
<div id="progress_top">
|
||||
<asp:Image ID="ProgressBar" ImageUrl="~/images/ProgressBar.gif" runat="server" />
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user