cancellati file messi in sottodir webusercontrols

git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@148 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
ermanno
2009-10-21 15:32:39 +00:00
parent 454a50ebf5
commit 8b569ef6d3
83 changed files with 0 additions and 9992 deletions
-86
View File
@@ -1,86 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_anagAmbitiGuasto.ascx.cs"
Inherits="mod_anagAmbitiGuasto" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxAmbito" DataSourceID="ods" OnDataBound="grView_DataBound" OnRowEditing="grView_RowEditing">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="idxAmbito" HeaderText="idxAmbito" InsertVisible="False"
Visible="false" ReadOnly="True" SortExpression="idxAmbito" />
<asp:TemplateField HeaderText="descrAmbitoGuasto" SortExpression="descrAmbitoGuasto">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrAmbitoGuasto") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrAmbitoGuasto") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagAmbitoGuastoTableAdapter"
UpdateMethod="Update" DeleteMethod="DeleteQuery" OldValuesParameterFormatString="Original_{0}"
FilterExpression="descrAmbitoGuasto LIKE '%{0}%' " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="descrAmbitoGuasto" Type="String" />
<asp:Parameter Name="Original_idxAmbito" Type="Int32" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxAmbito" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="descrAmbitoGuasto" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
@@ -1,85 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_anagAmbitiGuasto : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
DS_applicazioneTableAdapters.AnagAmbitoGuastoTableAdapter taAnagAmbito = new DS_applicazioneTableAdapters.AnagAmbitoGuastoTableAdapter();
taAnagAmbito.Insert("-- [NUOVO] non definito --");
grView.DataBind();
}
}
-105
View File
@@ -1,105 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_anagOpMtz.ascx.cs"
Inherits="mod_anagOpMtz" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="matrOp" DataSourceID="ods" OnDataBound="grView_DataBound"
OnRowEditing="grView_RowEditing">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" Visible='<%# isEditable(Eval("matrOp")) %>'
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="matrOp" SortExpression="matrOp">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="15em" Text='<%# Bind("matrOp") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("matrOp") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cognome" SortExpression="Cognome">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Width="15em" Text='<%# Bind("Cognome") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Cognome") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nome" SortExpression="Nome">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Width="15em" Text='<%# Bind("Nome") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Nome") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete" Visible='<%# isEditable(Eval("matrOp")) %>'
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagrOperMtzTableAdapter"
UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"
FilterExpression=" (matrOp LIKE '%{0}%') OR (Cognome LIKE '%{0}%') OR (Nome LIKE '%{0}%') " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="matrOp" Type="String" />
<asp:Parameter Name="Cognome" Type="String" />
<asp:Parameter Name="Nome" Type="String" />
<asp:Parameter Name="Original_matrOp" Type="String" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_matrOp" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="matrOp" Type="String" />
<asp:Parameter Name="Cognome" Type="String" />
<asp:Parameter Name="Nome" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
-96
View File
@@ -1,96 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_anagOpMtz : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
DS_applicazioneTableAdapters.AnagrOperMtzTableAdapter taAnagOpMtz = new DS_applicazioneTableAdapters.AnagrOperMtzTableAdapter();
taAnagOpMtz.Insert("9999", "-- [NUOVO] Cognome --", "-- [NUOVO] Nome --");
grView.DataBind();
}
/// <summary>
/// è editabile SOLO se non è il primo user 0000 che è un segnaposto
/// </summary>
/// <param name="matricola"></param>
/// <returns></returns>
public bool isEditable(object matricola)
{
bool answ = (memLayer.ML.confReadString("defaultMatr") != matricola.ToString());
return answ;
}
}
-54
View File
@@ -1,54 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_aperturaImpianti.ascx.cs"
Inherits="mod_aperturaImpianti" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="giorno" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="descrGiorno" HeaderText="descrGiorno" Visible="true" ReadOnly="True"
SortExpression="descrGiorno" />
<asp:TemplateField HeaderText="apertura" SortExpression="apertura">
<EditItemTemplate>
<asp:TextBox ID="txtApertura" runat="server" Width="3em" Text='<%# Bind("apertura") %>' />
<cc1:MaskedEditExtender ID="mee_Ora" runat="server" TargetControlID="txtApertura" Mask="99.99"
MaskType="Number">
</cc1:MaskedEditExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("apertura") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.OreAperturaSettTableAdapter"
UpdateMethod="updateApertura" OldValuesParameterFormatString="Original_{0}" >
<UpdateParameters>
<asp:Parameter Name="apertura" Type="Decimal" />
<asp:Parameter Name="Original_giorno" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
@@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_aperturaImpianti : ApplicationUserControl
{
/// <summary>
/// evento dati associati a controllo
/// </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
{ }
}
}
}
}
@@ -1,41 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_assegnazioniMacchineImpianti.ascx.cs"
Inherits="mod_assegnazioniMacchineImpianti" %>
<%@ Register Src="mod_selettore_ajax.ascx" TagName="mod_selettore_ajax" TagPrefix="uc1" %>
<%@ Register Src="mod_macchine.ascx" TagName="mod_macchine" TagPrefix="uc2" %>
<table>
<tr>
<td>
<asp:DropDownList ID="ddlImpianto_A" runat="server" DataSourceID="ods" DataTextField="label"
AutoPostBack="true" DataValueField="value" OnSelectedIndexChanged="ddlImpianto_A_SelectedIndexChanged" />
</td>
<td>
</td>
<td>
<asp:DropDownList ID="ddlImpianto_B" runat="server" DataSourceID="ods" DataTextField="label"
AutoPostBack="true" DataValueField="value" OnSelectedIndexChanged="ddlImpianto_B_SelectedIndexChanged" />
</td>
</tr>
<tr>
<td>
<div style="font-size: 8pt;">
<uc2:mod_macchine ID="mod_macchine1" runat="server" vistaModulo="selezione" idxImpiantoSel="1"
dispLessCol="true" />
</div>
</td>
<td valign="middle">
<asp:Button ID="btnA2B" runat="server" Text=" --> " OnClick="btnA2B_Click" />
<br />
<asp:Button ID="btnB2A" runat="server" Text=" <-- " OnClick="btnB2A_Click" />
</td>
<td>
<div style="font-size: 8pt;">
<uc2:mod_macchine ID="mod_macchine2" runat="server" vistaModulo="selezione" idxImpiantoSel="2"
dispLessCol="true" />
</div>
</td>
</tr>
</table>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
@@ -1,93 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_assegnazioniMacchineImpianti : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// click spostamento da A a B
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnA2B_Click(object sender, EventArgs e)
{
// solo se macchina selezionata...
if (mod_macchine1.idxMacchinaSel != 0)
{
// sposto da A a B
TA_app.obj.taMacchine.sp_spostaMacchina(mod_macchine1.idxMacchinaSel, Convert.ToInt32(ddlImpianto_B.SelectedValue));
updateAll();
lblWarning.Visible = false;
}
else
{
// mostro errore...
lblWarning.Text = user_std.UtSn.Traduci("ErroreNoMaccSel");
lblWarning.Visible = true;
}
}
/// <summary>
/// click spostamento da B ad A
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnB2A_Click(object sender, EventArgs e)
{
if (mod_macchine2.idxMacchinaSel != 0)
{ // sposto da B ad A
TA_app.obj.taMacchine.sp_spostaMacchina(mod_macchine2.idxMacchinaSel, Convert.ToInt32(ddlImpianto_A.SelectedValue));
updateAll();
lblWarning.Visible = false;
}
else
{
// mostro errore...
lblWarning.Text = user_std.UtSn.Traduci("ErroreNoMaccSel");
lblWarning.Visible = true;
}
}
/// <summary>
/// aggiorna visualizzazioni delle 2 tab di dettaglio
/// </summary>
private void updateAll()
{
update_A();
update_B();
}
/// <summary>
/// aggiorno tab impianto A
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlImpianto_A_SelectedIndexChanged(object sender, EventArgs e)
{
update_A();
}
private void update_A()
{
mod_macchine1.idxImpiantoSel = Convert.ToInt32(ddlImpianto_A.SelectedValue);
mod_macchine1.doUpdate();
}
/// <summary>
/// aggiorno tab impianto B
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlImpianto_B_SelectedIndexChanged(object sender, EventArgs e)
{
update_B();
}
private void update_B()
{
mod_macchine2.idxImpiantoSel = Convert.ToInt32(ddlImpianto_B.SelectedValue);
mod_macchine2.doUpdate();
}
}
-120
View File
@@ -1,120 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_calChiusura.ascx.cs"
Inherits="mod_calChiusura" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="data" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="data" InsertVisible="False" SortExpression="data">
<EditItemTemplate>
<asp:TextBox ID="txtData" runat="server" Text='<%# Bind("data","{0:dd/MM/yy}") %>'
Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtData" Format="dd/MM/yy">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("data","{0:dd/MM/yy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="descrizione" SortExpression="descrizione">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrizione") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("descrizione") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.CalendFesteFerieTableAdapter"
UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="Original_{0}"
FilterExpression="descrizione LIKE '%{0}%' " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="data" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="Original_data" Type="DateTime" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_data" Type="DateTime" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="data" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
<div style="text-align: center;">
<asp:Button ID="btnShowInsPeriodo" runat="server" Text="..." OnClick="btnShowInsPeriodo_Click" />
<asp:Panel runat="server" ID="pnlInsPeriodo" Visible="false">
<div style="float: left;">
<asp:TextBox ID="txtDataFrom" runat="server" Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtDataFrom" Format="dd/MM/yy">
</cc1:CalendarExtender>
</div>
<div style="float: left;">
<asp:TextBox ID="txtDataTo" runat="server" Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender3" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtDataTo" Format="dd/MM/yy">
</cc1:CalendarExtender>
</div>
<div style="float: left;">
<asp:TextBox ID="txtDescrizione" runat="server" Width="30em" />
</div>
<div style="float: left;">
<asp:Button ID="btnInsPeriodo" runat="server" onclick="btnInsPeriodo_Click" />
</div>
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</asp:Panel>
</div>
-114
View File
@@ -1,114 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_calChiusura : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!Page.IsPostBack)
{
grView.PageSize = _righeDataGridMed;
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
btnInsPeriodo.Text = traduci("btnInsPeriodo");
}
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
TA_app.obj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --");
grView.DataBind();
}
/// <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>
/// evento dati associati a controllo
/// </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 = "";
}
}
protected void btnShowInsPeriodo_Click(object sender, EventArgs e)
{
pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible;
if (pnlInsPeriodo.Visible)
{
btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo");
}
else
{
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
}
}
protected void btnInsPeriodo_Click(object sender, EventArgs e)
{
// verifico date congrue...
DateTime inizio = Convert.ToDateTime(txtDataFrom.Text);
DateTime fine = Convert.ToDateTime(txtDataTo.Text);
if (fine.CompareTo(inizio) >= 0)
{
// inserisco le voci x tutte le date nell'intervallo...
while (fine.CompareTo(inizio) >= 0)
{
TA_app.obj.taCalFF.Insert(inizio, txtDescrizione.Text);
inizio = inizio.AddDays(1);
}
// update e nascondo pannello
grView.DataBind();
pnlInsPeriodo.Visible = false;
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
lblWarning.Visible = false;
}
else
{
lblWarning.Visible = true;
lblWarning.Text = traduci("OrdineDateErrato");
}
}
}
-28
View File
@@ -1,28 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_chLang.ascx.cs" Inherits="mod_chLang" %>
<link href="Style.css" rel="stylesheet" type="text/css" />
<table id="table1" runat="server" cellspacing="1" cellpadding="1" class="centerMenu">
<tr class="ctrHeaderPager">
<td>
<asp:Label id="lblScegli" runat="server" ></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:DataList id="dataListLingue" runat="server" DataKeyField="Lingua" DataSourceid="ods_lingueApp" Width="100%" OnSelectedIndexChanged="dataListLingue_SelectedIndexChanged">
<ItemStyle CssClass="ctrRowStyle" />
<AlternatingItemStyle CssClass="ctrAltRowStyle" />
<ItemTemplate>
<asp:LinkButton id="Linkbutton1" runat="server" name="Linkbutton1" CausesValidation="false" CommandName="Select">
<img alt='<%# DataBinder.Eval(Container, "DataItem.Lingua") %>' src='./images/flag-<%# DataBinder.Eval(Container, "DataItem.Lingua") %>.png' />
<asp:Label id="LinguaLabel" runat="server" Text='<%# formattaLingua(Eval("Lingua"),Eval("DescrizioneLingua")) %>' Width="250px"/>
<img alt='<%# DataBinder.Eval(Container, "DataItem.Lingua") %>' src='./images/flag-<%# DataBinder.Eval(Container, "DataItem.Lingua") %>.png' />
</asp:LinkButton>
</ItemTemplate>
</asp:DataList>
<asp:ObjectDataSource id="ods_lingueApp" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetLingue" TypeName="selData">
</asp:ObjectDataSource>
</td>
</tr>
</table>
-34
View File
@@ -1,34 +0,0 @@
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_chLang : ApplicationUserControl
{
protected void dataListLingue_SelectedIndexChanged(object sender, EventArgs e)
{
// impongo ad oggetto user la lingua selezionata...
user_std.UtSn.lingua = dataListLingue.SelectedValue.ToString();
// salvo richiesta udpate in sessione...
SteamWare.memLayer.ML.setSessionVal("doUpdateNow","true");
user_std.UtSn.ricaricaMappaSito();
Response.Redirect(_paginaCorrente);
}
protected override void traduciObj()
{
lblScegli.Text = traduci("scegliLingua");
}
public string formattaLingua(object breve, object lungo)
{
return string.Format("{0} - {1}", breve, lungo);
}
}
-42
View File
@@ -1,42 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_dataOra.ascx.cs" Inherits="mod_dataOra" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<table>
<tr>
<td>
<div>
<asp:Label runat="server" ID="lblData" /></div>
<asp:TextBox runat="server" ID="txtData" Width="5em" CssClass='<%# css %>' />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtData" Format="dd/MM/yy">
</cc1:CalendarExtender>
</td>
<td>
<asp:Panel runat="server" ID="pnlDropDown" Visible="false">
<table>
<tr>
<td>
<div>
<asp:Label runat="server" ID="lblOra" /></div>
<asp:DropDownList runat="server" ID="ddlOra" CssClass='<%# css %>' />
</td>
<td>
<div>
<asp:Label runat="server" ID="lblMin" /></div>
<asp:DropDownList runat="server" ID="ddlMin" CssClass='<%# css %>' />
</td>
</tr>
</table>
</asp:Panel>
</td>
<td>
<asp:Panel runat="server" ID="pnlText" Visible="false">
<div>
<asp:Label runat="server" ID="lblTime" /></div>
<asp:TextBox runat="server" ID="txtTime" Width="4em" />
<cc1:MaskedEditExtender ID="mee_Ora" runat="server" TargetControlID="txtTime" MaskType="Time"
Mask="99:99" UserTimeFormat="TwentyFourHour">
</cc1:MaskedEditExtender>
</asp:Panel>
</td>
</tr>
</table>
-214
View File
@@ -1,214 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
[ValidationProperty("valore")]
public partial class mod_dataOra : System.Web.UI.UserControl
{
/// <summary>
/// definisce se siano visibili e selezionabili i secondi
/// </summary>
protected bool _showSeconds = false;
/// <summary>
/// tipo selettore orario richiesto
/// </summary>
protected tipoSelOrario _tipoOrario;
/// <summary>
/// calsse css applicata ai controlli
/// </summary>
protected string _css;
/// <summary>
/// valore di riferimento...
/// </summary>
protected DateTime _valore;
/// <summary>
/// avvio pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
traduciObj();
fixPnlVisibility();
//setupControlli();
fixCss();
}
}
/// <summary>
/// traduce gli oggetti
/// </summary>
private void traduciObj()
{
lblData.Text = traduci("lblData");
lblOra.Text = traduci("lblOra");
lblMin.Text = traduci("lblMin");
lblTime.Text = traduci("lblTime");
}
/// <summary>
/// sistema valori default dei controlli
/// </summary>
private void setupControlli()
{
// mostro data
txtData.Text = _valore.Date.ToString("dd/MM/yy");
switch (_tipoOrario)
{
case tipoSelOrario.tendina:
// aggiongo valori ora e minuti...
ddlOra.Items.Clear();
ddlMin.Items.Clear();
for (int i = 0; i < 24; i++)
{
ddlOra.Items.Add(new ListItem(string.Format("{0:00}", i), i.ToString()));
}
for (int i = 0; i < 60; i++)
{
ddlMin.Items.Add(new ListItem(string.Format("{0:00}", i), i.ToString()));
}
// imposto i valori
ddlOra.SelectedValue = _valore.Hour.ToString();
ddlMin.SelectedValue = _valore.Minute.ToString();
break;
case tipoSelOrario.testuale:
txtTime.Text = string.Format("{0:HH:mm}", _valore);
break;
}
}
/// <summary>
/// sistema visualizzazione controlli
/// </summary>
private void fixPnlVisibility()
{
switch (_tipoOrario)
{
case tipoSelOrario.tendina:
pnlDropDown.Visible = true;
pnlText.Visible = false;
break;
case tipoSelOrario.testuale:
pnlDropDown.Visible = false;
pnlText.Visible = true;
break;
}
}
/// <summary>
/// sistema i css del controllo...
/// </summary>
private void fixCss()
{
txtData.CssClass = _css;
switch (_tipoOrario)
{
case tipoSelOrario.tendina:
ddlOra.CssClass = _css;
ddlMin.CssClass = _css;
break;
case tipoSelOrario.testuale:
txtTime.CssClass = _css;
break;
}
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// scelta del tipo di selettore per ora/min/sec
/// </summary>
public tipoSelOrario tipoOrario
{
get
{
return _tipoOrario;
}
set
{
_tipoOrario = value;
fixPnlVisibility();
}
}
/// <summary>
/// valore del controllo
/// </summary>
public DateTime valore
{
get
{
int ora = 0;
int min = 0;
switch (_tipoOrario)
{
case tipoSelOrario.tendina:
ora = Convert.ToInt32(ddlOra.SelectedValue);
min = Convert.ToInt32(ddlMin.SelectedValue);
break;
case tipoSelOrario.testuale:
ora = Convert.ToDateTime(txtTime.Text).Hour;
min = Convert.ToDateTime(txtTime.Text).Minute;
break;
}
DateTime answ = Convert.ToDateTime(txtData.Text).AddHours(ora).AddMinutes(min);
return answ;
}
set
{
_valore = value;
if (ddlOra.SelectedValue == "")
{
setupControlli();
}
}
}
/// <summary>
/// css applicato agli elementi del controllo
/// </summary>
public string css
{
get
{
return _css;
}
set
{
_css = value;
fixCss();
}
}
/// <summary>
/// nasconde se richiesto le label dei controlli dataOra
/// </summary>
public bool mostraLabel
{
set
{
lblData.Visible = value;
lblMin.Visible = value;
lblOra.Visible = value;
lblTime.Visible = value;
}
}
}
/// <summary>
/// tipo di selettore impiegato per la seleizone dell'orario
/// </summary>
public enum tipoSelOrario
{
/// <summary>
/// selettore a tendina per l'ora (00 -> 23) ed i minuti/secondi (00 -> 59)
/// </summary>
tendina,
/// <summary>
/// selettore testuale con masked input
/// </summary>
testuale
}
-102
View File
@@ -1,102 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_dettMtzProg.ascx.cs"
Inherits="mod_dettMtzProg" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<table style="background-color:#DFDFDF;">
<tr>
<td colspan="2">
<h3>
<asp:Label ID="lblInsNewIntPro" runat="server" />
</h3>
</td>
</tr>
<tr valign="top">
<td>
<asp:Label runat="server" ID="lblDescrMtzPro" /><br />
<asp:TextBox runat="server" ID="txtDescrizione" TextMode="MultiLine" Rows="15" Width="420px"
CssClass="textEv_1Left"/>
<asp:RequiredFieldValidator ID="rfvDescrizione" runat="server" ErrorMessage="!!!"
ControlToValidate="txtDescrizione" ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
<td rowspan="2" style="width: 400px;">
<div style="float: left;">
<asp:Label runat="server" ID="lblMacchineInteressate" />
</div>
<div style="float: right;">
<asp:TextBox runat="server" ID="txtCercaMacchine" Width="8em" Text="*" />
</div>
<div>
<asp:ListBox ID="listMacchine" runat="server" AutoPostBack="True" DataSourceID="odsMacchine"
SelectionMode="Multiple" DataTextField="label" DataValueField="value" Height="400px"
Width="400px" BackColor="#ddeeff" Font-Size="8pt"></asp:ListBox>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter"
FilterExpression="label LIKE '%{0}%'">
<FilterParameters>
<asp:ControlParameter ControlID="txtCercaMacchine" DefaultValue="*" Type="String"
Name="txtCercaMacchine" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
</td>
</tr>
<tr>
<td>
<div class="bloccoDiv" style="clear: both;">
<div style="float: left; margin-right: 10px; width: 200px;">
<asp:Label runat="server" ID="lblInizioMtzPro" /><br />
<asp:TextBox runat="server" ID="txtDataInizio" Width="6em" CssClass="textEv_1" />
<asp:RequiredFieldValidator ID="rfvData" runat="server" ErrorMessage="!!!" ControlToValidate="txtDataInizio"
ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtDataInizio" Format="dd/MM/yy">
</cc1:CalendarExtender>
</div>
<div>
<asp:Label runat="server" ID="lblPrior" /><br />
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="label"
DataValueField="value" CssClass="textEv_1" />
<asp:ObjectDataSource ID="odsPrior" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selPriorTableAdapter">
</asp:ObjectDataSource>
</div>
</div>
<div class="bloccoDiv" style="clear: both;">
<div style="float: left; margin-right: 10px; width: 200px;">
<asp:CheckBox runat="server" ID="chkImpFermo" />
</div>
<div>
<asp:Label runat="server" ID="lblTipoGuasto" /><br />
<asp:DropDownList runat="server" ID="ddlTipo" CssClass="textEv_1" DataSourceID="odsTipo"
DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsTipo" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selTipoGuastoTableAdapter">
</asp:ObjectDataSource>
</div>
</div>
<div class="bloccoDiv" style="clear: both;">
<div style="float: left; margin-right: 10px; width: 200px;">
<asp:Label runat="server" ID="lblFreq" /><br />
<asp:DropDownList runat="server" ID="ddlFreq" CssClass="textEv_1" DataSourceID="odsFreq"
DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsFreq" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selFreqTableAdapter">
</asp:ObjectDataSource>
</div>
<div>
<asp:Label runat="server" ID="lblCadenza" /><br />
<asp:TextBox runat="server" ID="txtCadenza" Width="2em" CssClass="textEv_1" />
<asp:RequiredFieldValidator ID="rfvCad" runat="server" ErrorMessage="!!!" ControlToValidate="txtCadenza"
ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnCreaMtzPro" runat="server" OnClick="btnCreaMtzPro_Click" ValidationGroup="inserimento" />
<asp:ValidationSummary ID="valSummary" runat="server" ValidationGroup="inserimento" />
</td>
</tr>
</table>
-80
View File
@@ -1,80 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_dettMtzProg : System.Web.UI.UserControl
{
public event EventHandler eh_newInserted;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
traduciObj();
setupValori();
}
}
private void setupValori()
{
txtDataInizio.Text = DateTime.Now.ToString("dd/MM/yy");
txtCadenza.Text = "1";
}
private void traduciObj()
{
lblInsNewIntPro.Text = traduci("lblInsNewIntPro");
lblDescrMtzPro.Text = traduci("lblDescrMtzPro");
lblInizioMtzPro.Text = traduci("lblInizioMtzPro");
lblPrior.Text = traduci("lblPrior");
chkImpFermo.Text = traduci("chkImpFermo");
lblTipoGuasto.Text = traduci("lblTipoGuasto");
lblFreq.Text = traduci("lblFreq");
lblCadenza.Text = traduci("lblCadenza");
btnCreaMtzPro.Text = traduci("btnCreaMtzPro");
lblMacchineInteressate.Text = traduci("lblMacchineInteressate");
rfvCad.Text = traduci("cadIntReq");
rfvDescrizione.Text = traduci("descrIntReq");
rfvData.Text = traduci("dataReq");
}
/// <summary>
/// wrap traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
protected void btnCreaMtzPro_Click(object sender, EventArgs e)
{
// spazzo TUTTE le righe del controllo...
foreach (ListItem riga in listMacchine.Items)
{
// se è selezionata creo riga anche x lei...
if (riga.Selected)
{
creaInterventoMtzPro(Convert.ToInt32(riga.Value));
}
}
// resetto selezioni e controlli...
txtDescrizione.Text = "";
txtCercaMacchine.Text = "*";
listMacchine.SelectedIndex = -1;
if (eh_newInserted != null)
{
eh_newInserted(this, new EventArgs());
}
}
/// <summary>
/// crea un intervento di mtz programmata x la macchina con idx passato
/// </summary>
/// <param name="p"></param>
private void creaInterventoMtzPro(int idx)
{
TA_app.obj.taMtzPro.Insert(idx, Convert.ToDateTime(txtDataInizio.Text), ddlFreq.SelectedValue, Convert.ToInt32(txtCadenza.Text), txtDescrizione.Text.Trim(), Convert.ToInt32(ddlPrior.SelectedValue), chkImpFermo.Checked, Convert.ToInt32(ddlTipo.SelectedValue));
}
}
@@ -1,763 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_dettaglioIntervento.ascx.cs"
Inherits="mod_dettaglioIntervento" %>
<%@ Register Src="mod_interventoOpMtz.ascx" TagName="mod_interventoOpMtz" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_dataOra.ascx" TagName="mod_dataOra" TagPrefix="uc2" %>
<div style="text-align: center; width: 100%;">
<div style="float: left; margin: 2px;">
<asp:LinkButton ID="btnElenco" runat="server" OnClick="btnElenco_Click" />
</div>
<div style="float: right;">
<asp:Button ID="btnCancel" runat="server" Width="150px" OnClick="btnCancel_Click" />
</div>
<div style="margin: 2px;">
<asp:Button ID="btnCompilaMtz" runat="server" Width="150px" OnClick="btnCompilaMtz_Click" />
<asp:Button ID="btnEditFull" runat="server" Width="150px" OnClick="btnEditFull_Click" />
</div>
</div>
<asp:FormView ID="frmView_default" runat="server" DataKeyNames="numIntMtz" DataSourceID="ods_default"
Width="100%">
<ItemTemplate>
<div id="divReadOnly">
<div id="divUp" style="background-color: #E5E2E1; padding: 10px; border-top: solid 2px orange;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblNumIntMtz" Text='<%# traduci("numIntMtz") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataOra" Text='<%# traduci("lblDataOraRich") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataOraGuasto" Text='<%# traduci("lblDataOraGuasto") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataLav" Text='<%# traduci("lblDataLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblTurnoLav" Text='<%# traduci("lblTurnoLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblMatr" Text='<%# traduci("lblMatr") %>' Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="numIntMtzLabel" runat="server" Text='<%# Eval("numIntMtz") %>' CssClass="fixedVal"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="richiestaLabel" runat="server" Text='<%# Eval("richiesta") %>' CssClass="fixedVal"
ReadOnly="true" Width="105px" />
</td>
<td>
<asp:TextBox ID="guastoLabel" runat="server" Text='<%# Eval("guasto") %>' CssClass="fixedVal"
ReadOnly="true" Width="110px" />
</td>
<td>
<asp:TextBox ID="dataLavLabel" runat="server" Text='<%# Eval("dataLav","{0:dd/MM/yy}") %>'
CssClass="fixedVal" ReadOnly="true" Width="105px" />
</td>
<td>
<asp:TextBox ID="turnoLavLabel" runat="server" Text='<%# Eval("turnoLav") %>' CssClass="fixedVal"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="matrLabel" runat="server" Text='<%# Eval("matr") %>' CssClass="fixedVal"
ReadOnly="true" Width="105px" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblIsFermo" Text='<%# traduci("lblIsFermo") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblDettagliGuasto" Text='<%# traduci("lblDettagliGuasto") %>'
Font-Size="X-Small" />
</tr>
<tr>
<td>
<asp:CheckBox ID="isFermoCheckBox" runat="server" Checked='<%# Eval("isFermo") %>'
Enabled="false" />
</td>
<td colspan="5">
<asp:TextBox ID="descrAmbitoGuastoLabel" runat="server" Text='<%# Eval("descrAmbitoGuasto") %>'
CssClass="fixedVal" ReadOnly="true" />
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblImpianto" Text='<%# traduci("lblImpianto") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listImpianti" runat="server" DataSourceID="odsImpianti" DataTextField="label"
DataValueField="value" AutoPostBack="true" Width="400px" BackColor="Silver" Font-Size="8pt"
SelectedValue='<%# Eval("idxImpianto") %>' Enabled="false">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getImpiantiValidi" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblMacchina" Text='<%# traduci("lblMacchina") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listMacchine" runat="server" AutoPostBack="True" DataSourceID="odsMacchine"
DataTextField="label" DataValueField="value" Width="400px" BackColor="Silver"
Font-Size="8pt" SelectedValue='<%# Eval("idxMacchina") %>' Enabled="false">
</asp:DropDownList>
<%--<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listImpianti" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>--%>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td style="padding-top: 15px;">
<asp:Label runat="server" ID="lblDescrCausale" Text='<%# traduci("lblDescrCausale") %>'
Font-Size="X-Small" />
</td>
<td colspan="5" style="padding-top: 15px;">
<asp:TextBox ID="descrCausaleLabel" runat="server" Text='<%# Eval("descrCausale") %>'
CssClass="fixedValLeft" ReadOnly="true" Width="530px" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblDescrPriorita" Text='<%# traduci("lblDescrPriorita") %>'
Font-Size="X-Small" />
</td>
<td colspan="2">
<asp:Label runat="server" ID="lblDescrizioneGen" Text='<%# traduci("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr style="vertical-align: top;">
<td>
<asp:TextBox ID="descrPrioritaLabel" runat="server" Text='<%# Eval("descrPriorita") %>'
CssClass="fixedVal" ReadOnly="true" />
</td>
<td colspan="5">
<asp:TextBox ID="descrizioneLabel" runat="server" Text='<%# Eval("descrizione") %>'
CssClass="fixedValLeft" ReadOnly="true" Height="100px" Width="530px" TextMode="MultiLine" />
</td>
</tr>
<tr>
<td colspan="5">
<asp:Label runat="server" ID="lblDescrTipo" Text='<%# traduci("lblDescrTipo") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="descrTipoLabel" runat="server" Text='<%# Eval("descrTipo") %>' CssClass="fixedVal"
ReadOnly="true" />
</td>
</tr>
</table>
</div>
<div id="divDown" style="background-color: #FFFFFF; border-top: solid 2px orange;
padding: 10px;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblPresaInCarico" Text='<%# traduci("lblPresaInCarico") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblInizioIntervento" Text='<%# traduci("lblInizioIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblFineIntervento" Text='<%# traduci("lblFineIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDescrStato" Text='<%# traduci("lblDescrStato") %>'
Font-Size="X-Small" />
</td>
<td style="text-align: center;">
<asp:Label runat="server" ID="lblInterventi" Text='<%# traduci ("lblInterventi") %>'
Font-Size="X-Small"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="presaInCaricoLabel" runat="server" Text='<%# Eval("presaInCarico") %>'
CssClass="fixedVal" ReadOnly="true" />
</td>
<td>
<asp:TextBox ID="inizioInterventoLabel" runat="server" Text='<%# Eval("inizioIntervento") %>'
CssClass="fixedVal" ReadOnly="true" />
</td>
<td>
<asp:TextBox ID="fineInterventoLabel" runat="server" Text='<%# Eval("fineIntervento") %>'
CssClass="fixedVal" ReadOnly="true" />
</td>
<td>
<asp:DropDownList runat="server" ID="ddlStato" CssClass="fixedVal" SelectedValue='<%# Eval("idxStato") %>'
DataSourceID="odsStato" DataTextField="label" DataValueField="value" Enabled="false">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsStato" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selStatoTableAdapter">
</asp:ObjectDataSource>
</td>
<td rowspan="3" style="vertical-align: top; padding-left: 30px;">
<uc1:mod_interventoOpMtz ID="mod_interventoOpMtz3" runat="server" vistaModulo="selezione" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label runat="server" ID="lblDescrGuasto" Text='<%# traduci ("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblIsPreventivabile" Text='<%# traduci("lblIsPreventivabile") %>'
Font-Size="X-Small" />
<asp:CheckBox ID="isPreventivabileCheckBox" runat="server" Checked='<%# Eval("isPreventivabile") %>'
Enabled="false" />
</td>
</tr>
<tr>
<td colspan="3">
<asp:TextBox ID="descrizioneInterventoLabel" runat="server" Text='<%# Eval("descrizioneIntervento") %>'
CssClass="fixedValLeft" ReadOnly="true" Height="100px" Width="500px" TextMode="MultiLine" />
</td>
</tr>
</table>
</div>
</div>
</ItemTemplate>
<EditItemTemplate>
<div id="divEditDefault">
<div style="float: right;">
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text='<%# traduci("Update") %>' Width="150px" />
</div>
<div id="divUp" style="background-color: #E5E2E1; padding: 10px; border-top: solid 2px orange;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblNumIntMtz" Text='<%# traduci("numIntMtz") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataOra" Text='<%# traduci("lblDataOraRich") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="Label1" Text='<%# traduci("lblDataOraGuasto") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataLav" Text='<%# traduci("lblDataLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblTurnoLav" Text='<%# traduci("lblTurnoLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblMatr" Text='<%# traduci("lblMatr") %>' Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="numIntMtzLabel" runat="server" Text='<%# Eval("numIntMtz") %>' CssClass="textEv_Read"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="richiestaLabel" runat="server" Text='<%# Eval("richiesta") %>' CssClass="textEv_Read"
ReadOnly="true" Width="105px" />
</td>
<td>
<asp:TextBox ID="guastoLabel" runat="server" Text='<%# Eval("guasto") %>' CssClass="textEv_Read"
ReadOnly="true" Width="110px" />
</td>
<td>
<asp:TextBox ID="dataLavLabel" runat="server" Text='<%# Eval("dataLav","{0:dd/MM/yy}") %>'
CssClass="textEv_Read" ReadOnly="true" Width="105px" />
</td>
<td>
<asp:TextBox ID="turnoLavLabel" runat="server" Text='<%# Eval("turnoLav") %>' CssClass="textEv_Read"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="matrLabel" runat="server" Text='<%# Eval("matr") %>' CssClass="textEv_Read"
ReadOnly="true" Width="105px" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblIsFermo" Text='<%# traduci("lblIsFermo") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblDettagliGuasto" Text='<%# traduci("lblDettagliGuasto") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="isFermoCheckBox" runat="server" Checked='<%# Eval("isFermo") %>'
Enabled="false" />
</td>
<td colspan="5">
<asp:TextBox ID="descrAmbitoGuastoLabel" runat="server" Text='<%# Eval("descrAmbitoGuasto") %>'
CssClass="textEv_Read" ReadOnly="true" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblImpianto" Text='<%# traduci("lblImpianto") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listImpianti" runat="server" DataSourceID="odsImpianti" DataTextField="label"
DataValueField="value" Width="400px" BackColor="#deeff7" Font-Size="8pt" SelectedValue='<%# Eval("idxImpianto") %>'
Enabled="false">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getImpiantiValidi" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblMacchina" Text='<%# traduci("lblMacchina") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listMacchine" runat="server" DataSourceID="odsMacchine" DataTextField="label"
DataValueField="value" Width="400px" BackColor="#deeff7" Font-Size="8pt" SelectedValue='<%# Eval("idxMacchina") %>'
Enabled="false">
</asp:DropDownList>
<%--<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listImpianti" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>--%>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td style="padding-top: 15px;">
<asp:Label runat="server" ID="lblDescrCausale" Text='<%# traduci("lblDescrCausale") %>'
Font-Size="X-Small" />
</td>
<td colspan="5" style="padding-top: 15px;">
<asp:TextBox ID="descrCausaleLabel" runat="server" Text='<%# Eval("descrCausale") %>'
CssClass="textEv_ReadLeft" ReadOnly="true" Width="530px" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblDescrPriorita" Text='<%# traduci("lblDescrPriorita") %>'
Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblDescrizioneGen" Text='<%# traduci("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr style="vertical-align: top;">
<td>
<asp:TextBox ID="descrPrioritaLabel" runat="server" Text='<%# Eval("descrPriorita") %>'
CssClass="textEv_Read" ReadOnly="true" />
</td>
<td colspan="5">
<asp:TextBox ID="descrizioneLabel" runat="server" Text='<%# Eval("descrizione") %>'
CssClass="textEv_ReadLeft" ReadOnly="true" Height="100px" Width="530px" TextMode="MultiLine" />
</td>
</tr>
<tr>
<td colspan="5">
<asp:Label runat="server" ID="lblDescrTipo" Text='<%# traduci("lblDescrTipo") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="descrTipoLabel" runat="server" Text='<%# Eval("descrTipo") %>' CssClass="textEv_Read"
ReadOnly="true" />
</td>
</tr>
</table>
</div>
<div id="divDown" style="background-color: #FFFFFF; border-top: solid 2px orange;
padding: 10px;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblPresaInCarico" Text='<%# traduci("lblPresaInCarico") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblInizioIntervento" Text='<%# traduci("lblInizioIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblFineIntervento" Text='<%# traduci("lblFineIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDescrStato" Text='<%# traduci("lblDescrStato") %>'
Font-Size="X-Small" />
</td>
<td style="text-align: center;">
<asp:Label runat="server" ID="lblInterventi" Text='<%# traduci ("lblInterventi") %>'
Font-Size="X-Small"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("presaInCarico") %>' CssClass="textEv_Read"
ReadOnly="true" />
</td>
<td>
<uc2:mod_dataOra ID="mod_dataOra2" runat="server" valore='<%# Bind("inizioIntervento") %>'
css="textEv_1" tipoOrario="tendina" mostraLabel="false" />
</td>
<td>
<uc2:mod_dataOra ID="mod_dataOra3" runat="server" valore='<%# Bind("fineIntervento") %>'
css="textEv_1" tipoOrario="tendina" mostraLabel="false" />
</td>
<td>
<asp:DropDownList runat="server" ID="ddlStato" CssClass="textEv_1" SelectedValue='<%# Bind("idxStato") %>'
DataSourceID="odsStato" DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsStato" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selStatoTableAdapter">
</asp:ObjectDataSource>
</td>
<td rowspan="3" style="vertical-align: top; padding-left: 30px;">
<uc1:mod_interventoOpMtz ID="mod_interventoOpMtz2" runat="server" vistaModulo="editing" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label runat="server" ID="lblDescrGuasto" Text='<%# traduci ("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblIsPreventivabile" Text='<%# traduci("lblIsPreventivabile") %>'
Font-Size="X-Small" />
<asp:CheckBox ID="isPreventivabileCheckBox" runat="server" Checked='<%# Bind("isPreventivabile") %>'
Enabled="true" />
</td>
</tr>
<tr>
<td colspan="3">
<asp:TextBox ID="descrizioneInterventoLabel" runat="server" Text='<%# Bind("descrizioneIntervento") %>'
Height="100px" Width="500px" CssClass="textEv_1Left" TextMode="MultiLine" />
</td>
</tr>
</table>
</div>
</div>
</EditItemTemplate>
</asp:FormView>
<asp:FormView ID="frmView_full" runat="server" DataKeyNames="numIntMtz" Visible="False"
DataSourceID="ods_full" Width="100%">
<EditItemTemplate>
<div id="divEditFull">
<div id="btnCancel" style="float: right;">
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text='<%# traduci("Update") %>' Width="150px" />
</div>
<div id="divUp" style="background-color: #E5E2E1; padding: 10px; border-top: solid 2px orange;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblNumIntMtz" Text='<%# traduci("numIntMtz") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataOra" Text='<%# traduci("lblDataOraRich") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataOraGuasto" Text='<%# traduci("lblDataOraGuasto") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDataLav" Text='<%# traduci("lblDataLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblTurnoLav" Text='<%# traduci("lblTurnoLav") %>' Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblMatr" Text='<%# traduci("lblMatr") %>' Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="numIntMtzLabel" runat="server" Text='<%# Eval("numIntMtz") %>' CssClass="textEv_Read"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="richiestaLabel" runat="server" Text='<%# Eval("richiesta") %>' CssClass="textEv_Read"
ReadOnly="true" Width="105px" />
</td>
<td>
<uc2:mod_dataOra ID="mod_dataOra4" runat="server" valore='<%# Bind("guasto") %>'
css="textEv_2" tipoOrario="tendina" mostraLabel="false" />
</td>
<td>
<asp:TextBox ID="dataLavLabel" runat="server" Text='<%# Eval("dataLav","{0:dd/MM/yy}") %>'
CssClass="textEv_Read" ReadOnly="true" Width="105px" />
</td>
<td>
<asp:TextBox ID="turnoLavLabel" runat="server" Text='<%# Eval("turnoLav") %>' CssClass="textEv_Read"
ReadOnly="true" Width="30px" />
</td>
<td>
<asp:TextBox ID="matrLabel" runat="server" Text='<%# Bind("matr") %>' CssClass="textEv_2"
Width="105px" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblIsFermo" Text='<%# traduci("lblIsFermo") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblDettagliGuasto" Text='<%# traduci("lblDettagliGuasto") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="isFermoCheckBox" runat="server" Checked='<%# Bind("isFermo") %>'
Enabled="true" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblAmbito" />
<asp:DropDownList runat="server" ID="ddlAmbito" Font-Bold="True" Font-Size="10pt"
CssClass="textEv_2" DataSourceID="odsAmbiti" DataTextField="label" DataValueField="value"
SelectedValue='<%# Bind("idxAmbito") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsAmbiti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selAmbitiTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblImpianto" Text='<%# traduci("lblImpianto") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listImpianti" runat="server" DataSourceID="odsImpianti" DataTextField="label"
DataValueField="value" Width="400px" BackColor="#cdffcd" Font-Size="8pt" SelectedValue='<%# Bind("idxImpianto") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getImpiantiValidi" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblMacchina" Text='<%# traduci("lblMacchina") %>' Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:DropDownList ID="listMacchine" runat="server" DataSourceID="odsMacchine" DataTextField="label"
DataValueField="value" Width="400px" BackColor="#cdffcd" Font-Size="8pt" SelectedValue='<%# Bind("idxMacchina") %>'>
</asp:DropDownList>
<%--<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listImpianti" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>--%>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td style="padding-top: 15px;">
<asp:Label runat="server" ID="lblDescrCausale" Text='<%# traduci("lblDescrCausale") %>'
Font-Size="X-Small" />
</td>
<td colspan="5" style="padding-top: 15px;">
<asp:DropDownList ID="listCausali" runat="server" AutoPostBack="True" DataSourceID="odsCausali"
DataTextField="label" DataValueField="value" Width="400px" BackColor="#cdffcd"
Font-Size="8pt" SelectedValue='<%# Bind("idxCausale") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsCausali" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selCausaliMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listMacchine" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblDescrPriorita" Text='<%# traduci("lblDescrPriorita") %>'
Font-Size="X-Small" />
</td>
<td colspan="5">
<asp:Label runat="server" ID="lblDescrizioneGen" Text='<%# traduci("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr style="vertical-align: top;">
<td>
<asp:Label runat="server" ID="lblPrior" /><br />
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="label"
DataValueField="value" CssClass="textEv_2" SelectedValue='<%# Bind("idxPriorita") %>' />
<asp:ObjectDataSource ID="odsPrior" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selPriorTableAdapter">
</asp:ObjectDataSource>
</td>
<td colspan="6">
<asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("descrizione") %>'
CssClass="textEv_2Left" Height="100px" Width="530px" TextMode="MultiLine" />
<asp:RequiredFieldValidator ID="rfvDescrizione" runat="server" ErrorMessage="Obbligatorio !!!"
ControlToValidate="txtDescrizione" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="6">
<asp:Label runat="server" ID="lblDescrTipo" Text='<%# traduci("lblDescrTipo") %>'
Font-Size="X-Small" />
</td>
</tr>
<tr>
<td>
<asp:Label runat="server" ID="lblTipoGuasto" /><br />
<asp:DropDownList runat="server" ID="ddlTipo" Font-Bold="True" Font-Size="10pt" CssClass="textEv_2"
DataSourceID="odsTipo" DataTextField="label" DataValueField="value" SelectedValue='<%# Bind("idxTipo") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsTipo" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selTipoGuastoTableAdapter">
</asp:ObjectDataSource>
</td>
</tr>
</table>
</div>
<div id="divDown" style="background-color: #FFFFFF; border-top: solid 2px orange;
padding: 10px;">
<table>
<tr>
<td>
<asp:Label runat="server" ID="lblPresaInCarico" Text='<%# traduci("lblPresaInCarico") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblInizioIntervento" Text='<%# traduci("lblInizioIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblFineIntervento" Text='<%# traduci("lblFineIntervento") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblDescrStato" Text='<%# traduci("lblDescrStato") %>'
Font-Size="X-Small" />
</td>
<td style="text-align: center;">
<asp:Label runat="server" ID="lblInterventi" Text='<%# traduci ("lblInterventi") %>'
Font-Size="X-Small"></asp:Label>
</td>
</tr>
<tr>
<td>
<%--<uc2:mod_dataOra ID="mod_dataOra10" runat="server" valore='<%# Bind("presaInCarico") %>'
css="textEv_1" tipoOrario="tendina" mostraLabel="false" />--%>
<asp:TextBox ID="presaInCaricoLabel" runat="server" Text='<%# Bind("presaInCarico") %>'
CssClass="textEv_Read" />
</td>
<td>
<uc2:mod_dataOra ID="mod_dataOra2" runat="server" valore='<%# Bind("inizioIntervento") %>'
css="textEv_1" tipoOrario="tendina" mostraLabel="false" />
</td>
<td>
<uc2:mod_dataOra ID="mod_dataOra3" runat="server" valore='<%# Bind("fineIntervento") %>'
css="textEv_1" tipoOrario="tendina" mostraLabel="false" />
</td>
<td>
<asp:DropDownList runat="server" ID="ddlStato" CssClass="textEv_1" SelectedValue='<%# Bind("idxStato") %>'
DataSourceID="odsStato" DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsStato" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selStatoTableAdapter">
</asp:ObjectDataSource>
</td>
<td rowspan="3" style="vertical-align: top; padding-left: 30px;">
<uc1:mod_interventoOpMtz ID="mod_interventoOpMtz4" runat="server" vistaModulo="editing" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label runat="server" ID="lblDescrGuasto" Text='<%# traduci ("lblDescrizioneGen") %>'
Font-Size="X-Small" />
</td>
<td>
<asp:Label runat="server" ID="lblIsPreventivabile" Text='<%# traduci("lblIsPreventivabile") %>'
Font-Size="X-Small" />
<asp:CheckBox ID="isPreventivabileCheckBox" runat="server" Checked='<%# Bind("isPreventivabile") %>'
Enabled="true" />
</td>
</tr>
<tr>
<td colspan="3">
<asp:TextBox ID="descrizioneInterventoLabel" runat="server" Text='<%# Bind("descrizioneIntervento") %>'
Height="100px" Width="500px" CssClass="textEv_1Left" TextMode="MultiLine" />
</td>
</tr>
</table>
</div>
</div>
</EditItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="ods_default" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByIdx" TypeName="DS_applicazioneTableAdapters.v_intervExpTableAdapter"
UpdateMethod="sp_updateIntervento">
<UpdateParameters>
<asp:Parameter Name="Original_numIntMtz" Type="Int32" />
<asp:Parameter Name="idxStato" Type="Int32" />
<asp:Parameter Name="inizioIntervento" Type="DateTime" />
<asp:Parameter Name="fineIntervento" Type="DateTime" />
<asp:Parameter Name="isPreventivabile" Type="Boolean" />
<asp:Parameter Name="descrizioneIntervento" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="numIntMtz" SessionField="numIntMtz_sel"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ods_full" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByIdx" TypeName="DS_applicazioneTableAdapters.v_intervExpTableAdapter"
UpdateMethod="sp_updateInterventoFull" OnUpdated="ods_full_Updated">
<UpdateParameters>
<asp:Parameter Name="Original_numIntMtz" Type="Int32" />
<asp:Parameter Name="idxStato" Type="Int32" />
<asp:Parameter Name="inizioIntervento" Type="DateTime" />
<asp:Parameter Name="fineIntervento" Type="DateTime" />
<asp:Parameter Name="isPreventivabile" Type="Boolean" />
<asp:Parameter Name="descrizioneIntervento" Type="String" />
<asp:Parameter Name="matr" Type="String" />
<asp:Parameter Name="guasto" Type="DateTime" />
<asp:Parameter Name="isFermo" Type="Boolean" />
<asp:Parameter Name="idxImpianto" Type="Int32" />
<asp:Parameter Name="idxMacchina" Type="Int32" />
<asp:Parameter Name="idxAmbito" Type="Int32" />
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="idxTipo" Type="Int32" />
<asp:Parameter Name="idxCausale" Type="Int32" />
<asp:Parameter Name="presaInCarico" Type="DateTime" />
</UpdateParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="numIntMtz" SessionField="numIntMtz_sel"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
@@ -1,144 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_dettaglioIntervento : System.Web.UI.UserControl
{
#region gestione eventi
public event EventHandler eh_chiudi;
//public event EventHandler eh_nuovoValore;
//public event EventHandler eh_selValore;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
setupInizialeControlli();
}
if (frmView_default.CurrentMode == FormViewMode.ReadOnly)
{
btnCancel.Visible = false;
}
}
/// <summary>
/// setup iniziale e di reset dei controlli
/// </summary>
private void setupInizialeControlli()
{
traduciObj();
frmView_default.ChangeMode(FormViewMode.ReadOnly);
frmView_default.Visible = true;
frmView_full.Visible = false;
btnCancel.Enabled= userCanEditData;
btnCompilaMtz.Enabled = userCanEditData;
btnEditFull.Enabled = userCanEditData;
}
/// <summary>
/// effettua traduzione pagina in lingua corrente
/// </summary>
private void traduciObj()
{
btnElenco.Text = traduci("btnElencoRichiesteMtz");
btnCancel.Text = traduci("btnCancel");
btnCompilaMtz.Text = traduci("btnCompilaMtz");
btnEditFull.Text = traduci("btnEditFull");
}
/// <summary>
/// wrapper alla traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// aggiorna il dato mostrato
/// </summary>
public void doUpdate()
{
setupInizialeControlli();
}
/// <summary>
/// abilita compilazione parte mtz dell'intervento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCompilaMtz_Click(object sender, EventArgs e)
{
frmView_default.ChangeMode(FormViewMode.Edit);
frmView_default.Visible = true;
frmView_full.Visible = false;
btnCancel.Visible = true;
}
/// <summary>
/// permette editing di tutto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEditFull_Click(object sender, EventArgs e)
{
frmView_full.ChangeMode(FormViewMode.Edit);
frmView_full.Visible = true;
frmView_default.Visible = false;
btnCancel.Visible = true;
frmView_default.DataBind();
frmView_full.DataBind();
}
/// <summary>
/// chiude la parte di editing
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
frmView_default.ChangeMode(FormViewMode.ReadOnly);
frmView_default.Visible = true;
frmView_full.Visible = false;
btnCancel.Visible = false;
frmView_default.DataBind();
frmView_full.DataBind();
}
/// <summary>
/// chiude la parte di editing
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnElenco_Click(object sender, EventArgs e)
{
if (eh_chiudi != null)
{
eh_chiudi(this, new EventArgs());
}
}
protected void ods_full_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
frmView_default.ChangeMode(FormViewMode.ReadOnly);
frmView_default.Visible = true;
frmView_full.Visible = false;
frmView_default.DataBind();
}
protected void listCausali_TextChanged(object sender, EventArgs e)
{
btnCancel.Visible = true;
}
/// <summary>
/// determina se l'utente possa editare i dati (permesso "_SU"
/// </summary>
public bool userCanEditData
{
get
{
return (user_std.UtSn.diritti.Select("COD_FUNZIONE = 'GIM_SU'").Length > 0);
}
}
}
-88
View File
@@ -1,88 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elFamMacch.ascx.cs"
Inherits="mod_elFamMacch" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxFamMacchine" DataSourceID="ods"
OnDataBound="grView_DataBound" OnRowEditing="grView_RowEditing"
onselectedindexchanged="grView_SelectedIndexChanged">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="idxFamMacchine" HeaderText="idxFamMacchine" InsertVisible="False"
Visible="false" ReadOnly="True" SortExpression="idxFamMacchine" />
<asp:TemplateField HeaderText="nomeFamMacch" SortExpression="nomeFamMacch">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("nomeFamMacch") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("nomeFamMacch") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete" Visible='<%# isDeletable(Eval("idxFamMacchine")) %>'
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagFamMacchineTableAdapter"
UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="Original_{0}"
FilterExpression="nomeFamMacch LIKE '%{0}%' " InsertMethod="Insert"
onupdated="ods_Updated">
<UpdateParameters>
<asp:Parameter Name="nomeFamMacch" Type="String" />
<asp:Parameter Name="Original_idxFamMacchine" Type="Int32" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxFamMacchine" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="nomeFamMacch" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
-134
View File
@@ -1,134 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_elFamMacch : ApplicationUserControl
{
public event EventHandler eh_selezioneValore;
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
DS_applicazioneTableAdapters.AnagFamMacchineTableAdapter taFamMacc = new DS_applicazioneTableAdapters.AnagFamMacchineTableAdapter();
taFamMacc.Insert("-- [NUOVA] n.d. --");
grView.DataBind();
}
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
if (eh_selezioneValore != null)
{
eh_selezioneValore(this, new EventArgs());
}
}
/// <summary>
/// restituisce il valore selezionato... se non selezionato restituisce -1
/// </summary>
public int idxFamMacc_sel
{
get
{
int answ = -1;
if (grView.SelectedIndex != -1)
{
answ = Convert.ToInt32(grView.SelectedValue);
}
return answ;
}
}
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// determina se sia cancellabile
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public bool isDeletable(object idx)
{
bool answ=false;
if (TA_app.obj.taMacc2Fam.getByFam(Convert.ToInt32(idx)).Rows.Count == 0)
{
answ = true;
}
return answ;
}
/// <summary>
/// esegue update
/// </summary>
public void doUpdate()
{
grView.DataBind();
}
}
-56
View File
@@ -1,56 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elMacch2Fam.ascx.cs"
Inherits="mod_elMacch2Fam" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxFamMacchine,idxMacchina" DataSourceID="ods" OnDataBound="grView_DataBound" Font-Size="X-Small" >
<RowStyle CssClass="ctrRowStyleDet" />
<AlternatingRowStyle CssClass="ctrAltRowStyleDet" />
<EditRowStyle CssClass="ctrEditRowStyleDet" />
<SelectedRowStyle CssClass="ctrSelRowStyleDet" />
<FooterStyle CssClass="ctrFooterDet" />
<PagerStyle CssClass="ctrHeaderPagerDet" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPagerDet" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyleDet" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="idxFamMacchine" HeaderText="idxFamMacchine" Visible="false"
ReadOnly="True" />
<asp:BoundField DataField="idxMacchina" HeaderText="idxMacchina" Visible="false"
ReadOnly="True" />
<asp:TemplateField HeaderText="macchina" SortExpression="macchina">
<ItemTemplate>
<asp:Label ID="lblMacchina" runat="server" Text='<%# Bind("macchina") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
</HeaderTemplate>
<EditItemTemplate>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:Label ID="lblFamMacc" runat="server" Visible="false" Text="0" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getByFam" TypeName="DS_applicazioneTableAdapters.v_selFamMaccTableAdapter"
DeleteMethod="DeleteQuery" OldValuesParameterFormatString="Original_{0}"
onDeleted="ods_Deleted" >
<SelectParameters>
<asp:ControlParameter DefaultValue="*" ControlID="lblFamMacc" Name="idxFamMacchine"
Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxMacchina" Type="Int32" />
<asp:Parameter Name="Original_idxFamMacchine" Type="Int32" />
</DeleteParameters>
</asp:ObjectDataSource>
-73
View File
@@ -1,73 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_elMacch2Fam : ApplicationUserControl
{
public event EventHandler eh_delValore;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// indica il valore dell'impianto filtrato in visualizzazione
/// </summary>
public int idxFamMacchSel
{
get
{
return Convert.ToInt32(lblFamMacc.Text);
}
set
{
lblFamMacc.Text = value.ToString();
}
}
/// <summary>
/// eliminato il valore genera l'evento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (eh_delValore != null)
{
eh_delValore(this, new EventArgs());
}
}
/// <summary>
/// esegue update
/// </summary>
public void doUpdate()
{
grView.DataBind();
}
}
-145
View File
@@ -1,145 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elencoMtzProg.ascx.cs"
Inherits="mod_elencoMtzProg" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<div style="width: 100%; background: #cdcdcd;" class="txtMini">
<table cellpadding="5px">
<tr valign="top">
<td style="width: 250px;">
<div>
<asp:Label runat="server" ID="lblFiltTipo" />
</div>
<div>
<uc1:mod_filtro ID="mod_filtroTipo" runat="server" css="txtMini" />
<asp:ObjectDataSource ID="odsTipo" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selTipoGuastoTableAdapter">
</asp:ObjectDataSource>
</div>
</td>
<td>
<div>
<asp:Label runat="server" ID="lblFiltMacchina" />
</div>
<div>
<uc1:mod_filtro ID="mod_filtroImpianto" runat="server" css="txtMini" Oneh_selValore="eh_selectedImpianto" />
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</div>
<div>
<uc1:mod_filtro ID="mod_filtroMacchina" runat="server" css="txtMini" Visible="false" />
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="mod_filtroImpianto" DefaultValue="0" Name="conditio"
PropertyName="valoreInt" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</td>
</tr>
</table>
<asp:Button ID="btnShowNew" runat="server" OnClick="btnShowNew_Click" />
</div>
<div>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
DataKeyNames="idxIntPro" DataSourceID="ods" OnRowDataBound="grView_RowDataBound"
OnRowUpdating="grView_RowUpdating">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="idxIntPro" Visible="false" />
<asp:TemplateField HeaderText="lblMacchina" SortExpression="nomeMacchina">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("nomeMacchina") %>' />
<asp:Label ID="Label4" runat="server" Text='<%# Eval("codMacchina","({0})") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="inizio" HeaderText="inizioMtzPro"
SortExpression="inizio" DataFormatString="{0:dd/MM/yy}" HtmlEncode="False" />
<asp:BoundField DataField="frequenza" HeaderText="frequenzaMtzPro" SortExpression="frequenza" />
<asp:BoundField DataField="cadenza" HeaderText="cadenzaMtzPro" SortExpression="cadenza" />
<asp:TemplateField HeaderText="descrizione" SortExpression="descrizione">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# trimmaTesto(Eval("descrizione"),50) %>'
ToolTip='<%# Eval("descrizione") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="descrTipo" HeaderText="lblTipoGuastoShort" SortExpression="descrTipo" />
<asp:TemplateField HeaderText="chkImpFermoShort" SortExpression="isFermo" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="Label2" runat="server" Checked='<%# Eval("isFermo") %>' Enabled="false" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="lblPriorShort" SortExpression="descrPriorita" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("idxPriorita") %>' ToolTip='<%# Eval("descrPriorita") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%# Eval("idxIntPro") %>' ToolTip='<%# traduci("Delete") %>'
Visible="true" ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.v_mtzProgExpTableAdapter"
FilterExpression=" codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' "
DeleteMethod="Delete" InsertMethod="Insert" UpdateMethod="Update">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
<asp:ControlParameter ControlID="mod_filtroTipo" DefaultValue="0" Name="idxTipo"
PropertyName="valoreInt" Type="Int32" />
<asp:ControlParameter ControlID="mod_filtroMacchina" DefaultValue="0" Name="idxMacchina"
PropertyName="valoreInt" Type="Int32" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxIntPro" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="idxMacchina" Type="Int32" />
<asp:Parameter Name="inizio" Type="DateTime" />
<asp:Parameter Name="codFrequenza" Type="String" />
<asp:Parameter Name="cadenza" Type="Int32" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="isFermo" Type="Boolean" />
<asp:Parameter Name="idxTipo" Type="Int32" />
<asp:Parameter Name="Original_idxIntPro" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="idxMacchina" Type="Int32" />
<asp:Parameter Name="inizio" Type="DateTime" />
<asp:Parameter Name="codFrequenza" Type="String" />
<asp:Parameter Name="cadenza" Type="Int32" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="isFermo" Type="Boolean" />
<asp:Parameter Name="idxTipo" Type="Int32" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</div>
-269
View File
@@ -1,269 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using System.Data;
public partial class mod_elencoMtzProg : ApplicationUserControl
{
#region gestione eventi
public event EventHandler eh_newReq;
public event EventHandler eh_resetSelezione;
public event EventHandler eh_selValore;
#endregion
protected string _idxGridView;
/// <summary>
/// traduzioni
/// </summary>
protected override void traduciObj()
{
base.traduciObj();
btnShowNew.Text = traduci("btnShowNew");
lblFiltMacchina.Text = traduci("lblFiltMacchina");
lblFiltTipo.Text = traduci("lblFiltTipo");
}
/// <summary>
/// cambio visibilità pannello new data
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnShowNew_Click(object sender, EventArgs e)
{
if (btnShowNew.Text == traduci("btnHideNew"))
{
btnShowNew.Text = traduci("btnShowNew");
}
else
{
btnShowNew.Text = traduci("btnHideNew");
}
// chiamo evento
if (eh_newReq != null)
{
eh_newReq(this, new EventArgs());
}
}
/// <summary>
/// aggiorno il controllo
/// </summary>
public void doUpdate()
{
grView.DataBind();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
/// <summary>
/// restituisce un testo trimamto a maxChar caratteri
/// </summary>
/// <param name="testo"></param>
/// <param name="maxChar"></param>
/// <returns></returns>
public string trimmaTesto(object _testo, object _maxChar)
{
string answ = "";
string testo = _testo.ToString();
int maxChar = Convert.ToInt32(_maxChar);
if (testo.Length <= maxChar)
{
answ = testo;
}
else
{
answ = string.Format("{0}...", testo.Substring(0, maxChar));
}
return answ;
}
/// <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 = "";
}
}
/// <summary>
/// setta selected alla riga il cui valore key è in session
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
{
// se riga di dati...
if (e.Row.RowType == DataControlRowType.DataRow)
{
// ottengo la riga tipizzata...
System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem;
DS_applicazione.v_mtzProgExpRow riga = (DS_applicazione.v_mtzProgExpRow)_drv.Row;
if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.idxIntPro.ToString())
{
grView.SelectedIndex = e.Row.RowIndex;
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView));
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
}
}
/// <summary>
/// in caso di aggiornamento verifico se sia salvato un comando clona...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
// carico l'idx dell'oggetto
int _idx = Convert.ToInt32(e.Keys["numIntMtz"]);
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
// verifico il tipo di richiesta (up/down level, clona o update normale
switch (_comando)
{
case "clonaObj":
// blocco update!
e.Cancel = true;
break;
default:
// faccio update!
break;
}
}
/// <summary>
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "idxIntPro";
if (!Page.IsPostBack)
{
mod_filtroImpianto.ods = odsImpianti;
mod_filtroMacchina.ods = odsMacchine;
mod_filtroTipo.ods = odsTipo;
}
mod_filtroTipo.eh_selValore += new EventHandler(mod_filtroTipo_eh_selValore);
mod_filtroMacchina.eh_selValore += new EventHandler(mod_filtroMacchina_eh_selValore);
}
void mod_filtroMacchina_eh_selValore(object sender, EventArgs e)
{
// chiamo procedura ricostruzione ods con filtri...
checkFixOds();
}
void mod_filtroTipo_eh_selValore(object sender, EventArgs e)
{
// chiamo procedura ricostruzione ods con filtri...
checkFixOds();
}
/// <summary>
/// sistemo filtraggio con valori selezionati
/// </summary>
private void checkFixOds()
{
ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )";
if (mod_filtroTipo.valoreInt != 0)
{
ods.FilterExpression += " AND (idxTipo = {1})";
}
if (mod_filtroMacchina.valoreInt != 0)
{
ods.FilterExpression += " AND (idxMacchina = {2})";
}
ods.DataBind();
}
/// <summary>
/// chiamato post modifica valore check/selezione nel selettore filtro impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void eh_selectedImpianto(object sender, EventArgs e)
{
if (mod_filtroImpianto.valoreInt != 0)
{
if (!mod_filtroMacchina.Visible)
{
mod_filtroMacchina.Visible = true;
}
else
{
mod_filtroMacchina.reset();
}
mod_filtroMacchina.ods = odsMacchine;
}
else
{
mod_filtroMacchina.reset();
mod_filtroMacchina.Visible = false;
}
}
}
-112
View File
@@ -1,112 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elencoRichieste.ascx.cs"
Inherits="mod_elencoRichieste" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc1" %>
<div style="width: 100%; background-color: #cdcdcd; clear: both;" class="bg_plus">
<div style="float: left;">
<asp:CheckBox runat="server" ID="chkMostraIntChiusi" AutoPostBack="true" OnCheckedChanged="chkMostraIntChiusi_CheckedChanged"
Checked="false" />
</div>
<div style="float: right;">
<uc1:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" />
</div>
</div>
<div style="font-size: 8pt; clear: both;">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
DataKeyNames="numIntMtz" DataSourceID="ods"
OnRowDataBound="grView_RowDataBound"
onpageindexchanged="grView_PageIndexChanged">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<span style="white-space: nowrap;">
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible='<%# !isPrInCarEnabl(Eval("numIntMtz")) %>' ToolTip='<%# traduci("ShowDetails") %>'
ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:HyperLink runat="server" ID="hlExportPdf" ToolTip='<%# traduci("exportRichiestaPDF") %>'
ImageUrl="~/images/page_pdf.png" NavigateUrl='<%# formattaUrl(Eval("numIntMtz")) %>' />
<asp:ImageButton runat="server" ID="btnPrendeInCarico" ImageUrl='<%# imgPath(SteamWare.tipoImg.stampa , SteamWare.dimImg.small) %>'
CommandArgument='<%# Eval("numIntMtz")%>' ToolTip='<%# traduci("prendeInCaricoRichiesta") %>'
OnClick="btnPrendeInCarico_Click" Visible='<%# isPrInCarEnabl(Eval("numIntMtz")) %>' />
</span>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="numIntMtz" HeaderText="(#)" Visible="true" ReadOnly="True"
SortExpression="numIntMtz" />
<asp:TemplateField HeaderText="Stato" SortExpression="DescrStato">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("DescrStato") %>' CssClass='<%# stileDaStato(Eval("idxStato")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="dataOraInsRichiesta" SortExpression="richiesta">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("richiesta") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="inizioFermata" SortExpression="guasto">
<ItemTemplate>
<asp:Label ID="Label" runat="server" Text='<%# Eval("guasto") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="matr" HeaderText="matricola" SortExpression="matr" />
<asp:BoundField DataField="descrAmbitoGuasto" HeaderText="macrocausa" SortExpression="descrAmbitoGuasto" />
<asp:TemplateField HeaderText="lblPriorShort" SortExpression="descrPriorita" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("idxPriorita") %>' ToolTip='<%# Eval("descrPriorita") %>'
CssClass='<%# stileDaPrior(Eval("idxPriorita")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="chkImpFermoShort" SortExpression="isFermo" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="Label2" runat="server" Checked='<%# Eval("isFermo") %>' Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="descrTipo" HeaderText="lblTipoGuastoShort" SortExpression="descrTipo" />
<asp:BoundField DataField="nomeImpianto" HeaderText="nomeImpianto" SortExpression="nomeImpianto" />
<asp:TemplateField HeaderText="lblMacchina" SortExpression="nomeMacchina">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("nomeMacchina") %>' />
<asp:Label ID="Label4" runat="server" Text='<%# Eval("codMacchina","({0})") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="descrizione" SortExpression="descrizione">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# trimmaTesto(Eval("descrizione"),50) %>'
ToolTip='<%# Eval("descrizione") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByPeriodo" TypeName="DS_applicazioneTableAdapters.v_intervExpTableAdapter"
FilterExpression=" ( codImpianto LIKE '%{0}%' OR nomeImpianto LIKE '%{0}%' OR codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' ) AND (idxStato < 3)">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="01/01/1900" Name="inizio" SessionField="_inizio"
Type="DateTime" />
<asp:SessionParameter DefaultValue="31/12/9999" Name="fine" SessionField="_fine"
Type="DateTime" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</div>
-374
View File
@@ -1,374 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using System.Data;
public partial class mod_elencoRichieste : ApplicationUserControl
{
#region area da NON modificare
#region area protected
protected string _idxGridView;
protected string _idxGridViewExt;
protected bool _showNewBtn = false;
/// <summary>
/// aggiorna controlli datagrid e numero righe in pagina
/// </summary>
protected override void aggiornaControlliDataGL()
{
base.aggiornaControlliDataGL();
grView.PageSize = _righeDataGridMed;
}
/// <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 = "";
}
}
/// <summary>
/// gestione evento richeista 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>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, true);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region public
/// <summary>
/// definisce visibilità btnNew
/// </summary>
public bool showNewBtn
{
get
{
return _showNewBtn;
}
set
{
_showNewBtn = value;
}
}
/// <summary>
/// effettua update del modulo
/// </summary>
public void doUpdate()
{
resetSelezione();
}
#endregion
#endregion
#region area codice variabile
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
DS_applicazione.v_intervExpDataTable tabella = new DS_applicazione.v_intervExpDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
/// <summary>
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "numIntMtz";
mod_periodoAnalisi1.eh_doUpdate += new EventHandler(mod_periodoAnalisi1_eh_doUpdate);
}
void mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
{
checkFixOds();
}
/// <summary>
/// setta selected alla riga il cui valore key è in session
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
{
// se riga di dati...
if (e.Row.RowType == DataControlRowType.DataRow)
{
// ottengo la riga tipizzata...
System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem;
DS_applicazione.v_intervExpRow riga = (DS_applicazione.v_intervExpRow)_drv.Row;
if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.numIntMtz.ToString())
{
grView.SelectedIndex = e.Row.RowIndex;
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView));
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
}
}
/// <summary>
/// formatta il tooltip del ferma dalle...
/// </summary>
/// <param name="dataOraFermo"></param>
/// <returns></returns>
public string formatFermaDalle(object dataOraFermo)
{
return string.Format("{0}: {1:dd/MM/yy HH:mm}", traduci("inizioFermata"), dataOraFermo);
}
/// <summary>
/// restituice lo stile css dato lo stato dell'intervento
/// </summary>
/// <param name="idxStato"></param>
/// <returns></returns>
public string stileDaStato(object idxStato)
{
string answ = "semaforoRosso";
try
{
answ = TA_app.obj.taStati.getByIdxStato(Convert.ToInt32(idxStato))[0].stile;
}
catch
{ }
return answ;
}
/// <summary>
/// restituice lo stile css data la priorità dell'intervento
/// </summary>
/// <param name="idxStato"></param>
/// <returns></returns>
public string stileDaPrior(object idxPrior)
{
string answ = "semaforoRosso";
try
{
answ = TA_app.obj.taPrior.getByIdxPriorita(Convert.ToInt32(idxPrior))[0].stile;
}
catch
{ }
return answ;
}
/// <summary>
/// restituisce un testo trimamto a maxChar caratteri
/// </summary>
/// <param name="testo"></param>
/// <param name="maxChar"></param>
/// <returns></returns>
public string trimmaTesto(object _testo, object _maxChar)
{
string answ = "";
string testo = _testo.ToString();
int maxChar = Convert.ToInt32(_maxChar);
if (testo.Length <= maxChar)
{
answ = testo;
}
else
{
answ = string.Format("{0}...", testo.Substring(0, maxChar));
}
return answ;
}
/// <summary>
/// restituisce url contenente parametri per rendering pdf
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string formattaUrl(object idx)
{
return String.Format("~/ExportPdf.aspx?tipo={0}&idx={1}", Convert.ToInt32(reportRichiesto.RichiestaIntervento), idx);
}
/// <summary>
/// prende in carico e stampa la scheda selezionata
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPrendeInCarico_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
int idx = Convert.ToInt32(imgBtn.CommandArgument);
// prende in carico la scheda...
try
{
int? newStato = 0;
TA_app.obj.taInterventiMtz.sp_setPresaInCarico(Convert.ToInt32(idx), ref newStato);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore durante presa in carico: {0}", exc), tipoLog.ERROR);
}
// stampo!
reportPrinter.obj.printReport(reportRichiesto.RichiestaIntervento, memLayer.ML.confReadString("stampanteRichiesteMtz"), idx.ToString());
// update del gridView...
grView.DataBind();
}
/// <summary>
/// restituisce true se è una richeista solo inserita e non ancora presa in carico
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
public bool isPrInCarEnabl(object num)
{
bool answ = false;
// se l'utente è BASE la presa in carico NON è permessa...
if (user_std.UtSn.diritti.Select("COD_FUNZIONE = 'GIM_SU'").Length > 0)
{
try
{
int idxStato = TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(num))[0].idxStato;
if (idxStato == 1)
{
answ = true;
}
}
catch
{ }
}
return answ;
}
/// <summary>
/// esegue traduzioni labels
/// </summary>
protected override void traduciObj()
{
base.traduciObj();
chkMostraIntChiusi.Text = traduci("chkMostraIntChiusi_mostra");
}
/// <summary>
/// cambia filtraggio...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void chkMostraIntChiusi_CheckedChanged(object sender, EventArgs e)
{
checkFixOds();
if (chkMostraIntChiusi.Checked == false)
{
chkMostraIntChiusi.Text = traduci("chkMostraIntChiusi_mostra");
}
else
{
chkMostraIntChiusi.Text = traduci("chkMostraIntChiusi_nascondi");
}
}
/// <summary>
/// sistemo filtraggio con valori selezionati
/// </summary>
private void checkFixOds()
{
ods.FilterExpression = "( codImpianto LIKE '%{0}%' OR nomeImpianto LIKE '%{0}%' OR codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )";
if (!chkMostraIntChiusi.Checked)
{
ods.FilterExpression += " AND (idxStato < 3)";
}
ods.DataBind();
}
/// <summary>
/// fix l'ods...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_PageIndexChanged(object sender, EventArgs e)
{
checkFixOds();
}
#endregion
}
-50
View File
@@ -1,50 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_famiglieMacchine.ascx.cs"
Inherits="mod_famiglieMacchine" %>
<%@ Register Src="mod_elFamMacch.ascx" TagName="mod_elFamMacch" TagPrefix="uc1" %>
<%@ Register Src="mod_elMacch2Fam.ascx" TagName="mod_elMacch2Fam" TagPrefix="uc2" %>
<%@ Register Src="mod_selettore.ascx" TagName="mod_selettore" TagPrefix="uc3" %>
<div>
<table>
<tr>
<td valign="top">
<uc1:mod_elFamMacch ID="mod_elFamMacch1" runat="server" />
<br />
<asp:Button ID="btnShowAdd" runat="server" OnClick="btnShowAdd_Click" />
</td>
<td valign="top">
<asp:Panel runat="server" ID="pnlSceltaMacchine" Visible="false">
<div style="width: 400px;">
<div style="float: left;">
<asp:Label runat="server" ID="lblMacchineInteressate" />
</div>
<div style="float: right;">
<asp:TextBox runat="server" ID="txtCercaMacchine" Width="8em" Text="*" />
</div>
<div>
<asp:ListBox ID="listMacchine" runat="server" AutoPostBack="True" DataSourceID="odsMacchine"
SelectionMode="Multiple" DataTextField="label" DataValueField="value" Height="250px"
Width="400px" BackColor="#ddeeff" Font-Size="8pt"></asp:ListBox>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter"
FilterExpression="label LIKE '%{0}%'">
<FilterParameters>
<asp:ControlParameter ControlID="txtCercaMacchine" DefaultValue="*" Type="String"
Name="txtCercaMacchine" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
<asp:Button ID="btnAddMacchine" runat="server" OnClick="btnAddMacchine_Click" />
<br />
<asp:Label runat="server" ID="lblWarning" CssClass="erroreMid" Visible="false" />
</div>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
<uc2:mod_elMacch2Fam ID="mod_elMacch2Fam1" runat="server" Visible="false" />
</td>
</tr>
</table>
<br />
</div>
@@ -1,111 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_famiglieMacchine : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
mod_elFamMacch1.eh_selezioneValore += new EventHandler(mod_elFamMacch1_eh_selezioneValore);
mod_elFamMacch1.eh_resetSelezione += new EventHandler(mod_elFamMacch1_eh_resetSelezione);
mod_elMacch2Fam1.eh_delValore += new EventHandler(mod_elMacch2Fam1_eh_delValore);
traduciObj();
// assicura che la label del pulsante venga sempre aggiornata
if (pnlSceltaMacchine.Visible)
{
btnShowAdd.Text = user_std.UtSn.Traduci("hideAddMacchine");
}
else
{
btnShowAdd.Text = user_std.UtSn.Traduci("showAddMacchine");
}
}
private void traduciObj()
{
btnShowAdd.Text = traduci("showAddMacchine");
btnAddMacchine.Text = traduci("AddMacchine2Fam");
lblMacchineInteressate.Text = traduci("lblMacchineInteressate");
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
void mod_elMacch2Fam1_eh_delValore(object sender, EventArgs e)
{
mod_elFamMacch1.doUpdate();
}
void mod_elFamMacch1_eh_resetSelezione(object sender, EventArgs e)
{
mod_elMacch2Fam1.Visible = false;
}
void mod_elFamMacch1_eh_selezioneValore(object sender, EventArgs e)
{
mod_elMacch2Fam1.idxFamMacchSel = mod_elFamMacch1.idxFamMacc_sel;
mod_elMacch2Fam1.Visible = true;
}
protected void btnAddMacchine_Click(object sender, EventArgs e)
{
// controllo se si possa salvare
if ((mod_elFamMacch1.idxFamMacc_sel != -1) && (listMacchine.SelectedIndex != -1))
{
lblWarning.Visible = false;
// ciclo ed inserisco le macchine selezionate
foreach (ListItem riga in listMacchine.Items)
{
// se è selezionata creo riga anche x lei...
if (riga.Selected)
{
associaMacchinaFamiglia(Convert.ToInt32(riga.Value), mod_elFamMacch1.idxFamMacc_sel);
}
}
mod_elMacch2Fam1.doUpdate();
}
else
{
lblWarning.Visible = true;
lblWarning.Text = traduci("pregoSelMacchFamMacch");
}
}
/// <summary>
/// associa la macchina indicata alla famiglia
/// </summary>
/// <param name="idxMacchina"></param>
/// <param name="idxFamMacc"></param>
private bool associaMacchinaFamiglia(int idxMacchina, int idxFamMacc)
{
bool answ = false;
try
{
TA_app.obj.taMacc2Fam.InsertQuery(idxMacchina, idxFamMacc);
answ = true;
}
catch
{ }
return answ;
}
protected void btnShowAdd_Click(object sender, EventArgs e)
{
pnlSceltaMacchine.Visible = !pnlSceltaMacchine.Visible;
if (pnlSceltaMacchine.Visible)
{
btnShowAdd.Text = user_std.UtSn.Traduci("hideAddMacchine");
}
else
{
btnShowAdd.Text = user_std.UtSn.Traduci("showAddMacchine");
}
}
}
-7
View File
@@ -1,7 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_filtro.ascx.cs" Inherits="mod_filtro" %>
<asp:CheckBox ID="chkFilt" runat="server" Checked="false" AutoPostBack="True" CssClass='<%# css %>'
OnCheckedChanged="chkFilt_CheckedChanged" />
<asp:DropDownList ID="dlFilt" runat="server" Visible="False" DataTextField="label"
CssClass='<%# css %>' DataValueField="value" AutoPostBack="True" OnSelectedIndexChanged="dlFilt_SelectedIndexChanged">
</asp:DropDownList>
<asp:Label ID="where" runat="server" Visible="false" Text="" />
-309
View File
@@ -1,309 +0,0 @@
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);
}
}
protected bool _changeCheckEnabled = true;
protected bool _changeCheckVisible = true;
protected bool _changeSelEnabled = true;
protected string _where = "";
protected override void traduciObj()
{
if (_changeCheckVisible)
{
if (!chkFilt.Checked)
{
chkFilt.Text = traduci("mostraSoloSelez");
}
else
{
chkFilt.Text = traduci("mostraTutti");
}
}
}
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;
/// <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 = 0;
try
{
if (chkFilt.Checked)
{
answ = Convert.ToInt32(dlFilt.SelectedValue);
}
}
catch
{ }
return answ;
}
}
protected void fixValore()
{
if (_ods != null)
{
dlFilt.DataSource = _ods;
dlFilt.DataBind();
if (_valore != "")
{
dlFilt.SelectedValue = _valore;
dlFilt.Visible = true;
chkFilt.Checked = true;
}
}
}
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();
}
}
protected void dlFilt_SelectedIndexChanged(object sender, EventArgs e)
{
raiseSelEvent();
// salvo val selezionato...
}
/// <summary>
/// oggetto ODS con cui popolare il selettore, VINCOLO abbia campi value(key) / label
/// </summary>
public ObjectDataSource ods
{
get
{
return _ods;
}
set
{
_ods = value;
bindControlli();
}
}
/// <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));
}
}
-6
View File
@@ -1,6 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_fixCal.ascx.cs" Inherits="mod_fixCal" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:TextBox ID="TextBox1" runat="server" Visible="false">
</asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1"
FirstDayOfWeek="monday" Format="dd/MM/yyyy" />
-18
View File
@@ -1,18 +0,0 @@
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;
public partial class mod_fixCal : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
-103
View File
@@ -1,103 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_gestCausali.ascx.cs"
Inherits="mod_gestCausali" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<uc1:mod_filtro ID="mod_filtroFam" runat="server" css="txtMini" changeCheckEnabled="false"
changeCheckVisible="false" />
<asp:ObjectDataSource ID="odsFam" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selFamTableAdapter">
</asp:ObjectDataSource>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxCausale" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="idxCausale" HeaderText="idxCausale" Visible="false" ReadOnly="True" />
<asp:BoundField DataField="idxFamMacchine" HeaderText="idxFamMacchine" Visible="false"
ReadOnly="True" />
<asp:TemplateField HeaderText="descrCausale" SortExpression="descrCausale">
<EditItemTemplate>
<asp:TextBox ID="txtdescrCausale" runat="server" Text='<%# Bind("descrCausale") %>'
Width="30em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbldescrCausale" runat="server" Text='<%# Eval("descrCausale") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="attiva" SortExpression="attiva">
<EditItemTemplate>
<asp:CheckBox ID="chkAttiva" runat="server" Checked='<%# Bind("attiva") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="lblAttiva" runat="server" Checked='<%# Eval("attiva") %>' Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
Visible='<%# isDeletable(Eval("idxCausale")) %>' ToolTip='<%# traduci("Delete") %>'
ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:Label ID="lblFamMacc" runat="server" Visible="false" Text="0" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagCausaliTableAdapter"
DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" OnDeleted="ods_Deleted"
InsertMethod="Insert" UpdateMethod="UpdateQuery" FilterExpression="idxFamMacchine = {0}">
<FilterParameters>
<asp:ControlParameter ControlID="mod_filtroFam" Name="idx" PropertyName="valoreInt" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxCausale" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="descrCausale" Type="String" />
<asp:Parameter Name="attiva" Type="Boolean" />
<asp:Parameter Name="Original_idxCausale" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="idxFamMacchine" Type="Int32" />
<asp:Parameter Name="descrCausale" Type="String" />
<asp:Parameter Name="attiva" Type="Boolean" />
</InsertParameters>
</asp:ObjectDataSource>
-112
View File
@@ -1,112 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_gestCausali : ApplicationUserControl
{
public event EventHandler eh_delValore;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!Page.IsPostBack)
{
mod_filtroFam.ods = odsFam;
}
}
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// eliminato il valore genera l'evento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
if (eh_delValore != null)
{
eh_delValore(this, new EventArgs());
}
}
/// <summary>
/// esegue update
/// </summary>
public void doUpdate()
{
grView.DataBind();
}
/// <summary>
/// determina se la causale sia cancellabile (ovvero non sia impiegata in alcuna registrazione di intervento...
/// </summary>
public bool isDeletable(object idxCausale)
{
bool answ = false;
try
{
if (TA_app.obj.taInterventiMtz.getByIdxCausale(Convert.ToInt32(idxCausale)).Rows.Count == 0) answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
TA_app.obj.taAnagCau.Insert(mod_filtroFam.valoreInt, "-- [NUOVA] non definita --", true);
grView.DataBind();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
}
-106
View File
@@ -1,106 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_gestUtentiGIM.ascx.cs"
Inherits="mod_gestUtentiGIM" %>
<div style="text-align: center; font-size: 8pt;">
<table>
<tr>
<td>
<h3>
<asp:Label runat="server" ID="lblUsers" />
</h3>
</td>
<td>
</td>
<td>
<h3>
<asp:Label runat="server" ID="lblSuperusers" />
</h3>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="grViewUsers" runat="server" AutoGenerateColumns="False" DataKeyNames="USER_NAME"
DataSourceID="odsUsers" CellPadding="4" ForeColor="#333333" GridLines="None"
AllowPaging="True" AllowSorting="True">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnResetU" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnResetU_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="true" ToolTip='<%# traduci("Select") %>' ImageUrl="~/images/view_s.png" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="COGNOME" HeaderText="COGNOME" SortExpression="COGNOME" />
<asp:BoundField DataField="NOME" HeaderText="NOME" SortExpression="NOME" />
<asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
<asp:BoundField DataField="USER_NAME" HeaderText="USER_NAME" ReadOnly="True" SortExpression="USER_NAME" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="odsUsers" runat="server" SelectMethod="elencoDaDiritti"
TypeName="SteamWare.user_std">
<SelectParameters>
<asp:Parameter DefaultValue="GIM" Name="codModulo" Type="String" />
<asp:Parameter DefaultValue="GIM_U" Name="codFunzione" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</td>
<td>
<div style="padding: 10px;">
<asp:Button ID="btnPromuovi" runat="server" Text="-->" Width="100px" OnClick="btnPromuovi_Click" />
<br />
<br />
<asp:Button ID="btnDeclassa" runat="server" Text="<--" Width="100px" OnClick="btnDeclassa_Click" />
</div>
</td>
<td>
<asp:GridView ID="grViewSuperusers" runat="server" AutoGenerateColumns="False" DataKeyNames="USER_NAME"
DataSourceID="odsSuperusers" CellPadding="4" ForeColor="#333333" GridLines="None"
AllowPaging="True" AllowSorting="True">
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnResetSU" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnResetSU_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="true" ToolTip='<%# traduci("Select") %>' ImageUrl="~/images/view_s.png" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="COGNOME" HeaderText="COGNOME" SortExpression="COGNOME" />
<asp:BoundField DataField="NOME" HeaderText="NOME" SortExpression="NOME" />
<asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
<asp:BoundField DataField="USER_NAME" HeaderText="USER_NAME" ReadOnly="True" SortExpression="USER_NAME" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="odsSuperusers" runat="server" SelectMethod="elencoDaDiritti"
TypeName="SteamWare.user_std">
<SelectParameters>
<asp:Parameter DefaultValue="GIM" Name="codModulo" Type="String" />
<asp:Parameter DefaultValue="GIM_SU" Name="codFunzione" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td colspan="3">
<asp:Label runat="server" ID="lblWarning" CssClass="erroreMid" Visible="false" />
</td>
</tr>
</table>
</div>
-101
View File
@@ -1,101 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_gestUtentiGIM : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
traduciObj();
}
private void traduciObj()
{
lblUsers.Text = traduci("ElencoUtentiStd");
lblSuperusers.Text = traduci("ElencoElUtentiSU");
btnPromuovi.Text = traduci("promuoviUtente");
btnDeclassa.Text = traduci("declassaUtente");
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnResetU_Click(object sender, EventArgs e)
{
resetSelezioneUser();
lblWarning.Visible = false;
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezioneUser()
{
grViewUsers.SelectedIndex = -1;
grViewUsers.DataBind();
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnResetSU_Click(object sender, EventArgs e)
{
resetSelezioneSuperUser();
lblWarning.Visible = false;
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezioneSuperUser()
{
grViewSuperusers.SelectedIndex = -1;
grViewSuperusers.DataBind();
}
protected void btnPromuovi_Click(object sender, EventArgs e)
{
if (grViewUsers.SelectedIndex != -1)
{
lblWarning.Visible = false;
user_std.UtSn.assegnaDirittoUtente(grViewUsers.SelectedValue.ToString(), memLayer.ML.confReadString("autoEnrollCdc"), "GIM", "GIM_SU");
}
else
{
lblWarning.Visible = true;
lblWarning.Text = traduci("utenteNonSelezionato");
}
resetSelezioneUser();
grViewUsers.DataBind();
resetSelezioneSuperUser();
grViewSuperusers.DataBind();
}
protected void btnDeclassa_Click(object sender, EventArgs e)
{
if (grViewSuperusers.SelectedIndex != -1)
{
lblWarning.Visible = false;
user_std.UtSn.rimuoviDirittoUtente(grViewSuperusers.SelectedValue.ToString(), memLayer.ML.confReadString("autoEnrollCdc"), "GIM", "GIM_SU");
}
else
{
lblWarning.Visible = true;
lblWarning.Text = traduci("utenteNonSelezionato");
}
resetSelezioneUser();
grViewUsers.DataBind();
resetSelezioneSuperUser();
grViewSuperusers.DataBind();
}
}
-185
View File
@@ -1,185 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_impianti.ascx.cs"
Inherits="mod_impianti" %>
<%@ Register Src="mod_selettore_ajax.ascx" TagName="mod_selettore_ajax" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
DataKeyNames="idxImpianto" DataSourceID="ods" OnRowDataBound="grView_RowDataBound"
OnRowUpdating="grView_RowUpdating">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</HeaderTemplate>
<ItemTemplate>
<div id="divLeft" style="text-align: left">
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>'
Visible='<%# isEditable(Eval("idxImpianto")) %>' />
</div>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgClona" runat="server" CausesValidation="False" ToolTip='<%# traduci("clonaRecord") %>'
ImageUrl='<%# imgPath(SteamWare.tipoImg.clona , SteamWare.dimImg.small) %>' CommandArgument="clonaObj"
CommandName="Update" OnClick="imgClona_Click" />
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert"
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
OnClick="lblIns_click" />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</FooterTemplate>
</asp:TemplateField>
<asp:BoundField DataField="idxImpianto" HeaderText="idxImpianto" Visible="false"
InsertVisible="False" ReadOnly="True" SortExpression="idxImpianto" />
<asp:TemplateField HeaderText="codImpianto" SortExpression="codImpianto">
<FooterTemplate>
<asp:TextBox ID="txtcodImpianto" runat="server" Text='<%# Bind("codImpianto") %>'
Width="8em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtcodImpianto" runat="server" Text='<%# Bind("codImpianto") %>'
Width="8em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("codImpianto") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="nomeImpianto" SortExpression="nomeImpianto">
<FooterTemplate>
<asp:TextBox ID="txtnomeImpianto" runat="server" Text='<%# Bind("nomeImpianto") %>'
Width="20em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtnomeImpianto" runat="server" Text='<%# Bind("nomeImpianto") %>'
Width="20em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("nomeImpianto") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="tipoImpianto" SortExpression="tipoImpianto">
<FooterTemplate>
<asp:TextBox ID="txttipoImpianto" runat="server" Text='<%# Bind("tipoImpianto") %>' />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txttipoImpianto" runat="server" Text='<%# Bind("tipoImpianto") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("tipoImpianto") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="funzDal" SortExpression="funzDal">
<FooterTemplate>
<asp:TextBox ID="cal_funzDal" runat="server" Text='<%# Bind("funzDal","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzDal" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="cal_funzDal" runat="server" Text='<%# Bind("funzDal","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzDal" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("funzDal","{0:d}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="funzAl" SortExpression="funzAl">
<FooterTemplate>
<asp:TextBox ID="cal_funzAl" runat="server" Text='<%# Bind("funzAl","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzAl" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="cal_funzAl" runat="server" Text='<%# Bind("funzAl","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzAl" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("funzAl","{0:d}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%# Eval("idxImpianto") %>' ToolTip='<%# traduci("Delete") %>'
Visible='<%# isDeletable(Eval("idxImpianto")) %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert"
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
OnClick="lblIns_click" />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" DeleteMethod="DeleteQuery" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagImpiantiTableAdapter"
OnInserting="recuperaFooter" FilterExpression=" codImpianto LIKE '%{0}%' OR nomeImpianto LIKE '%{0}%' OR tipoImpianto LIKE '%{0}%' "
UpdateMethod="Update" OnInserted="ods_Updated" OnUpdated="ods_Updated">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxImpianto" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="codImpianto" Type="String" />
<asp:Parameter Name="nomeImpianto" Type="String" />
<asp:Parameter Name="tipoImpianto" Type="String" />
<asp:Parameter Name="funzDal" Type="DateTime" />
<asp:Parameter Name="funzAl" Type="DateTime" />
<asp:Parameter Name="Original_idxImpianto" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="codImpianto" Type="String" />
<asp:Parameter Name="nomeImpianto" Type="String" />
<asp:Parameter Name="tipoImpianto" Type="String" />
<asp:Parameter Name="funzDal" Type="DateTime" />
<asp:Parameter Name="funzAl" Type="DateTime" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
-448
View File
@@ -1,448 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using System.Data;
public partial class mod_impianti : ApplicationUserControl
{
#region area da NON modificare
#region area protected
protected string _idxGridView;
protected string _idxGridViewExt;
protected bool _showNewBtn = false;
/// <summary>
/// imposta errore non cancellabilità per record correlati
/// </summary>
protected void setNoDeletableErrorMessage()
{
// mostro avviso di non cancellabilità...
lblWarning.Text = traduci("notDeletable_hasChild");
lblWarning.Visible = true;
grView.DataBind();
}
/// <summary>
/// esegue cancellazione record
/// </summary>
protected void doDelete()
{
// posso cancellare...
lblWarning.Visible = false;
ods.Delete();
}
/// <summary>
/// Valida la cancellazione per i dati mostrati dal gridView
/// richiede sia preventivamentedichiarato _idxGridView
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected virtual void validaDelete(object sender, ObjectDataSourceMethodEventArgs e)
{
int idx = Convert.ToInt32(e.InputParameters[string.Format("Original_{0}", _idxGridView)]);
if (objIsNotRelated(idx))
{
// annullo cancellazione...
e.Cancel = true;
// seleziono record... metto in session valore idx e poi ridisegno...
SteamWare.memLayer.ML.setSessionVal(_idxGridView, idx);
setNoDeletableErrorMessage();
}
else
{
doDelete();
}
}
/// <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)
{
//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("cal_{0}", nomeCol)) != null)
{
tipoColonna = "calTextBox";
}
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";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// 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 "calTextBox":
e.InputParameters[nomeCol] = Convert.ToDateTime(((TextBox)grView.FooterRow.FindControl(string.Format("cal_{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("dl{0}", nomeCol))).Checked;
break;
case "selAjax":
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
break;
default:
break;
}
tipoColonna = "";
}
}
/// <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>
/// aggiorna controlli datagrid e numero righe in pagina
/// </summary>
protected override void aggiornaControlliDataGL()
{
base.aggiornaControlliDataGL();
grView.PageSize = _righeDataGridMed;
}
/// <summary>
/// gestione evento richeista 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>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region public
/// <summary>
/// definisce visibilità btnNew
/// </summary>
public bool showNewBtn
{
get
{
return _showNewBtn;
}
set
{
_showNewBtn = value;
}
}
/// <summary>
/// effettua update del modulo
/// </summary>
public void doUpdate()
{
resetSelezione();
}
#endregion
#endregion
#region area codice variabile
/// <summary>
/// verifica complessiva non esistenza record child
/// </summary>
/// <param name="idxObj"></param>
/// <returns></returns>
protected bool objIsNotRelated(object idxObj)
{
bool answ = false;
try
{
answ = (TA_app.obj.taInterventiMtz.getByIdxImpianto(Convert.ToInt32(idxObj)).Rows.Count == 0);
}
catch
{ }
return answ;
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
DS_applicazione.AnagImpiantiDataTable tabella = new DS_applicazione.AnagImpiantiDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
/// <summary>
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "idxImpianto";
}
/// <summary>
/// setta selected alla riga il cui valore key è in session
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
{
// se riga di dati...
if (e.Row.RowType == DataControlRowType.DataRow)
{
// ottengo la riga tipizzata...
System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem;
DS_applicazione.AnagImpiantiRow riga = (DS_applicazione.AnagImpiantiRow)_drv.Row;
if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.idxImpianto.ToString())
{
grView.SelectedIndex = e.Row.RowIndex;
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView));
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// svuoto da cache...
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
string codImp = memLayer.ML.confReadString("defaultCodImp");
TA_app.obj.taImpianti.Insert(codImp, "-- [NUOVO] Nome Impianto non definito --", "tipo n.d.", DateTime.Today, DateTime.Today.AddYears(10));
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)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "clonaObj");
}
/// <summary>
/// in caso di aggiornamento verifico se sia salvato un comando clona...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
// carico l'idx dell'oggetto
int _idx = Convert.ToInt32(e.Keys["idxImpianto"]);
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
// verifico il tipo di richiesta (up/down level, clona o update normale
switch (_comando)
{
case "clonaObj":
TA_app.obj.taImpianti.sp_clonaImpianto(_idx);
grView.EditIndex = -1;
grView.DataBind();
// blocco update!
e.Cancel = true;
break;
default:
// faccio update!
break;
}
}
/// <summary>
/// determina se sia cancellabile dall'idx (1 e quelli con child NON LO SONO...)
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public bool isDeletable(object _idx)
{
bool answ = false;
int idx = -1;
try
{
idx = Convert.ToInt32(_idx);
}
catch
{ }
int numMacchineImpianto = TA_app.obj.taMacchine.getByIdxImpianto(idx).Rows.Count;
if (idx > 1 && numMacchineImpianto < 1) answ = true;
return answ;
}
/// <summary>
/// determina se sia editabile dall'idx (1 NON LO E'...)
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public bool isEditable(object _idx)
{
bool answ = false;
int idx = -1;
try
{
idx = Convert.ToInt32(_idx);
}
catch
{ }
if (idx > 1) answ = true;
return answ;
}
/// <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 = "";
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
}
#endregion
}
-164
View File
@@ -1,164 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_insertRichiesta.ascx.cs"
Inherits="mod_insertRichiesta" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_dataOra.ascx" TagName="mod_dataOra" TagPrefix="uc1" %>
<asp:Panel ID="pnlMain_InsRichiesta" runat="server" Visible="false">
<div style="width: 100%; background-color: #dedede; font-size: 8pt;">
<div style="width: 100%; background-color: #696969; text-align: center;">
<div style="font-size: 30px; font-weight: bold; color: White;">
<asp:Label runat="server" ID="lblTitolo" />
</div>
<div style="padding: 5px; text-align: center; width: 615px; color: Yellow;">
<div style="width: 200px; float: left;">
<asp:Label runat="server" ID="lblDataOra" /><br />
<asp:TextBox ReadOnly="true" runat="server" ID="txtDataOra" CssClass="fixedVal" />
</div>
<div style="width: 200px; float: left;">
<asp:Label runat="server" ID="lblDataLav" /><br />
<asp:TextBox ReadOnly="true" runat="server" ID="txtDataLav" CssClass="fixedVal" />
</div>
<div style="width: 200px; float: left;">
<asp:Label runat="server" ID="lblTurnoLav" /><br />
<asp:TextBox ReadOnly="true" runat="server" ID="txtTurnoLav" CssClass="fixedVal" />
</div>
</div>
</div>
<table>
<tr>
<td rowspan="2" valign="top">
<div id="reparto">
<asp:Label runat="server" ID="lblImpianto" /><br />
<asp:Panel runat="server" ID="pnlImpianti" ScrollBars="Vertical" Width="220px" Height="500px">
<asp:ListBox ID="listImpianti" runat="server" DataSourceID="odsImpianti" DataTextField="label"
DataValueField="value" AutoPostBack="true" OnSelectedIndexChanged="listImpianti_SelectedIndexChanged"
Height="600px" Width="204px" BackColor="#ddeeff" Font-Size="8pt"></asp:ListBox>
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getImpiantiValidi" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
</asp:Panel>
<asp:RequiredFieldValidator ID="rfvReparto" runat="server" ErrorMessage="!!!" ControlToValidate="listImpianti"
ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</td>
<td valign="top">
<div id="macchina">
<asp:Label runat="server" ID="lblMacchina" /><br />
<asp:Panel runat="server" ID="pnlMacchine" ScrollBars="Vertical" Width="300px" Height="284px">
<asp:ListBox ID="listMacchine" runat="server" AutoPostBack="True" DataSourceID="odsMacchine"
DataTextField="label" DataValueField="value" Height="400px" Width="284px" BackColor="#ddeeff"
Font-Size="8pt"></asp:ListBox>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listImpianti" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:Panel>
<asp:RequiredFieldValidator ID="rfvMacchina" runat="server" ErrorMessage="!!!" ControlToValidate="listMacchine"
ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</td>
<td valign="top">
<div id="insertDatiVari">
<asp:Panel runat="server" ID="Panel1" ScrollBars="None" Width="200px" Height="284px">
<asp:Label runat="server" ID="lblDettagliGuasto" /><br />
<br />
<div>
<div style="float: right; padding-left:15px;">
<asp:Label runat="server" ID="lblPrior" /><br />
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="label"
DataValueField="value" CssClass="textEv_1" />
<asp:ObjectDataSource ID="odsPrior" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selPriorTableAdapter">
</asp:ObjectDataSource>
</div>
<div style="float: right;">
<asp:Label runat="server" ID="lblMatr" /><br />
<asp:TextBox runat="server" ID="txtMatr" Width="3em" CssClass="textEv_1" />
<asp:RequiredFieldValidator ID="rfvMatr" runat="server" ErrorMessage="!!!" ControlToValidate="txtMatr"
ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</div>
<div style="clear: both; text-align: right;">
<asp:Label runat="server" ID="lblFermaDalleData" /><br />
<div style="text-align:right;">
<uc1:mod_dataOra ID="mod_dataOra1" runat="server" css="textEv_1" tipoOrario="tendina" />
</div>
</div>
<div style="clear:both; text-align:right;">
<asp:Label runat="server" ID="lblAmbito" /><br />
<asp:DropDownList runat="server" ID="ddlAmbito" CssClass="textEv_1" DataSourceID="odsAmbiti"
DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsAmbiti" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selAmbitiTableAdapter">
</asp:ObjectDataSource>
</div>
<div style="clear:both; text-align:right;">
<asp:Label runat="server" ID="lblTipoGuasto" /><br />
<asp:DropDownList runat="server" ID="ddlTipo" CssClass="textEv_1" DataSourceID="odsTipo"
DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsTipo" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selTipoGuastoTableAdapter">
</asp:ObjectDataSource>
</div>
<div>
<asp:CheckBox runat="server" ID="chkImpFermo"/>
</div>
<div>
<asp:ValidationSummary ID="valSummary" runat="server" ValidationGroup="inserimento" />
</div>
</asp:Panel>
</div>
</td>
<td rowspan="2" valign="top">
<div id="causali">
<asp:Panel runat="server" ID="pnlCausali" ScrollBars="Vertical" Width="300px" Height="500px">
<asp:ListBox ID="listCausali" runat="server" DataSourceID="odsCausali" DataTextField="label"
DataValueField="value" AutoPostBack="true" Height="600px" Width="284px" BackColor="#ddeeff"
Font-Size="8pt"></asp:ListBox>
<asp:ObjectDataSource ID="odsCausali" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selCausaliMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="listMacchine" DefaultValue="0" Name="conditio" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:Panel>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div id="descrizione">
<asp:Panel runat="server" ID="Panel2" ScrollBars="None" Width="520px" Height="200px">
<asp:Label runat="server" ID="lblDescrGuasto" /><br />
<asp:TextBox runat="server" ID="txtDescrizione" TextMode="MultiLine" Rows="10" Width="100%" />
<asp:RequiredFieldValidator ID="rfvDescrizione" runat="server" ErrorMessage="!!!"
ControlToValidate="txtDescrizione" ValidationGroup="inserimento" Display="Dynamic"></asp:RequiredFieldValidator>
</asp:Panel>
<asp:Button ID="btnSend" runat="server" Width="300px" Height="30px" OnClick="btnSend_Click"
CausesValidation="true" ValidationGroup="inserimento" />
</div>
</td>
</tr>
</table>
</div>
</asp:Panel>
<asp:Panel ID="pnlMain_ShowTicket" runat="server">
<div style="height: 400px; vertical-align: middle;">
<h2>
<asp:Label runat="server" ID="lblEsitoInserimento" />
</h2>
<div style="padding: 4px 8px 4px 8px; text-align: center; font-size: 14pt;">
<asp:Label runat="server" ID="lblNumRichInserted" />
<br />
<br />
<asp:LinkButton runat="server" ID="lnkbInsertNewReq" OnClick="lnkbtnInsertNewReq_Click" />
&nbsp;&nbsp;
<asp:HyperLink runat="server" ID="lnkGoToReqList" NavigateUrl="~/elencoRichieste.aspx" />
</div>
</div>
</asp:Panel>
-182
View File
@@ -1,182 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_insertRichiesta : System.Web.UI.UserControl
{
#region eventi
public event EventHandler eh_newReq;
public event EventHandler eh_done;
#endregion
protected bool _causVis = false;
/// <summary>
/// determina la visibilità del panel causali
/// </summary>
public bool causaliVisibili
{
get
{
return _causVis;
}
set
{
_causVis = value;
}
}
/// <summary>
/// avvio controllo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
traduciObj();
setFixedVal();
fixVisibPnl();
}
}
/// <summary>
/// imposta i valori calcolati e fissi...
/// </summary>
private void setFixedVal()
{
// recupero valori di riferimento
int shift = memLayer.ML.confReadInt("shiftTurno");
int durataTurno = memLayer.ML.confReadInt("durataTurno");
int turno = Convert.ToInt32(Math.Ceiling((double)Convert.ToDouble(DateTime.Now.AddHours(-shift + 1).Hour) / durataTurno));
int delay = memLayer.ML.confReadInt("defaultDelay");
// inserisco valori di default
txtDataOra.Text = string.Format("{0:dd/MM/yyyy HH:mm}", DateTime.Now);
txtDataLav.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Now.AddHours(-shift + 1));
txtTurnoLav.Text = turno.ToString();
mod_dataOra1.valore = DateTime.Now.AddMinutes(-delay);
chkImpFermo.Checked = false;
}
/// <summary>
/// sistema la visibilità dei controlli
/// </summary>
private void fixVisibPnl()
{
pnlCausali.Visible = _causVis;
}
/// <summary>
/// traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// sistema le labels
/// </summary>
private void traduciObj()
{
lblTitolo.Text = traduci("lblInsRichiestaMtz");
lblDataOra.Text = traduci("lblDataOraRich");
lblDataLav.Text = traduci("lblDataLav");
lblTurnoLav.Text = traduci("lblTurnoLav");
btnSend.Text = traduci("btnInviaRichiesta");
lblImpianto.Text = traduci("lblImpianto");
lblMacchina.Text = traduci("lblMacchina");
lblDescrGuasto.Text = traduci("lblDescrGuasto");
lblDettagliGuasto.Text = traduci("lblDettagliGuasto");
lblMatr.Text = traduci("lblMatr");
lblPrior.Text = traduci("lblPrior");
lblFermaDalleData.Text = traduci("lblFermaDalle");
lblAmbito.Text = traduci("lblAmbito");
lblTipoGuasto.Text = traduci("lblTipoGuasto");
chkImpFermo.Text = traduci("chkImpFermo");
// setup stringhe rimando link
lnkbInsertNewReq.Text = traduci("lnkbInsertNewReq");
lnkGoToReqList.Text = traduci("lnkGoToReqList");
lblEsitoInserimento.Text = traduci("lblEsitoInserimento");
// setup stringhe validazione
valSummary.HeaderText = traduci("errori");
rfvReparto.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("reparto"));
rfvMacchina.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("macchina"));
rfvMatr.ErrorMessage = string.Format("{0}: {1}", traduci("campoRichiesto"), traduci("matricola"));
}
/// <summary>
/// aggiorna elenco macchine selezionato impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listImpianti_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiorno altro selettore...
listMacchine.DataBind();
}
/// <summary>
/// salva ed invia richeista
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSend_Click(object sender, EventArgs e)
{
// salvare valori...
int? numReq = 0;
try
{
// sistemo i valori
DateTime richiesta = Convert.ToDateTime(txtDataOra.Text.Trim());
DateTime dataLav = Convert.ToDateTime(txtDataLav.Text.Trim());
int turno = Convert.ToInt32(txtTurnoLav.Text);
string matr = txtMatr.Text.Trim();
DateTime inizioGuasto = mod_dataOra1.valore;
int idxAmbito = Convert.ToInt32(ddlAmbito.SelectedValue);
int idxPrior = Convert.ToInt32(ddlPrior.SelectedValue);
bool isFermo = chkImpFermo.Checked;
int idxTipo = Convert.ToInt32(ddlTipo.SelectedValue);
int idxImpianto = Convert.ToInt32(listImpianti.SelectedValue);
int idxMacchina = Convert.ToInt32(listMacchine.SelectedValue);
string descrizione = txtDescrizione.Text.Trim();
int idxCausale = 1;
// cerco se ci sia un altro valore selezionato...
try
{
idxCausale = Convert.ToInt32(listCausali.SelectedValue);
}
catch
{ }
// stored inserimento!
TA_app.obj.taInterventiMtz.sp_insRichiesta(richiesta, dataLav, turno, matr, inizioGuasto, idxAmbito, idxPrior, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxCausale, ref numReq);
}
catch (Exception exc)
{
logger.lg.scriviLog("Errore inserimento nuova richiesta!", tipoLog.ERROR);
logger.lg.scriviLog(exc.ToString(), tipoLog.EXCEPTION);
}
//poi mostrare pnl richiesta con "ticket" generato + link x vedere elenco oppure nuova...
pnlMain_InsRichiesta.Visible = false;
pnlMain_ShowTicket.Visible = true;
lblNumRichInserted.Text = string.Format("{0} <b>{1}</b>", traduci("newReqInserted"), (int)numReq);
if (eh_done != null)
{
eh_done(this, new EventArgs());
}
}
/// <summary>
/// inverte visibilità pannelli
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkbtnInsertNewReq_Click(object sender, EventArgs e)
{
pnlMain_InsRichiesta.Visible = true;
pnlMain_ShowTicket.Visible = false;
if (eh_newReq != null)
{
eh_newReq(this, new EventArgs());
}
}
}
-112
View File
@@ -1,112 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_interventoOpMtz.ascx.cs"
Inherits="mod_interventoOpMtz" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="numIntMtz,matrOp" DataSourceID="ods" OnDataBound="grView_DataBound"
OnRowEditing="grView_RowEditing">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>'
Visible='<%# isOnEdit %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>'
Visible='<%# isOnEdit %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="numIntMtz" HeaderText="numIntMtz" InsertVisible="False"
Visible="false" ReadOnly="True" SortExpression="numIntMtz" />
<asp:TemplateField HeaderText="matrOp" SortExpression="matrOp">
<EditItemTemplate>
<asp:DropDownList ID="listOp" runat="server" DataSourceID="odsOpMtz" DataTextField="label"
DataValueField="value" AutoPostBack="true" SelectedValue='<%# Bind("matrOp") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsOpMtz" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="getData" TypeName="DS_utilityTableAdapters.v_selOperMtzTableAdapter">
</asp:ObjectDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbl_matrOp" runat="server" Text='<%# traduciMatrOp(Eval("matrOp")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="durataMinuti" SortExpression="durataMinuti">
<EditItemTemplate>
<asp:TextBox ID="txt_durataMinuti" runat="server" Width="5em" Text='<%# Bind("durataMinuti") %>'></asp:TextBox>
<cc1:FilteredTextBoxExtender ID="ftbe_minuti" TargetControlID="txt_durataMinuti"
runat="server" FilterType="Numbers">
</cc1:FilteredTextBoxExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lbl_durataMinuti" runat="server" Text='<%# Eval("durataMinuti") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>'
Visible='<%# canInsertNew() %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
Visible='<%# isOnEdit %>' ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getByNumIntMtz" TypeName="DS_applicazioneTableAdapters.InterventoOpMtzTableAdapter"
UpdateMethod="UpdateQuery" DeleteMethod="Delete" OldValuesParameterFormatString="Original_{0}"
InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="matrOp" Type="String" />
<asp:Parameter Name="durataMinuti" Type="Int32" />
<asp:Parameter Name="Original_numIntMtz" Type="Int32" />
<asp:Parameter Name="Original_matrOp" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Original_numIntMtz" Type="Int32" />
<asp:Parameter Name="Original_matrOp" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="numIntMtz" SessionField="numIntMtz_sel"
Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="numIntMtz" Type="Int32" />
<asp:Parameter Name="matrOp" Type="String" />
<asp:Parameter Name="durataMinuti" Type="Int32" />
</InsertParameters>
</asp:ObjectDataSource>
-128
View File
@@ -1,128 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_interventoOpMtz : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
int numIntMtz = memLayer.ML.IntSessionObj("numIntMtz_sel");
string matr = memLayer.ML.confReadString("defaultMatr");
TA_app.obj.taIntOpMtz.Insert(numIntMtz, matr, 0);
grView.DataBind();
}
/// <summary>
/// restituisce un booleano se sia abilitato inserimento nuovi valori (solo se NON C'E' GIA' un operatore con amtricola di default...)
/// </summary>
/// <returns></returns>
public bool canInsertNew()
{
bool answ = false;
int numIntMtz = memLayer.ML.IntSessionObj("numIntMtz_sel");
string matr = memLayer.ML.confReadString("defaultMatr");
try
{
answ = (TA_app.obj.taIntOpMtz.getByMatrNumIntMtz(numIntMtz, matr).Rows.Count == 0);
}
catch
{ }
return (answ && isOnEdit);
}
/// <summary>
/// restituisce true se il controllo è in modalità editing (e non selezione...)
/// </summary>
public bool isOnEdit
{
get
{
return _vistaModulo == tipoVistaMod.editing;
}
}
/// <summary>
/// traduce matricola in matr + cognome + nome
/// </summary>
/// <param name="matr"></param>
/// <returns></returns>
public string traduciMatrOp(object matr)
{
string answ = "";
try
{
answ = TA_app.obj.taSelMatrOp.getByValue(matr.ToString())[0].label;
}
catch
{ }
return answ;
}
}
-53
View File
@@ -1,53 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_lemmiVocab.ascx.cs"
Inherits="mod_lemmiVocab" %>
<table class="contrDx">
<tr>
<td>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="Lingua,Lemma" DataSourceID="ods" OnDataBound="grView_DataBound" >
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<Columns>
<asp:TemplateField HeaderText="Lingua" SortExpression="Lingua">
<EditItemTemplate>
<asp:Label ID="TextBox0" runat="server" Text='<%# Eval("Lingua") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Lingua") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lemma" SortExpression="Lemma" Visible="false">
<EditItemTemplate>
<asp:Label ID="TextBox2" runat="server" Text='<%# Eval("Lemma") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Lemma") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Traduzione" SortExpression="Traduzione">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Traduzione") %>' Width="500px"
TextMode="MultiLine"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Traduzione") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" ></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getVocabolario" TypeName="selData"
OldValuesParameterFormatString="Original_{0}" FilterExpression="Lemma LIKE '%{0}%'">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="lemma_sel" />
</FilterParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
-57
View File
@@ -1,57 +0,0 @@
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_lemmiVocab : ApplicationUserControl
{
#region protected
protected override void aggiornaControlliDataGL()
{
base.aggiornaControlliDataGL();
grView.PageSize = _righeDataGridAnagr;
}
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 = "";
}
}
/// <summary>
/// aggiorna i dati mostrati
/// </summary>
public void doUpdate()
{
ods.DataBind();
grView.DataBind();
}
#endregion
}
-54
View File
@@ -1,54 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_login.ascx.cs" Inherits="mod_login" %>
<asp:Panel ID="pnlForceUser" runat="server">
<table width="100%">
<tr>
<td colspan="2" class="chPwdTitle">
<asp:Label runat="server" ID="lblTitolo"></asp:Label>
</td>
</tr>
</table>
<table class="smallTable">
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd"></asp:Label>
</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"></asp:Label>
</td>
<td>
<asp:TextBox runat="server" ID="dominio" Width="210px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser"></asp:Label>
</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"></asp:Label>
</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>
-242
View File
@@ -1,242 +0,0 @@
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 = "User not authenticated...";
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 == "forzaInter") // 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
}
-366
View File
@@ -1,366 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_macchine.ascx.cs"
Inherits="mod_macchine" %>
<%@ Register Src="mod_selettore_ajax.ascx" TagName="mod_selettore_ajax" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc2" %>
<uc2:mod_filtro ID="mod_filtroImpianti" runat="server" css="txtMini" changeCheckEnabled="true" />
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter">
</asp:ObjectDataSource>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
DataKeyNames="idxMacchina" DataSourceID="ods" OnRowDataBound="grView_RowDataBound"
OnRowUpdating="grView_RowUpdating">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>'
Visible='<%# isVisible("Delete") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="false" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgClona" runat="server" CausesValidation="False" ToolTip='<%# traduci("clonaRecord") %>'
ImageUrl='<%# imgPath(SteamWare.tipoImg.clona , SteamWare.dimImg.small) %>' CommandArgument="clonaObj"
CommandName="Update" OnClick="imgClona_Click" />
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert"
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
OnClick="lblIns_click" />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</FooterTemplate>
</asp:TemplateField>
<asp:BoundField DataField="idxMacchina" HeaderText="idxMacchina" Visible="false"
InsertVisible="False" ReadOnly="True" SortExpression="idxMacchina" />
<asp:TemplateField HeaderText="codMacchina" SortExpression="codMacchina">
<FooterTemplate>
<asp:TextBox ID="txtcodMacchina" runat="server" Text='<%# Bind("codMacchina") %>'
Width="6em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtcodMacchina" runat="server" Text='<%# Bind("codMacchina") %>'
Width="6em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("codMacchina") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="nomeMacchina" SortExpression="nomeMacchina">
<FooterTemplate>
<asp:TextBox ID="txtnomeMacchina" runat="server" Text='<%# Bind("nomeMacchina") %>'
Width="20em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtnomeMacchina" runat="server" Text='<%# Bind("nomeMacchina") %>'
Width="20em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("nomeMacchina") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="modello" SortExpression="modello">
<FooterTemplate>
<asp:TextBox ID="txtmodello" runat="server" Text='<%# Bind("modello") %>' Width="8em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmodello" runat="server" Text='<%# Bind("modello") %>' Width="8em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("modello") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="matricola" SortExpression="matricola">
<FooterTemplate>
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("matricola") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="anno" SortExpression="anno">
<FooterTemplate>
<asp:TextBox ID="txtanno" runat="server" Text='<%# Bind("anno") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("anno") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("anno") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="kgPeso" SortExpression="kgPeso">
<FooterTemplate>
<asp:TextBox ID="txtkgPeso" runat="server" Text='<%# Bind("kgPeso") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("kgPeso") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Bind("kgPeso") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="kwConsumo" SortExpression="kwConsumo">
<FooterTemplate>
<asp:TextBox ID="txtkwConsumo" runat="server" Text='<%# Bind("kwConsumo") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("kwConsumo") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%# Bind("kwConsumo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="funzDal" SortExpression="funzDal">
<FooterTemplate>
<asp:TextBox ID="cal_funzDal" runat="server" Text='<%# Bind("funzDal","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzDal" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="cal_funzDal" runat="server" Text='<%# Bind("funzDal","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzDal" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("funzDal","{0:d}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="funzAl" SortExpression="funzAl">
<FooterTemplate>
<asp:TextBox ID="cal_funzAl" runat="server" Text='<%# Bind("funzAl","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzAl" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="cal_funzAl" runat="server" Text='<%# Bind("funzAl","{0:d}") %>'
Width="6em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="cal_funzAl" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("funzAl","{0:d}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="idxImpianto" SortExpression="idxImpianto">
<FooterTemplate>
<uc1:mod_selettore_ajax ID="selAjax_idxImpianto" runat="server" valore='<%# Bind("idxImpianto") %>'
tipo="impianti" isValueVisible="false" vistaModulo="editing" />
</FooterTemplate>
<EditItemTemplate>
<uc1:mod_selettore_ajax ID="selAjax_idxImpianto" runat="server" valore='<%# Bind("idxImpianto") %>'
tipo="impianti" isValueVisible="false" vistaModulo="editing" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("descrImpianto") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>'
Visible='<%# isVisible("Delete") %>' />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%# Eval("idxMacchina") %>' ToolTip='<%# traduci("Delete") %>'
Visible='<%# isDelEnabled("Delete",Eval("idxMacchina")) %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert"
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
OnClick="lblIns_click" />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:GridView ID="grViewShort" Visible="false" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged"
OnDataBound="grViewShort_DataBound" DataKeyNames="idxMacchina" DataSourceID="ods"
OnRowDataBound="grView_RowDataBound" OnRowUpdating="grView_RowUpdating">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>'
Visible='<%# isVisible("Delete") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnResetShort" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnResetShort_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<%--&nbsp;
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />--%>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgClona" runat="server" CausesValidation="False" ToolTip='<%# traduci("clonaRecord") %>'
ImageUrl='<%# imgPath(SteamWare.tipoImg.clona , SteamWare.dimImg.small) %>' CommandArgument="clonaObj"
CommandName="Update" OnClick="imgClona_Click" />
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert"
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
OnClick="lblIns_click" />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
</FooterTemplate>
</asp:TemplateField>
<asp:BoundField DataField="idxMacchina" HeaderText="idxMacchina" Visible="false"
InsertVisible="False" ReadOnly="True" SortExpression="idxMacchina" />
<asp:TemplateField HeaderText="codMacchina" SortExpression="codMacchina">
<FooterTemplate>
<asp:TextBox ID="txtcodMacchina" runat="server" Text='<%# Bind("codMacchina") %>'
Width="6em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtcodMacchina" runat="server" Text='<%# Bind("codMacchina") %>'
Width="6em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("codMacchina") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="nomeMacchina" SortExpression="nomeMacchina">
<FooterTemplate>
<asp:TextBox ID="txtnomeMacchina" runat="server" Text='<%# Bind("nomeMacchina") %>'
Width="20em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtnomeMacchina" runat="server" Text='<%# Bind("nomeMacchina") %>'
Width="20em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("nomeMacchina") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="modello" SortExpression="modello">
<FooterTemplate>
<asp:TextBox ID="txtmodello" runat="server" Text='<%# Bind("modello") %>' Width="8em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmodello" runat="server" Text='<%# Bind("modello") %>' Width="8em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("modello") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="matricola" SortExpression="matricola">
<FooterTemplate>
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmatricola" runat="server" Text='<%# Bind("matricola") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("matricola") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="anno" SortExpression="anno">
<FooterTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("anno") %>' Width="4em" />
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("anno") %>' Width="4em" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("anno") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblImpianto" runat="server" Visible="false" Text="0" />
<asp:ObjectDataSource ID="ods" runat="server" DeleteMethod="DeleteQuery" InsertMethod="Insert"
OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.v_macchineTableAdapter"
OnInserting="recuperaFooter" FilterExpression=" codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR modello LIKE '%{0}%' OR matricola LIKE '%{0}%' OR descrImpianto LIKE '%{0}%' "
UpdateMethod="Update" OnInserted="ods_Updated" OnUpdated="ods_Updated">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
<asp:ControlParameter DefaultValue="*" ControlID="lblImpianto" Name="idxImpianto"
Type="Int32" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxMacchina" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="idxImpianto" Type="Int32" />
<asp:Parameter Name="codMacchina" Type="String" />
<asp:Parameter Name="nomeMacchina" Type="String" />
<asp:Parameter Name="modello" Type="String" />
<asp:Parameter Name="matricola" Type="String" />
<asp:Parameter Name="anno" Type="Int32" />
<asp:Parameter Name="kgPeso" Type="Double" />
<asp:Parameter Name="kwConsumo" Type="Double" />
<asp:Parameter Name="funzDal" Type="DateTime" />
<asp:Parameter Name="funzAl" Type="DateTime" />
<asp:Parameter Name="Original_idxMacchina" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="idxImpianto" Type="Int32" />
<asp:Parameter Name="codMacchina" Type="String" />
<asp:Parameter Name="nomeMacchina" Type="String" />
<asp:Parameter Name="modello" Type="String" />
<asp:Parameter Name="matricola" Type="String" />
<asp:Parameter Name="anno" Type="Int32" />
<asp:Parameter Name="kgPeso" Type="Double" />
<asp:Parameter Name="kwConsumo" Type="Double" />
<asp:Parameter Name="funzDal" Type="DateTime" />
<asp:Parameter Name="funzAl" Type="DateTime" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
-584
View File
@@ -1,584 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using System.Data;
public partial class mod_macchine : ApplicationUserControl
{
#region area da NON modificare
#region area protected
protected string _idxGridView;
protected string _idxGridViewExt;
protected bool _showNewBtn = false;
/// <summary>
/// imposta errore non cancellabilità per record correlati
/// </summary>
protected void setNoDeletableErrorMessage()
{
// mostro avviso di non cancellabilità...
lblWarning.Text = traduci("notDeletable_hasChild");
lblWarning.Visible = true;
grView.DataBind();
}
/// <summary>
/// esegue cancellazione record
/// </summary>
protected void doDelete()
{
// posso cancellare...
lblWarning.Visible = false;
ods.Delete();
}
/// <summary>
/// Valida la cancellazione per i dati mostrati dal gridView
/// richiede sia preventivamentedichiarato _idxGridView
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected virtual void validaDelete(object sender, ObjectDataSourceMethodEventArgs e)
{
int idx = Convert.ToInt32(e.InputParameters[string.Format("Original_{0}", _idxGridView)]);
if (objIsNotRelated(idx))
{
// annullo cancellazione...
e.Cancel = true;
// seleziono record... metto in session valore idx e poi ridisegno...
SteamWare.memLayer.ML.setSessionVal(_idxGridView, idx);
setNoDeletableErrorMessage();
}
else
{
doDelete();
}
}
/// <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)
{
//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("cal_{0}", nomeCol)) != null)
{
tipoColonna = "calTextBox";
}
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";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// 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 "calTextBox":
e.InputParameters[nomeCol] = Convert.ToDateTime(((TextBox)grView.FooterRow.FindControl(string.Format("cal_{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("dl{0}", nomeCol))).Checked;
break;
case "selAjax":
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
break;
default:
break;
}
tipoColonna = "";
}
}
/// <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>
/// aggiorna controlli datagrid e numero righe in pagina
/// </summary>
protected override void aggiornaControlliDataGL()
{
base.aggiornaControlliDataGL();
grViewShort.PageSize = _righeDataGridAnagr;
grView.PageSize = _righeDataGridMed;
}
/// <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 = "";
}
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewShort_DataBound(object sender, EventArgs e)
{
if (grViewShort.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grViewShort.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grViewShort.Rows.Count + grViewShort.PageSize * (grViewShort.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grViewShort.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// gestione evento richeista 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>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnResetShort_Click(object sender, EventArgs e)
{
grViewShort.SelectedIndex = -1;
grViewShort.DataBind();
lblWarning.Visible = false;
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region public
/// <summary>
/// definisce visibilità btnNew
/// </summary>
public bool showNewBtn
{
get
{
return _showNewBtn;
}
set
{
_showNewBtn = value;
}
}
#endregion
#endregion
#region area codice variabile
/// <summary>
/// devo mostrare meno colonne
/// </summary>
protected bool _dispLessCol = false;
/// <summary>
/// effettua update del modulo
/// </summary>
public void doUpdate()
{
resetSelezione();
updateOdsDaFiltro();
grView.SelectedIndex = -1;
grView.DataBind();
grViewShort.SelectedIndex = -1;
grViewShort.DataBind();
}
/// <summary>
/// verifica complessiva non esistenza record child
/// </summary>
/// <param name="idxObj"></param>
/// <returns></returns>
protected bool objIsNotRelated(object idxObj)
{
bool answ = false;
try
{
answ = (TA_app.obj.taInterventiMtz.getByIdxMacchina(Convert.ToInt32(idxObj)).Rows.Count == 0);
}
catch
{ }
return answ;
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
DS_applicazione.v_macchineDataTable tabella = new DS_applicazione.v_macchineDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
/// <summary>
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
mod_filtroImpianti.eh_selValore += new EventHandler(mod_filtroImpianti_eh_selValore);
if (!Page.IsPostBack)
{
mod_filtroImpianti.ods = odsImpianti;
}
_idxGridView = "idxmacchina";
// determino quale grView a seconda del tipo visibilità colonne...
if (_dispLessCol)
{
grView.Visible = false;
grViewShort.Visible = true;
}
else
{
grView.Visible = true;
grViewShort.Visible = false;
}
updateOdsDaFiltro();
}
/// <summary>
/// aggiorna visualizzazioni varie
/// </summary>
private void aggiornaAll()
{
// imposto visibilità filtro in base a tipo controllo
if (vistaModulo == tipoVistaMod.selezione)
{
mod_filtroImpianti.Visible = false;
}
else
{
mod_filtroImpianti.Visible = true;
}
}
void mod_filtroImpianti_eh_selValore(object sender, EventArgs e)
{
if (mod_filtroImpianti.valoreInt != 0)
{
// salvo il valore selezionato...
idxImpiantoSel = mod_filtroImpianti.valoreInt;
}
doUpdate();
}
/// <summary>
/// verifica e sistema il filtro dell'ods...
/// </summary>
private void updateOdsDaFiltro()
{
string filterExpr = " (codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR modello LIKE '%{0}%' OR matricola LIKE '%{0}%' OR descrImpianto LIKE '%{0}%') ";
if (vistaModulo == tipoVistaMod.selezione || (mod_filtroImpianti.Visible && mod_filtroImpianti.valore != "*"))
{
filterExpr += " AND idxImpianto = {1} ";
}
ods.FilterExpression = filterExpr;
}
/// <summary>
/// setta selected alla riga il cui valore key è in session
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowDataBound(object sender, GridViewRowEventArgs e)
{
// se riga di dati...
if (e.Row.RowType == DataControlRowType.DataRow)
{
// ottengo la riga tipizzata...
System.Data.DataRowView _drv = (System.Data.DataRowView)e.Row.DataItem;
DS_applicazione.v_macchineRow riga = (DS_applicazione.v_macchineRow)_drv.Row;
if (SteamWare.memLayer.ML.StringSessionObj(_idxGridView) == riga.idxImpianto.ToString())
{
grView.SelectedIndex = e.Row.RowIndex;
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), SteamWare.memLayer.ML.StringSessionObj(_idxGridView));
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// svuoto da cache...
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
string codMacc = memLayer.ML.confReadString("defaultCodMacc");
TA_app.obj.taMacchine.Insert(1, codMacc, "-- [NUOVA] Nome Macchina non definito --", "modello n.d.", "", DateTime.Now.Year, 0, 0, DateTime.Today, DateTime.Today.AddYears(10));
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)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", "clonaObj");
}
/// <summary>
/// in caso di aggiornamento verifico se sia salvato un comando clona...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
// carico l'idx dell'oggetto
int _idx = Convert.ToInt32(e.Keys["idxMacchina"]);
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
// verifico il tipo di richiesta (up/down level, clona o update normale
switch (_comando)
{
case "clonaObj":
TA_app.obj.taMacchine.sp_clonaMacchina(_idx);
grView.EditIndex = -1;
grView.DataBind();
// blocco update!
e.Cancel = true;
break;
default:
// faccio update!
break;
}
}
/// <summary>
/// determina se sia abilitata la cancellazione della macchina
/// </summary>
public bool isDelEnabled(object cosa, object idx)
{
bool answ = false;
// controllo se ci siano record correlati...
if (objIsNotRelated(idx))
{
answ = isVisible(cosa);
}
else
{
answ = false;
}
return answ;
}
/// <summary>
/// indica il valore dell'impianto filtrato in visualizzazione
/// </summary>
public int idxImpiantoSel
{
get
{
return Convert.ToInt32(lblImpianto.Text);
}
set
{
lblImpianto.Text = value.ToString();
aggiornaAll();
}
}
/// <summary>
/// definisce se mostrare meno colonne (per funzione MOVE delle macchine tra diversi impianti)
/// </summary>
public bool dispLessCol
{
get
{
return _dispLessCol;
}
set
{
_dispLessCol = value;
}
}
/// <summary>
/// definisce se mostrare o meno una colonna...
/// </summary>
public bool mostraColonna
{
get
{
return !_dispLessCol;
}
}
/// <summary>
/// restituisce idx della macchina selezionata nel grVIew versione "short"
/// </summary>
public int idxMacchinaSel
{
get
{
int answ = -1;
try
{
answ = Convert.ToInt32(grViewShort.SelectedValue);
}
catch
{ }
return answ;
}
}
#endregion
}
-15
View File
@@ -1,15 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_main_help.ascx.cs" Inherits="mod_main_help" %>
<table id="Table7" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td class="UnauthAppTitle"><asp:Label id="lblAppl" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label id="lblTitle" CssClass="UnauthTitle" runat="server"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label id="lblMess" CssClass="UnauthMess" runat="server"></asp:Label></td>
</tr>
</table>
-52
View File
@@ -1,52 +0,0 @@
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_main_help : ApplicationUserControl
{
#region inizializzazione generica & utility
protected string defaultApp;
protected string defaultTitle;
protected string defaultBody;
protected override void traduciObj()
{
defaultApp = SteamWare.memLayer.ML.confReadString("defaultApp");
defaultTitle = SteamWare.memLayer.ML.confReadString("defaultTitle");
defaultBody = SteamWare.memLayer.ML.confReadString("defaultBody");
lblAppl.Text = user_std.UtSn.Traduci(defaultApp);
lblTitle.Text = user_std.UtSn.Traduci(defaultTitle);
lblMess.Text = user_std.UtSn.Traduci(defaultBody);
}
#endregion
#region public
/// <summary>
/// imposta app, title e body del generico messaggio mostrato dal modulo
/// NB: vanno passate le stringhe da tradurre!!!
/// </summary>
/// <param name="app"></param>
/// <param name="titolo"></param>
/// <param name="body"></param>
public void setupMessaggio(string app2transl, string titolo2transl, string body2transl)
{
defaultApp = app2transl;
defaultTitle = titolo2transl;
defaultBody = body2transl;
}
#endregion
}
-4
View File
@@ -1,4 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuBottom.ascx.cs"
Inherits="mod_menuBottom" %>
<asp:Label runat="server" ID="lblApp" Text="."></asp:Label><asp:Label ID="lblrev" runat="server">142 - </asp:Label>
<asp:Label runat="server" ID="lblCopyRight" Text="..."></asp:Label>
-20
View File
@@ -1,20 +0,0 @@
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;
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}.", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"));
lblCopyRight.Text = string.Format("<b>{0}</b>",ConfigurationManager.AppSettings.Get("copyRight"));
}
}
-4
View File
@@ -1,4 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuBottom.ascx.cs"
Inherits="mod_menuBottom" %>
<asp:Label runat="server" ID="lblApp" Text="."></asp:Label><asp:Label ID="lblrev" runat="server">$WCREV$ - </asp:Label>
<asp:Label runat="server" ID="lblCopyRight" Text="..."></asp:Label>
@@ -1,4 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuBottomPortable.ascx.cs" Inherits="mod_menuBottomMini" %>
<asp:Label runat="server" ID="lblCopyRight" Text="..." CssClass="txtCopyright"></asp:Label><br />
<asp:Label runat="server" ID="lbl1" Text="for EnergyService" CssClass="txtFooter"></asp:Label>
@@ -1,18 +0,0 @@
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;
public partial class mod_menuBottomMini : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblCopyRight.Text = string.Format("{0}", ConfigurationManager.AppSettings.Get("copyRight"));
}
}
-16
View File
@@ -1,16 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuSx.ascx.cs" Inherits="mod_menuSx" %>
<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>
-43
View File
@@ -1,43 +0,0 @@
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
{
protected override void aggiornaControlliDataGL()
{
// se l'utente c'è...
if (user_std.UtSn.isAuth && !Page.IsPostBack)
{
updateTreeMenu();
}
}
/// <summary>
/// aggiornamento del menù
/// </summary>
private void updateTreeMenu()
{
XmlDataSource1.Data = user_std.UtSn.mappaSito;
//user_std.UtSn.ricaricaMappaSito();
//XmlDataSource1.Data = user_std.UtSn.mappaSitoLive;
XmlDataSource1.XPath = "mainMenu/menu";
XmlDataSource1.DataBind();
}
/// <summary>
/// forza l'update del menù sx
/// </summary>
public void forzaUpdateMenu()
{
user_std.UtSn.ricaricaMappaSito();
updateTreeMenu();
}
}
-35
View File
@@ -1,35 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_menuTop.ascx.cs" Inherits="mod_menuTop" %>
<asp:Timer ID="Timer1" runat="server" Interval="10000" OnTick="Timer1_Tick">
</asp:Timer>
<table id="table1" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="bottom" style="width: 100%;">
<table id="table2" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr class="topTitle">
<td style="width: 25%; text-align: left;">
<asp:LinkButton ID="btnLogOut" runat="server" CssClass="dxButtonClass" Visible="False"
OnClick="btnLogOut_Click"></asp:LinkButton>
</td>
<td>
<asp:Label ID="lblTitle" runat="server"></asp:Label>
</td>
<td style="width: 25%; text-align: right;">
<asp:Label ID="lblDateTime" runat="server" CssClass="smallTimeClock" />
<asp:LinkButton ID="btnUpdate" runat="server" CssClass="dxButtonClass" OnClick="btnUpdate_Click"></asp:LinkButton>
</td>
</tr>
<tr class="barraTitolo">
<td>
<asp:LinkButton CssClass="dxButtonClass" ID="lnkShowHide" runat="server" OnClick="lnkShowHide_Click">Show/Hide Menu</asp:LinkButton></td>
<td align="center">
<asp:Label ID="lblMessUtente" CssClass="topMenuMess" runat="server"></asp:Label>
<asp:Label ID="lblMessUtenteEn" CssClass="topMenuMessEn" runat="server"></asp:Label>
</td>
<td align="right">
<asp:LinkButton ID="lblUser" runat="server" CssClass="userClass" OnClick="lblUser_Click" />
</td>
</tr>
</table>
</td>
</tr>
</table>
-151
View File
@@ -1,151 +0,0 @@
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)
{
// solo se user è auth...
if (user_std.UtSn.isAuth)
{
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!
lblMessUtenteEn.Text = "(" + user_std.UtSn.TraduciEn(_titleString) + ")";
_titleString = "";
Session["_titleString"] = _titleString;
Session["SessionUpdateMenu"] = true;
}
else
{
lblMessUtente.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("welcomeApp"));
lblMessUtenteEn.Text = "";
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");
}
}
-41
View File
@@ -1,41 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_mtzPrevPending.ascx.cs"
Inherits="mod_mtzPrevPending" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<div style="text-align: right;">
<asp:HyperLink ID="hlExportExcel" runat="server" Target="_blank" />
</div>
<div>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxPending" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="data" HeaderText="data" SortExpression="data" DataFormatString="{0:dd/MM/yyyy}"
HtmlEncode="false" />
<asp:BoundField DataField="codImpianto" HeaderText="codImpianto" SortExpression="codImpianto" />
<asp:BoundField DataField="nomeImpianto" HeaderText="nomeImpianto" SortExpression="nomeImpianto" />
<asp:BoundField DataField="codMacchina" HeaderText="codMacchina" SortExpression="codMacchina" />
<asp:BoundField DataField="nomeMacchina" HeaderText="nomeMacchina" SortExpression="nomeMacchina" />
<asp:BoundField DataField="descrizione" HeaderText="descrizione" SortExpression="descrizione" />
<asp:BoundField DataField="descrPriorita" HeaderText="descrPriorita" SortExpression="descrPriorita" />
<asp:CheckBoxField DataField="isFermo" HeaderText="chkImpFermo" SortExpression="isFermo" />
<asp:BoundField DataField="descrTipo" HeaderText="descrTipo" SortExpression="descrTipo" />
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_mtzProgPendingExpTableAdapter"
OldValuesParameterFormatString="original_{0}" FilterExpression=" (codImpianto LIKE '%{0}%') OR (nomeImpianto LIKE '%{0}%') OR (codMacchina LIKE '%{0}%') OR (nomeMacchina LIKE '%{0}%') OR (descrizione LIKE '%{0}%') OR (descrPriorita LIKE '%{0}%') OR (descrTipo LIKE '%{0}%') ">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
@@ -1,59 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_mtzPrevPending : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!Page.IsPostBack)
{
hlExportExcel.Text = traduci("hlExportExcel");
hlExportExcel.NavigateUrl = "./ExcelExportMtzPrevPending.aspx";
// vedo di rigenerare la coda...
// verifico se devo generare degli interventi di MTZ programmata..
try
{
mtzProgr.obj.processaCodaMtzPro();
}
catch (Exception errore)
{
SteamWare.logger.lg.scriviLog(string.Format("Non sono riuscito ad accodare gli interventi di mtz preventiva pending, errore:\r\n {0}", errore), SteamWare.tipoLog.EXCEPTION);
}
}
}
}
@@ -1,25 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_pageTitleAndSearch.ascx.cs"
Inherits="mod_pageTitleAndSearch" %>
<div class="topContrSx">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Label ID="lblTitolo" runat="server"></asp:Label>
</td>
<td>
&nbsp;
</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>
@@ -1,28 +0,0 @@
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_pageTitleAndSearch : ApplicationUserControl
{
#region area protected
protected string _titolo;
protected override void traduciObj()
{
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", _paginaCorrente))[0];
_titolo = riga.NOME;
lblTitolo.Text = traduci(_titolo);
}
#endregion
}
-35
View File
@@ -1,35 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_periodoAnalisi.ascx.cs"
Inherits="mod_periodoAnalisi" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<div>
<div style="float: left; padding-right:4px;">
<asp:Label ID="lblPeriodo" runat="server"></asp:Label>
</div>
<div style="float: left; padding-right:4px;">
<asp:TextBox ID="txtInizio" TabIndex="1" runat="server" Width="6em" MaxLength="10"
AutoPostBack="True" OnTextChanged="txtInizio_TextChanged"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtInizio"
FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="!!!" ControlToValidate="txtInizio" />
</div>
<div style="float: left; padding-right:4px;">
<asp:TextBox ID="txtFine" TabIndex="2" runat="server" Width="6em" MaxLength="10"
AutoPostBack="True" OnTextChanged="txtFine_TextChanged"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFine"
FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="!!!" ControlToValidate="txtFine" />
</div>
<div style="float: left;">
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
DataSourceID="odsPeriodi" DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsPeriodi" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="DS_utilityTableAdapters.v_selPeriodiTradTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="IT" Name="conditio" SessionField="lingua" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
-205
View File
@@ -1,205 +0,0 @@
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_periodoAnalisi : System.Web.UI.UserControl
{
#region area protected
protected intervalloDate _intervallo;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
setIntervallo();
}
/// <summary>
/// gestione del selettore rapido dell'intervallo temporale...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
intervalloDate _intervallo = new intervalloDate();
// verifico cosa sia cambiato ed imposto date...
datario _datario = new datario();
switch (DropDownList1.SelectedValue)
{
case "1_today":
_intervallo = _datario.giornata(DateTime.Now);
break;
case "2_yesterday":
_intervallo = _datario.giornata(DateTime.Now.AddDays(-1));
break;
case "3_last_7":
_intervallo = _datario.ultimiGiorni(DateTime.Now, 7);
break;
case "4_this_week":
_intervallo = _datario.questaSett(DateTime.Now);
break;
case "5_last_30":
_intervallo = _datario.ultimiGiorni(DateTime.Now, 30);
break;
case "6_this_month":
_intervallo = _datario.questoMese(DateTime.Now);
break;
case "7_last_month":
_intervallo = _datario.estremiMese(DateTime.Now.AddMonths(-1));
break;
case "8_this_year":
_intervallo = _datario.estremiAnno(DateTime.Now);
break;
case "9_last_year":
_intervallo = _datario.estremiAnno(DateTime.Now.AddYears(-1));
break;
default:
break;
}
intervalloAnalisi = _intervallo;
aggiornaDateMostrate();
}
private void aggiornaDateMostrate()
{
txtInizio.Text = intervalloAnalisi.inizio.ToShortDateString();
txtFine.Text = intervalloAnalisi.fine.AddDays(-1).ToShortDateString(); // mostro 1 gg in meno xché termina alle 00:00...
reportUpdate();
}
private void setIntervallo()
{
intervalloDate _intervallo;
try
{
_intervallo = (intervalloDate)Session["_intervallo"];
}
catch
{
_intervallo = new intervalloDate();
_intervallo.fine = DateTime.Now.Subtract(DateTime.Now.TimeOfDay).AddDays(1);
_intervallo.inizio = _intervallo.fine.AddMonths(-1);
Session["_intervallo"] = _intervallo;
Session["_inizio"] = _intervallo.inizio;
Session["_fine"] = _intervallo.fine;
}
txtInizio.Text = _intervallo.inizio.ToShortDateString();
txtFine.Text = _intervallo.fine.ToShortDateString();
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lblPeriodo.Text = traduci("periodoRif");
txtInizio.ToolTip = traduci("inizioPeriodo");
txtFine.ToolTip = traduci("finePeriodo");
}
}
protected void txtInizio_TextChanged(object sender, EventArgs e)
{
// imposto il selettore a discesa...
DropDownList1.SelectedIndex = 0;
// se campo vuoto imposto oggi...
if (txtInizio.Text == "")
{
txtInizio.Text = DateTime.Now.ToShortDateString();
}
else
{
txtInizio.Text = Convert.ToDateTime(txtInizio.Text).ToShortDateString();
}
// aggiorno dati in session...
aggiornaPeriodo();
}
private void aggiornaPeriodo()
{
_intervallo = new intervalloDate();
_intervallo.inizio = Convert.ToDateTime(txtInizio.Text);
_intervallo.fine = ((DateTime)Convert.ToDateTime(txtFine.Text)).Date.AddDays(1);
//_intervallo.fine = ((DateTime)Convert.ToDateTime(txtFine.Text)).Date.AddDays(1).AddMinutes(-1);
intervalloAnalisi = _intervallo;
reportUpdate();
}
protected void txtFine_TextChanged(object sender, EventArgs e)
{
// imposto il selettore a discesa...
DropDownList1.SelectedIndex = 0;
// se campo vuoto imposto oggi...
if (txtFine.Text == "")
{
txtFine.Text = DateTime.Now.AddDays(1).ToShortDateString();
}
else
{
txtFine.Text = Convert.ToDateTime(txtFine.Text).ToShortDateString();
}
// aggiorno dati in session...
aggiornaPeriodo();
}
protected void reportUpdate()
{
// alzo l'evento d update/inserimento e ricarico cache...
if (eh_doUpdate != null)
{
eh_doUpdate(this, new EventArgs());
}
}
#endregion
#region area public
public intervalloDate intervalloAnalisi
{
get
{
return (intervalloDate)Session["_intervallo"];
}
set
{
intervalloDate interv = value;
Session["_intervallo"] = interv;
Session["_inizio"] = interv.inizio;
Session["_fine"] = interv.fine;
}
}
public void doUpdate()
{
aggiornaDateMostrate();
}
public void setPeriodoFree()
{
DropDownList1.SelectedIndex = 0;
}
#region gestione eventi
public event EventHandler eh_doUpdate;
#endregion
#endregion
}
-104
View File
@@ -1,104 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_priorita.ascx.cs"
Inherits="mod_priorita" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxPriorita" DataSourceID="ods" OnDataBound="grView_DataBound"
OnRowEditing="grView_RowEditing">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="idxPriorita" HeaderText="idxPriorita" InsertVisible="False"
SortExpression="idxPriorita" />
<asp:TemplateField HeaderText="descrPriorita" SortExpression="descrPriorita">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrPriorita") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrPriorita") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="stile" SortExpression="stile">
<EditItemTemplate>
<asp:DropDownList ID="ddlstile" runat="server" DataSourceID="odsStile"
DataTextField="value" DataValueField="value" SelectedValue='<%# Bind("stile") %>'>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsStile" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="DS_utilityTableAdapters.v_selSemaforiTableAdapter">
</asp:ObjectDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("stile") %>' CssClass='<%# Eval("stile") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagPrioritaTableAdapter"
UpdateMethod="UpdateQuery" DeleteMethod="DeleteQuery" OldValuesParameterFormatString="original_{0}"
FilterExpression="descrPriorita LIKE '%{0}%' " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="descrPriorita" Type="String" />
<asp:Parameter Name="stile" Type="String" />
<asp:Parameter Name="Original_idxPriorita" Type="Int32" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxPriorita" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="descrPriorita" Type="String" />
<asp:Parameter Name="stile" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
-95
View File
@@ -1,95 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_priorita : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
DS_applicazioneTableAdapters.AnagPrioritaTableAdapter taPrior = new DS_applicazioneTableAdapters.AnagPrioritaTableAdapter();
// calcolo ultimo libero e aggiungo 1...
int nextFree = 1;
try
{
nextFree = (int)taPrior.getMaxPriorita() + 1;
}
catch
{
logger.lg.scriviLog("Errore nel recupero del max idx di prorità", tipoLog.EXCEPTION);
}
taPrior.Insert(nextFree, "-- [NUOVA] non definita --", "semaforoVerde");
grView.DataBind();
}
}
-101
View File
@@ -1,101 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_reportInterventi.ascx.cs"
Inherits="mod_reportInterventi" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="mod_periodoAnalisi.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc1" %>
<div style="background-color: silver;">
<div style="padding: 1px;">
<div style="padding: 4px; background-color: #E5E2E1;">
<div style="width: 98%; background-color: #D5D2D1; clear: both; padding: 4px; text-align: center; border-style:inset;">
<uc1:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" />
</div>
<div style="width: 100%; background-color: #E5E2E1; clear: both;" class="bg_plus">
<div style="float: left; width: 350px">
<div style="float: left;">
<asp:Label runat="server" ID="lblImpiantiInteressati" />
</div>
<div style="float: right;">
<asp:TextBox runat="server" ID="txtCercaImpianti" Width="8em" Text="*" AutoPostBack="True" />
</div>
<div>
<asp:ListBox ID="listImpianti" runat="server" AutoPostBack="True" DataSourceID="odsImpianti"
SelectionMode="Multiple" DataTextField="label" DataValueField="value" Height="300px"
Width="350px" BackColor="#ddeeff" Font-Size="8pt" OnSelectedIndexChanged="listImpianti_SelectedIndexChanged"
OnDataBound="listImpianti_DataBound" />
<asp:ObjectDataSource ID="odsImpianti" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selImpiantiTableAdapter"
FilterExpression="label LIKE '%{0}%'">
<FilterParameters>
<asp:ControlParameter ControlID="txtCercaImpianti" DefaultValue="*" Type="String"
Name="txtCercaImpianti" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
</div>
<div style="float: left; width: 450px">
<div style="float: left;">
<asp:Label runat="server" ID="lblMacchineInteressate" />
</div>
<div style="float: right;">
<asp:TextBox runat="server" ID="txtCercaMacchine" Width="8em" Text="*" AutoPostBack="True" />
</div>
<div>
<asp:ListBox ID="listMacchine" runat="server" AutoPostBack="True" DataSourceID="odsMacchine"
SelectionMode="Multiple" DataTextField="label" DataValueField="value" Height="300px"
Width="450px" BackColor="#ddffee" Font-Size="8pt" OnSelectedIndexChanged="listMacchine_SelectedIndexChanged"
OnDataBound="listMacchine_DataBound" />
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_utilityTableAdapters.v_selMacchineTableAdapter"
FilterExpression="label LIKE '%{0}%'">
<FilterParameters>
<asp:ControlParameter ControlID="txtCercaMacchine" DefaultValue="*" Type="String"
Name="txtCercaMacchine" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
</div>
<div style="float: left; clear: right;">
<div id="up" style="margin-left: 20px;">
<asp:Label runat="server" ID="lblMostraStati" /><br />
<asp:ListBox ID="listaStati" runat="server" DataSourceID="ods" DataTextField="DescrStato"
AutoPostBack="true" DataValueField="idxStato" OnDataBound="listaStati_DataBound"
SelectionMode="Multiple" OnSelectedIndexChanged="listaStati_SelectedIndexChanged">
</asp:ListBox>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagStatiTableAdapter">
</asp:ObjectDataSource>
</div>
</div>
</div>
<div style="font-size: 8pt; clear: both; text-align: center; vertical-align: top;
padding-top: 20pz; background-color: #E5E2E1">
<table>
<tr>
<td style="width: 300px;">
<h3>
<asp:Label runat="server" ID="lblReportInterventi" />
</h3>
<asp:HyperLink runat="server" ID="hlElencoInterventi_Pdf" ToolTip="exportPDF interventi (tradurre)"
ImageUrl="~/images/pdfExportSmall.png" />
</td>
<td style="width: 30px;">
</td>
<td style="width: 300px;">
<h3>
<asp:Label runat="server" ID="lblReportMTBFMTTR" />
</h3>
<asp:HyperLink runat="server" ID="hlMTBF_MTTR_Pdf" ToolTip="exportPDF MTBF MTTR (tradurre)"
ImageUrl="~/images/pdfExportSmall.png" />
</td>
</tr>
<tr>
<td colspan="3">
<br />
<asp:HyperLink runat="server" ID="lnkGuidaPerReport" NavigateUrl="~/help/index.html"
Target="_blank" />
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
@@ -1,191 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_reportInterventi : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// traduzioni
traduciObj();
// popolo valori default
setDefaultValues();
// aggancio evento selezione x aggiornare hyperlink
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
mod_periodoAnalisi1.eh_doUpdate += new EventHandler(mod_periodoAnalisi1_eh_doUpdate);
}
void mod_periodoAnalisi1_eh_doUpdate(object sender, EventArgs e)
{
setDefaultValues();
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
private void traduciObj()
{
lblMostraStati.Text = traduci("lblMostraStati");
lblImpiantiInteressati.Text = traduci("lblImpiantiSel");
lblMacchineInteressate.Text = traduci("lblMacchineSel");
lnkGuidaPerReport.Text = traduci("lnkGuidaPerReport");
lblReportInterventi.Text = traduci("lblReportInterventi");
lblReportMTBFMTTR.Text = traduci("lblReportMTBFMTTR");
}
private void setDefaultValues()
{
// valori degli hyperlink
hlElencoInterventi_Pdf.NavigateUrl = formattaUrl(reportRichiesto.ElencoInterventi, mod_periodoAnalisi1.intervalloAnalisi);
hlMTBF_MTTR_Pdf.NavigateUrl = formattaUrl(reportRichiesto.MTBF_MTTR, mod_periodoAnalisi1.intervalloAnalisi);
}
private string formattaUrl(reportRichiesto tipo, intervalloDate periodo)
{
return String.Format("~/ExportPdf.aspx?tipo={0}&inizio={1}&fine={2}&username={3}", Convert.ToInt32(tipo), periodo.inizio, periodo.fine, user_std.UtSn.userNameAD);
}
#region gestione selettori valori multipli
#region stati
/// <summary>
/// valorizzazione iniziale filtro stati
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listaStati_DataBound(object sender, EventArgs e)
{
foreach (ListItem item in ((ListBox)sender).Items)
{
item.Selected = true;
}
generaFiltroStati();
}
/// <summary>
/// salva elenco stati selected
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listaStati_SelectedIndexChanged(object sender, EventArgs e)
{
generaFiltroStati();
}
private void generaFiltroStati()
{
// svuoto elenco utente delle macchine selezionate
TA_app.obj.taFiltSta.EmptyUserData(user_std.UtSn.userNameAD);
// spazzo TUTTE le righe del controllo...
foreach (ListItem riga in listaStati.Items)
{
// se è selezionata creo riga anche x lei...
if (riga.Selected)
{
TA_app.obj.taFiltSta.Insert(user_std.UtSn.userNameAD, Convert.ToInt32(riga.Value));
}
}
}
#endregion
#region impianti
/// <summary>
/// valorizzazione iniziale filtro impianti
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listImpianti_DataBound(object sender, EventArgs e)
{
foreach (ListItem item in ((ListBox)sender).Items)
{
item.Selected = true;
}
generaFiltroImpianti();
}
/// <summary>
/// salvo elenco impianti selected
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listImpianti_SelectedIndexChanged(object sender, EventArgs e)
{
generaFiltroImpianti();
}
private void generaFiltroImpianti()
{
// svuoto elenco utente delle macchine selezionate
TA_app.obj.taFiltImp.EmptyUserData(user_std.UtSn.userNameAD);
// spazzo TUTTE le righe del controllo...
foreach (ListItem riga in listImpianti.Items)
{
// se è selezionata creo riga anche x lei...
if (riga.Selected)
{
TA_app.obj.taFiltImp.Insert(user_std.UtSn.userNameAD, Convert.ToInt32(riga.Value));
}
}
}
#endregion
#region macchine
/// <summary>
/// valorizzazione iniziale filtro macchine
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listMacchine_DataBound(object sender, EventArgs e)
{
foreach (ListItem item in ((ListBox)sender).Items)
{
item.Selected = true;
}
generaFiltroMacchine();
}
/// <summary>
/// salvo elenco macchine selected
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void listMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
generaFiltroMacchine();
}
private void generaFiltroMacchine()
{
// svuoto elenco utente delle macchine selezionate
TA_app.obj.taFiltMac.EmptyUserData(user_std.UtSn.userNameAD);
// spazzo TUTTE le righe del controllo...
foreach (ListItem riga in listMacchine.Items)
{
// se è selezionata creo riga anche x lei...
if (riga.Selected)
{
TA_app.obj.taFiltMac.Insert(user_std.UtSn.userNameAD, Convert.ToInt32(riga.Value));
}
}
}
#endregion
#endregion
}
-6
View File
@@ -1,6 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_ricercaGenerica.ascx.cs"
Inherits="mod_ricercaGenerica" %>
<div class="boxRicerca">
<asp:TextBox ID="txtCerca" runat="server" OnTextChanged="txtCerca_TextChanged" Width="200px"></asp:TextBox>
<asp:Button ID="btnCerca" runat="server" OnClick="btnCerca_Click" Text="Cerca" />
</div>
-181
View File
@@ -1,181 +0,0 @@
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_ricercaGenerica : ApplicationUserControl
{
#region gestione eventi
public event EventHandler eh_nuovaRicerca;
#endregion
# region area protected
#region area ricerche dettaglio specifiche
protected bool _cercaMatricole = false;
protected bool _cercaUsername = false;
//protected bool _cercaManufacturer = false;
//protected bool _cercaCategorie = false;
protected bool _cercaModelli = false;
protected bool _cercaMag = false;
#endregion
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
updateText();
}
/// <summary>
/// cambiato valore in ricerca
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtCerca_TextChanged(object sender, EventArgs e)
{
salvaCerca();
}
/// <summary>
/// pressione del button di ricerca
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCerca_Click(object sender, EventArgs e)
{
salvaCerca();
}
/// <summary>
/// testo ricerca trimmato da spazi
/// </summary>
protected string testoRicerca
{
get
{
return txtCerca.Text.Trim();
}
set
{
txtCerca.Text = value;
}
}
protected void salvaCerca()
{
if (testoRicerca == "")
{
SteamWare.memLayer.ML.emptySessionVal("valoreCercato");
SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch");
}
else
{
SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca);
// verifico ricerche accessorie
if (_cercaMatricole)
{
salvaCercaMatricole();
}
if (_cercaUsername)
{
salvaCercaUsername();
}
// raise dell'evento
if (eh_nuovaRicerca != null)
{
eh_nuovaRicerca(this, new EventArgs());
}
}
}
/// <summary>
/// ricerca utenti e salva lista matricole x SQL IN
/// </summary>
protected void salvaCercaMatricole()
{
// salvo anche l'elenco delle matricole compatibili...
DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca);
string listaMatricoleSearch = "";
foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti)
{
listaMatricoleSearch += string.Format("'{0}', ", riga.MATRICOLA);
}
if (listaMatricoleSearch.Length > 0)
{
listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch);
}
/// <summary>
/// ricerca utenti e salva lista username x SQL IN
/// </summary>
protected void salvaCercaUsername()
{
// salvo anche l'elenco delle matricole compatibili...
DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca);
string listaUsernameSearch = "";
foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti)
{
listaUsernameSearch += string.Format("'{0}', ", riga.USER_NAME);
}
if (listaUsernameSearch.Length > 0)
{
listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch);
}
#endregion
#region area public
/// <summary>
/// aggiorna il testo cercato
/// </summary>
public void updateText()
{
if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack)
{
testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato");
}
}
/// <summary>
/// indica se generare da stringa search un elenco delle matricole corrispondenti
/// </summary>
public bool cercaMatricole
{
get
{
return _cercaMatricole;
}
set
{
_cercaMatricole = value;
}
}
/// <summary>
/// indica se generare da stringa search un elenco di username corrispondenti
/// </summary>
public bool cercaUsername
{
get
{
return _cercaUsername;
}
set
{
_cercaUsername = value;
}
}
#endregion
}
-58
View File
@@ -1,58 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_selettore.ascx.cs"
Inherits="mod_selettore" %>
<table cellpadding="0" cellspacing="0" width="50%">
<tr>
<td>
<table cellpadding="2" cellspacing="0" width="100%">
<tr>
<td>
<asp:Label ID="lblCerca" runat="server"></asp:Label>
&nbsp;
<asp:TextBox ID="txtCerca" runat="server" OnTextChanged="txtCerca_TextChanged" AutoPostBack="true" TabIndex="-1"></asp:TextBox>
&nbsp;
<asp:Button ID="btnCerca" runat="server" Text="Cerca" OnClick="txtCerca_TextChanged" TabIndex="-1" />
&nbsp;
<asp:CheckBox ID="chkOpzione" runat="server" AutoPostBack="True" OnCheckedChanged="chkOpzione_CheckedChanged" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="grView" runat="server" OnSelectedIndexChanged="grView_SelectedIndexChanged"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ods"
GridLines="None" OnDataBound="grView_DataBound" DataKeyNames="value" Width="500px"
OnPageIndexChanged="grView_PageIndexChanged">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
Text='<%# traduci("Sel") %>' TabIndex="-1"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="false">
<ItemTemplate>
<asp:Label runat="server" ID="lblValue" Text='<%# Eval("value") %>' Visible='<%# isValueVisible %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="label" HeaderText="label" SortExpression="label" HtmlEncode="false" />
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>&nbsp;&nbsp;
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getSelAllUsers" TypeName="selData"
FilterExpression=" (label LIKE '%{0}%') OR (value LIKE '%{0}%')">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricercaPopup" SessionField="ricercaPopup" />
</FilterParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
-464
View File
@@ -1,464 +0,0 @@
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;
[ValidationProperty("valore")]
public partial class mod_selettore : ApplicationUserControl
{
protected bool _chkVisibile = false;
protected bool _isValueVisible = false;
protected bool _cambioTipo = false;
protected string _valoreFull;
protected string _val1;
protected string _val2;
#region gestione eventi
public event EventHandler eh_selDone;
#endregion
#region gestione pagina
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
updateChkOpzione();
if (!Page.IsPostBack)
{
memLayer.ML.emptySessionVal(searchSessionName);
}
}
protected override void traduciObj()
{
base.traduciObj();
lblCerca.Text = traduci("lblCerca");
btnCerca.Text = traduci("search");
if (_chkVisibile)
{
updateChkOpzione();
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!Page.IsPostBack)
{
_val1 = "";
_val2 = "";
traduciObj();
}
if (vistaModulo == tipoVistaMod.editing)
{
setSearchValue();
impostaCampoRicerca();
}
}
/// <summary>
/// imposta il valore della ricerca da quello in session
/// </summary>
private void setSearchValue()
{
if (memLayer.ML.isInSessionObject(searchSessionName))
{
testoRicerca = memLayer.ML.StringSessionObj(searchSessionName);
}
}
/// <summary>
/// imposta i campi del filtro ricerca in session
/// </summary>
private void impostaCampoRicerca()
{
// imposto il nome del valore session x ricerca a campo univoco...
SessionParameter parametroFiltro = new SessionParameter();
parametroFiltro.SessionField = searchSessionName;
parametroFiltro.Name = searchSessionName;
parametroFiltro.DefaultValue = "*";
ods.FilterParameters.Clear();
ods.FilterParameters.Add(parametroFiltro);
}
/// <summary>
/// setta il nome del campo di ricerca
/// </summary>
protected string searchSessionName
{
get
{
return string.Format("ricerca_{0}", _tipoSelettore);
}
}
#endregion
#region area protected
protected string _conditio = "";
protected string testoRicerca
{
get
{
return txtCerca.Text.Trim();
}
set
{
txtCerca.Text = value;
}
}
protected selettori _selettori = new selettori();
/// <summary>
/// a seconda del tipo di selettore cambierà l'origine ods
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void chkOpzione_CheckedChanged(object sender, EventArgs e)
{
fixChkOds();
}
protected void setCheck()
{
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
_chkVisibile = true;
}
else
{
_chkVisibile = false;
}
}
/// <summary>
/// aggiorna visualizzazione del check opzionale con label e visibilità
/// </summary>
protected void updateChkOpzione()
{
// se definito il tipo decido SE mostrare il check e tradurre la label...
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
chkOpzione.Visible = true;
chkOpzione.Text = traduci("chkSoloGer");
if (_tipoSelettore == tipoSelettore.utentiCdc)
{
chkOpzione.Checked = true;
}
}
else
{
chkOpzione.Visible = false;
}
}
/// <summary>
/// aggiorna label e valore principale da una chiave multipart
/// </summary>
private void aggiornaDaValMulti()
{
// eseguo SE E SOLO SE entrambi i valori sono popolati
if (val1 != "" && val1 != null)
{
if (val2 != "" && val2 != null && val2 != "na")
{
_valoreFull = string.Format("{0}#{1}", val1, val2);
}
else
{
_valoreFull = val1;
}
}
}
/// <summary>
/// tipo di valori mostrati
/// </summary>
protected tipoSelettore _tipoSelettore = tipoSelettore.cdc;
/// <summary>
/// nome del controllo gestito dal nostro popup
/// </summary>
protected string _targetControl = "";
/// <summary>
/// sistemo gli ods
/// </summary>
protected override void bindControlli()
{
base.bindControlli();
fixChkOds();
fixOds();
}
/// <summary>
/// sistema l'ods dato lo stato del chk
/// </summary>
protected void fixChkOds()
{
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
// verifico se sia o meno checked "solo cdc utente"...
if (chkOpzione.Checked)
{
//imposto nuovo tipo selettore
_tipoSelettore = tipoSelettore.utentiCdc;
fixOds();
}
else
{
//imposto nuovo tipo selettore
_tipoSelettore = tipoSelettore.utentiAll;
fixOds();
}
// faccio databind...
grView.PageIndex = 0;
grView.DataBind();
}
}
/// <summary>
/// sistemazione fonte ods...
/// </summary>
protected void fixOds()
{
string _selectMethod = "";
switch (_tipoSelettore)
{
case tipoSelettore.cdc:
_selectMethod = "getSelAllCdC";
break;
case tipoSelettore.impianti:
_selectMethod = "getSelImpianti";
break;
case tipoSelettore.macchine:
_selectMethod = "getSelMacchine";
break;
case tipoSelettore.utentiAll:
_selectMethod = "getSelAllUsers";
break;
case tipoSelettore.utentiCdc:
_selectMethod = "getSelUsersGer";
break;
}
ods.SelectMethod = _selectMethod;
}
/// <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 = "";
}
}
/// <summary>
/// selezione annullata su cambio pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_PageIndexChanged(object sender, EventArgs e)
{
grView.SelectedIndex = -1;
}
/// <summary>
/// aggiornamento filtro da stringa di ricerca del popup
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtCerca_TextChanged(object sender, EventArgs e)
{
// se cambio filtro tolgo il selected...
grView.SelectedIndex = -1;
// salvo la ricerca in session e filter dell'ods...
memLayer.ML.setSessionVal(searchSessionName, txtCerca.Text);
impostaCampoRicerca();
fixChkOds();
fixOds();
}
/// <summary>
/// salvo il valore selezionato
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
string valore = grView.SelectedValue.ToString();
// se ho una chiave multiparte salvo nei 2 valori...
if (valore.IndexOf('#') > -1)
{
string[] valori = valore.Split('#');
val1 = valori[0];
val2 = valori[1];
}
if (eh_selDone != null)
{
eh_selDone(this, new EventArgs());
}
}
/// <summary>
/// resetta ricerca e selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
grView.SelectedIndex = -1;
testoRicerca = "";
memLayer.ML.emptySessionVal(searchSessionName);
}
#endregion
#region area public
/// <summary>
/// tipo di selettore da istanziare
/// </summary>
public tipoSelettore tipo
{
get
{
return _tipoSelettore;
}
set
{
_tipoSelettore = value;
setCheck();
}
}
/// <summary>
/// effettua update del controllo
/// </summary>
public void doUpdate()
{
// svuoto ricerca...
memLayer.ML.emptySessionVal(searchSessionName);
testoRicerca = "";
// imposto valori cercati...
setSearchValue();
impostaCampoRicerca();
// continuo con update
updateChkOpzione();
fixOds();
aggiornaDaValMulti();
// faccio databind...
grView.PageIndex = 0;
grView.DataBind();
}
/// <summary>
/// valore mostrato nel campo testo del selettore
/// </summary>
public string valore
{
get
{
return grView.SelectedValue.ToString();
}
set
{
_valoreFull = value;
}
}
/// <summary>
/// valore di una chiave multiparte
/// </summary>
public string val1
{
get
{
return _val1;
}
set
{
_val1 = value;
aggiornaDaValMulti();
}
}
/// <summary>
/// valore di una chiave multiparte
/// </summary>
public string val2
{
get
{
return _val2;
}
set
{
_val2 = value;
aggiornaDaValMulti();
}
}
/// <summary>
/// impone una condizione di filtro sui valori mostrati
/// </summary>
public string conditio
{
get
{
return _conditio;
}
set
{
_conditio = value;
if (_conditio != "")
{
ods.SelectParameters.Clear();
ods.SelectParameters.Add("where", string.Format(" conditio = '{0}' ", _conditio));
}
else
{
ods.SelectParameters.Clear();
ods.SelectParameters.Add("where", " conditio = '*' ");
}
}
}
/// <summary>
/// determina se il valore da selezionare sia da visualizzare o meno
/// </summary>
public bool isValueVisible
{
get
{
return _isValueVisible;
}
set
{
_isValueVisible = value;
}
}
#endregion
}
-77
View File
@@ -1,77 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_selettore_ajax.ascx.cs"
Inherits="mod_selettore_ajax" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" Visible="true">
<ContentTemplate>
<ajaxToolkit:PopupControlExtender ID="pce" runat="server" TargetControlID="txtSelValue"
PopupControlID="pnlSelettore" Position="Bottom" />
<ajaxToolkit:PopupControlExtender ID="pce2" runat="server" TargetControlID="lblDescr"
PopupControlID="pnlSelettore" Position="Bottom" CommitProperty="innerHTML" />
<div class="selezioneValRed">
<asp:TextBox ID="txtSelValue" runat="server" Width="0px" CssClass="hiddenTxt" BorderWidth="0px" TabIndex="-1"/>
<asp:Label ID="lblDescr" runat="server" Text="-" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlSelettore" runat="server" CssClass="popupControl">
<asp:UpdatePanel ID="updPnl1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" width="50%">
<tr>
<td>
<table cellpadding="2" cellspacing="0" width="100%">
<tr>
<td>
<asp:Label ID="lblCerca" runat="server"></asp:Label>
&nbsp;
<asp:TextBox ID="txtCerca" runat="server" OnTextChanged="txtCerca_TextChanged" AutoPostBack="true" TabIndex="-1"></asp:TextBox>
&nbsp;
<asp:Button ID="btnCerca" runat="server" Text="Cerca" OnClick="txtCerca_TextChanged" TabIndex="-1" />
&nbsp;
<asp:CheckBox ID="chkOpzione" runat="server" AutoPostBack="True" OnCheckedChanged="chkOpzione_CheckedChanged" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="grView" runat="server" OnSelectedIndexChanged="grView_SelectedIndexChanged"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ods"
GridLines="None" OnDataBound="grView_DataBound" DataKeyNames="value" Width="500px"
OnPageIndexChanged="grView_PageIndexChanged">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
Text='<%# traduci("Sel") %>' TabIndex="-1"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="false">
<ItemTemplate>
<asp:Label runat="server" ID="lblValue" Text='<%# Eval("value") %>' Visible='<%# isValueVisible %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="label" HeaderText="label" SortExpression="label" HtmlEncode="false" />
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>&nbsp;&nbsp;
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getSelAllUsers" TypeName="selData"
FilterExpression=" (label LIKE '%{0}%') ">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricercaPopup" SessionField="ricercaPopup" />
</FilterParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
-499
View File
@@ -1,499 +0,0 @@
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;
[ValidationProperty("valore")]
public partial class mod_selettore_ajax : ApplicationUserControl
{
protected bool _chkVisibile = false;
protected bool _isValueVisible = false;
protected bool _cambioTipo = false;
protected string _val1;
protected string _val2;
#region gestione eventi
public event EventHandler eh_selDone;
#endregion
#region gestione pagina
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
updateChkOpzione();
if (!Page.IsPostBack)
{
SteamWare.memLayer.ML.emptySessionVal(searchSessionName);
}
}
protected override void traduciObj()
{
base.traduciObj();
lblCerca.Text = traduci("lblCerca");
btnCerca.Text = traduci("search");
if (_chkVisibile)
{
updateChkOpzione();
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!Page.IsPostBack)
{
_val1 = "";
_val2 = "";
if (vistaModulo == SteamWare.tipoVistaMod.editing)
{
setSearchValue();
impostaCampoRicerca();
pce.Enabled = true;
pce2.Enabled = true;
lblDescr.CssClass = "txtLink";
}
else if (vistaModulo == SteamWare.tipoVistaMod.selezione)
{
pce.Enabled = false;
pce2.Enabled = false;
lblDescr.CssClass = "txtValue";
}
traduciObj();
}
}
/// <summary>
/// imposta il valore della ricerca da quello in session
/// </summary>
private void setSearchValue()
{
if (SteamWare.memLayer.ML.isInSessionObject(searchSessionName))
{
testoRicerca = SteamWare.memLayer.ML.StringSessionObj(searchSessionName);
}
}
/// <summary>
/// imposta i campi del filtro ricerca in session
/// </summary>
private void impostaCampoRicerca()
{
// imposto il nome del valore session x ricerca a campo univoco...
SessionParameter parametroFiltro = new SessionParameter();
parametroFiltro.SessionField = searchSessionName;
parametroFiltro.Name = searchSessionName;
parametroFiltro.DefaultValue = "*";
ods.FilterParameters.Clear();
ods.FilterParameters.Add(parametroFiltro);
}
/// <summary>
/// setta il nome del campo di ricerca
/// </summary>
protected string searchSessionName
{
get
{
return string.Format("ricerca_{0}", _tipoSelettore);
}
}
#endregion
#region area protected
protected string _conditio = "";
protected string testoRicerca
{
get
{
return txtCerca.Text.Trim();
}
set
{
txtCerca.Text = value;
}
}
protected selettori _selettori = new selettori();
/// <summary>
/// a seconda del tipo di selettore cambierà l'origine ods
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void chkOpzione_CheckedChanged(object sender, EventArgs e)
{
fixChkOds();
}
protected void setCheck()
{
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
_chkVisibile = true;
}
else
{
_chkVisibile = false;
}
}
/// <summary>
/// aggiorna visualizzazione del check opzionale con label e visibilità
/// </summary>
protected void updateChkOpzione()
{
// se definito il tipo decido SE mostrare il check e tradurre la label...
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
chkOpzione.Visible = true;
chkOpzione.Text = traduci("chkSoloGer");
if (_tipoSelettore == tipoSelettore.utentiCdc)
{
chkOpzione.Checked = true;
}
}
else
{
chkOpzione.Visible = false;
}
}
/// <summary>
/// aggiorna la label che traduce il valore a seconda del tipo di oggetto...
/// </summary>
protected void aggiornaLabelDaValore()
{
// x ora metto valore di default...
string _answ = "-";
if (txtSelValue.Text != "")
{
System.Data.DataView tabella = (System.Data.DataView)ods.Select();
tabella.RowFilter = string.Format("value = '{0}'", txtSelValue.Text);
try
{
_answ = tabella.ToTable().Rows[0]["label"].ToString();
}
catch
{ }
}
lblDescr.Text = _answ;
}
/// <summary>
/// aggiorna label e valore principale da una chiave multipart
/// </summary>
private void aggiornaDaValMulti()
{
// eseguo SE E SOLO SE entrambi i valori sono popolati
if (val1 != "" && val1 != null)
{
if (val2 != "" && val2 != null && val2 != "na")
{
txtSelValue.Text = string.Format("{0}#{1}", val1, val2);
aggiornaLabelDaValore();
}
else
{
txtSelValue.Text = val1;
aggiornaLabelDaValore();
}
}
}
/// <summary>
/// tipo di valori mostrati
/// </summary>
protected tipoSelettore _tipoSelettore = tipoSelettore.cdc;
/// <summary>
/// nome del controllo gestito dal nostro popup
/// </summary>
protected string _targetControl = "";
/// <summary>
/// sistemo gli ods
/// </summary>
protected override void bindControlli()
{
base.bindControlli();
fixChkOds();
fixOds();
}
/// <summary>
/// sistema l'ods dato lo stato del chk
/// </summary>
protected void fixChkOds()
{
if (_tipoSelettore == tipoSelettore.utentiAll || _tipoSelettore == tipoSelettore.utentiCdc)
{
// verifico se sia o meno checked "solo cdc utente"...
if (chkOpzione.Checked)
{
//imposto nuovo tipo selettore
_tipoSelettore = tipoSelettore.utentiCdc;
fixOds();
}
else
{
//imposto nuovo tipo selettore
_tipoSelettore = tipoSelettore.utentiAll;
fixOds();
}
// faccio databind...
grView.PageIndex = 0;
grView.DataBind();
}
}
/// <summary>
/// sistemazione fonte ods...
/// </summary>
protected void fixOds()
{
string _selectMethod = "";
switch (_tipoSelettore)
{
case tipoSelettore.cdc:
_selectMethod = "getSelAllCdC";
break;
case tipoSelettore.impianti:
_selectMethod = "getSelImpianti";
break;
case tipoSelettore.macchine:
_selectMethod = "getSelMacchine";
break;
case tipoSelettore.utentiAll:
_selectMethod = "getSelAllUsers";
break;
case tipoSelettore.utentiCdc:
_selectMethod = "getSelUsersGer";
break;
}
ods.SelectMethod = _selectMethod;
}
/// <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 = "";
}
}
/// <summary>
/// selezione annullata su cambio pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_PageIndexChanged(object sender, EventArgs e)
{
grView.SelectedIndex = -1;
}
/// <summary>
/// aggiornamento filtro da stringa di ricerca del popup
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtCerca_TextChanged(object sender, EventArgs e)
{
// se cambio filtro tolgo il selected...
grView.SelectedIndex = -1;
// salvo la ricerca in session e filter dell'ods...
SteamWare.memLayer.ML.setSessionVal(searchSessionName, txtCerca.Text);
impostaCampoRicerca();
fixChkOds();
fixOds();
}
/// <summary>
/// salvo il valore selezionato
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
string valore = grView.SelectedValue.ToString();
lblDescr.Text = grView.SelectedRow.Cells[2].Text.ToString();
UpdatePanel1.Update();
pce.Commit(valore);
pce2.Commit(grView.SelectedRow.Cells[2].Text.ToString());
// se ho una chiave multiparte salvo nei 2 valori...
if (valore.IndexOf('#') > -1)
{
string[] valori = valore.Split('#');
val1 = valori[0];
val2 = valori[1];
}
if (eh_selDone != null)
{
eh_selDone(this, new EventArgs());
}
}
/// <summary>
/// resetta ricerca e selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
grView.SelectedIndex = -1;
testoRicerca = "";
SteamWare.memLayer.ML.emptySessionVal(searchSessionName);
}
#endregion
#region area public
/// <summary>
/// tipo di selettore da istanziare
/// </summary>
public tipoSelettore tipo
{
get
{
return _tipoSelettore;
}
set
{
_tipoSelettore = value;
setCheck();
}
}
/// <summary>
/// effettua update del controllo
/// </summary>
public void doUpdate()
{
// svuoto ricerca...
SteamWare.memLayer.ML.emptySessionVal(searchSessionName);
testoRicerca = "";
// imposto valori cercati...
setSearchValue();
impostaCampoRicerca();
// continuo con update
updateChkOpzione();
fixOds();
aggiornaDaValMulti();
// faccio databind...
grView.PageIndex = 0;
grView.DataBind();
}
/// <summary>
/// valore mostrato nel campo testo del selettore
/// </summary>
public string valore
{
get
{
return txtSelValue.Text;
}
set
{
txtSelValue.Text = value;
aggiornaLabelDaValore();
}
}
/// <summary>
/// valore di una chiave multiparte
/// </summary>
public string val1
{
get
{
return _val1;
}
set
{
_val1 = value;
aggiornaDaValMulti();
}
}
/// <summary>
/// valore di una chiave multiparte
/// </summary>
public string val2
{
get
{
return _val2;
}
set
{
_val2 = value;
aggiornaDaValMulti();
}
}
/// <summary>
/// impone una condizione di filtro sui valori mostrati
/// </summary>
public string conditio
{
get
{
return _conditio;
}
set
{
_conditio = value;
if (_conditio != "")
{
ods.SelectParameters.Clear();
ods.SelectParameters.Add("where", string.Format(" conditio = '{0}' ", _conditio));
}
else
{
ods.SelectParameters.Clear();
ods.SelectParameters.Add("where", " conditio = '*' ");
}
}
}
/// <summary>
/// determina se il valore da selezionare sia da visualizzare o meno
/// </summary>
public bool isValueVisible
{
get
{
return _isValueVisible;
}
set
{
_isValueVisible = value;
}
}
#endregion
}
-85
View File
@@ -1,85 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_tipoGuasto.ascx.cs" Inherits="mod_tipoGuasto" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="idxTipo" DataSourceID="ods" OnDataBound="grView_DataBound"
OnRowEditing="grView_RowEditing">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="idxTipo" HeaderText="idxTipo" Visible="False"
SortExpression="idxTipo" />
<asp:TemplateField HeaderText="descrTipo" SortExpression="descrTipo">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrTipo") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrTipo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagTipoGuastoTableAdapter"
UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"
FilterExpression="descrTipo LIKE '%{0}%' " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="descrTipo" Type="String" />
<asp:Parameter Name="Original_idxTipo" Type="Int32" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxTipo" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="descrTipo" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
-85
View File
@@ -1,85 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
public partial class mod_tipoGuasto : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
/// <summary>
/// evento dati associati a controllo
/// </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 = "";
}
}
/// <summary>
/// reset delle selezioni
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <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>
/// seleziono valore in editing...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
DS_applicazioneTableAdapters.AnagTipoGuastoTableAdapter taTipo = new DS_applicazioneTableAdapters.AnagTipoGuastoTableAdapter();
taTipo.Insert("-- [NUOVO] non definito --");
grView.DataBind();
}
}
-4
View File
@@ -1,4 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_titlePortable.ascx.cs" Inherits="mod_titleMini" %>
<asp:Label runat="server" ID="lblTitle" Text="..." Font-Size="Medium"></asp:Label>
<br />
<br />
-18
View File
@@ -1,18 +0,0 @@
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;
public partial class mod_titleMini : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblTitle.Text = string.Format("<b>{0} {1}</b>", ConfigurationManager.AppSettings.Get("portableAppName"), ConfigurationManager.AppSettings.Get("portableAppVersion"));
}
}
-16
View File
@@ -1,16 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_unauthorized.ascx.cs" Inherits="mod_unauthorized" %>
<table id="Table7" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td class="UnauthAppTitle">
SteamWare
</td>
</tr>
<tr>
<td>
<asp:Label id="lblTitle" CssClass="UnauthTitle" runat="server"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label id="lblMess" CssClass="UnauthMess" runat="server"></asp:Label></td>
</tr>
</table>
-19
View File
@@ -1,19 +0,0 @@
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;
public partial class mod_unauthorized : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblTitle.Text = "Attenzione! pagina non disponibile.";
lblMess.Text = "L'utente non è autorizzato alla visione del sito o pagina non è disponibile, verificare l'indirizzo della pagina inserito o contattare l'amministratore.";
}
}
-105
View File
@@ -1,105 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_vocabolario.ascx.cs"
Inherits="mod_vocabolario" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<table class="contrDx">
<tr>
<td>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="Lingua,Lemma" DataSourceID="ods" OnDataBound="grView_DataBound"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowEditing="grView_RowEditing">
<FooterStyle CssClass="ctrFooter"></FooterStyle>
<RowStyle CssClass="ctrRowStyle"></RowStyle>
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lingua" SortExpression="Lingua">
<EditItemTemplate>
<asp:Label ID="TextBox0" runat="server" Text='<%# Eval("Lingua") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Lingua") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lemma" SortExpression="Lemma">
<EditItemTemplate>
<asp:Label ID="TextBox2" runat="server" Text='<%# Eval("Lemma") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Lemma") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Traduzione" SortExpression="Traduzione">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Traduzione") %>' Width="500px"
TextMode="MultiLine" Height="8em"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Traduzione") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete">
</cc1:ConfirmButtonExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle HorizontalAlign="Center" CssClass="ctrHeaderPager" ForeColor="White"></PagerStyle>
<SelectedRowStyle CssClass="ctrSelRowStyle"></SelectedRowStyle>
<HeaderStyle CssClass="ctrHeaderPager" Font-Bold="True" ForeColor="White"></HeaderStyle>
<EditRowStyle CssClass="ctrEditRowStyle"></EditRowStyle>
<AlternatingRowStyle CssClass="ctrAltRowStyle"></AlternatingRowStyle>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getVocabolario" TypeName="selData"
UpdateMethod="updateLemmaVoc" DeleteMethod="deleteLemmaVoc" OldValuesParameterFormatString="Original_{0}"
FilterExpression="Traduzione LIKE '%{0}%' OR Lemma LIKE '%{0}%' " OnUpdated="ods_Updated">
<UpdateParameters>
<asp:Parameter Name="Traduzione" Type="String" />
<asp:Parameter Name="Original_Lingua" Type="String" />
<asp:Parameter Name="Original_Lemma" Type="String" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_Lingua" Type="String" />
<asp:Parameter Name="Original_Lemma" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Lingua" Type="String" />
<asp:Parameter Name="Lemma" Type="String" />
<asp:Parameter Name="Traduzione" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnNewLemma" runat="server" OnClick="btnNewLemma_Click" />
<asp:TextBox ID="txtNewLemma" runat="server" />
<cc1:TextBoxWatermarkExtender ID="TBW_newLemma" runat="server" TargetControlID="txtNewLemma" WatermarkCssClass="watermark">
</cc1:TextBoxWatermarkExtender>
</td>
</tr>
</table>
-146
View File
@@ -1,146 +0,0 @@
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_vocabolario : ApplicationUserControl
{
#region gestione eventi
public event EventHandler eh_selezioneValore;
public event EventHandler eh_resetSelezione;
#endregion
#region protected
protected override void traduciObj()
{
base.traduciObj();
btnNewLemma.Text = user_std.UtSn.Traduci("btnNewLemma");
txtNewLemma.Text = "";
TBW_newLemma.WatermarkText = user_std.UtSn.Traduci("insertNewLemma");
}
/// <summary>
/// inserisco nel db il nuovo lemma...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewLemma_Click(object sender, EventArgs e)
{
creaNuovoLemma();
}
/// <summary>
/// creazione nuovo lemma
/// </summary>
private void creaNuovoLemma()
{
if (txtNewLemma.Text != "")
{
// inserisco
DataWrap.DW.creaNuovoLemmaVoc(txtNewLemma.Text.Trim());
// metto in campo ricerca...
memLayer.ML.setSessionVal("valoreCercato", txtNewLemma.Text.Trim());
// svuoto campo text
txtNewLemma.Text = "";
// aggiorno il vocabolario in memoria...
DataWrap.DW.resetVocabolario();
// riparto...
Response.Redirect(_paginaCorrente);
}
}
protected override void aggiornaControlliDataGL()
{
base.aggiornaControlliDataGL();
grView.PageSize = _righeDataGridAnagr;
ods.DataBind();
}
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 = "";
}
}
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
selezionatoValore();
}
private void selezionatoValore()
{
SteamWare.memLayer.ML.setSessionVal("lemma_sel", grView.SelectedDataKey.Values[1]);
if (eh_selezioneValore != null)
{
eh_selezioneValore(this, new EventArgs());
}
}
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
{
// seleziono la riga corrente...
grView.SelectedIndex = e.NewEditIndex;
selezionatoValore();
}
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
selezionatoValore();
}
#endregion
#region area public
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal("lemma_sel");
grView.SelectedIndex = -1;
grView.DataBind();
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
}