Prima versione elenco interventi

git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@28 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
samuele
2009-01-22 13:39:05 +00:00
parent 500b200860
commit 95f21867d6
5 changed files with 139 additions and 218 deletions
+15
View File
@@ -13,6 +13,21 @@
color:Black;
}
.semaforoVerde
{
color: Green;
}
.semaforoGiallo
{
color: Orange;
font-weight: bold;
}
.semaforoRosso
{
color: Red;
font-weight: bold;
}
/* @group Calendario */
.calSel
+45 -76
View File
@@ -4,7 +4,7 @@
<div style="width: 100%; background: #cdcdcd;">
area filtraggi vari
</div>
<div>
<div style="font-size: 8pt;">
<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"
@@ -21,100 +21,69 @@
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<%--<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<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) %>' />
&nbsp;
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>'
Visible='<%# isDeletable(Eval("idxImpianto")) %>' />
</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>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>--%>
<asp:BoundField DataField="numIntMtz" HeaderText="numIntMtz" Visible="true" ReadOnly="True"
</asp:TemplateField>
<asp:BoundField DataField="numIntMtz" HeaderText="(#)" Visible="true" ReadOnly="True"
SortExpression="numIntMtz" />
<asp:BoundField DataField="richiesta" HeaderText="richiesta" SortExpression="richiesta" />
<asp:BoundField DataField="dataLav" HeaderText="dataLav" SortExpression="dataLav" />
<asp:BoundField DataField="turnoLav" HeaderText="turnoLav" SortExpression="turnoLav" />
<asp:BoundField DataField="matr" HeaderText="matr" SortExpression="matr" />
<asp:BoundField DataField="guasto" HeaderText="guasto" SortExpression="guasto" />
<asp:BoundField DataField="idxAmbito" HeaderText="idxAmbito" SortExpression="idxAmbito" />
<asp:BoundField DataField="idxPriorita" HeaderText="idxPriorita" SortExpression="idxPriorita" />
<asp:BoundField DataField="isFermo" HeaderText="isFermo" SortExpression="isFermo" />
<asp:BoundField DataField="idxTipo" HeaderText="idxTipo" SortExpression="idxTipo" />
<asp:BoundField DataField="idxImpianto" HeaderText="idxImpianto" SortExpression="idxImpianto" />
<asp:BoundField DataField="idxMacchina" HeaderText="idxMacchina" SortExpression="idxMacchina" />
<asp:BoundField DataField="descrizione" HeaderText="descrizione" SortExpression="descrizione" />
<asp:BoundField DataField="idxStato" HeaderText="idxStato" SortExpression="idxStato" />
<asp:BoundField DataField="presaInCarico" HeaderText="presaInCarico" SortExpression="presaInCarico" />
<asp:BoundField DataField="inizioIntervento" HeaderText="inizioIntervento" SortExpression="inizioIntervento" />
<asp:BoundField DataField="fineIntervento" HeaderText="fineIntervento" SortExpression="fineIntervento" />
<asp:BoundField DataField="descrizioneIntervento" HeaderText="descrizioneIntervento"
SortExpression="descrizioneIntervento" />
<asp:BoundField DataField="isPreventivabile" HeaderText="isPreventivabile" SortExpression="isPreventivabile" />
<asp:BoundField DataField="idxCausale" HeaderText="idxCausale" SortExpression="idxCausale" />
<asp:BoundField DataField="descrAmbitoGuasto" HeaderText="descrAmbitoGuasto" SortExpression="descrAmbitoGuasto" />
<asp:BoundField DataField="descrPriorita" HeaderText="descrPriorita" SortExpression="descrPriorita" />
<asp:BoundField DataField="descrTipo" HeaderText="descrTipo" SortExpression="descrTipo" />
<asp:BoundField DataField="codImpianto" HeaderText="codImpianto" SortExpression="codImpianto" />
<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") %>' ToolTip='<%# formatFermaDalle(Eval("guasto")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="matr" HeaderText="matricola" SortExpression="matr" />
<asp:BoundField DataField="descrAmbitoGuasto" HeaderText="macrocausa" SortExpression="descrAmbitoGuasto" />
<asp:TemplateField HeaderText="lblPrior" SortExpression="descrPriorita">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("descrPriorita") %>' CssClass='<%# stileDaPrior(Eval("idxPriorita")) %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="chkImpFermo" SortExpression="isFermo">
<ItemTemplate>
<asp:CheckBox ID="Label2" runat="server" Checked='<%# Eval("isFermo") %>' Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="descrTipo" HeaderText="lblTipoGuasto" SortExpression="descrTipo" />
<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="DescrStato" HeaderText="DescrStato" SortExpression="DescrStato" />
<asp:BoundField DataField="descrCausale" HeaderText="descrCausale" SortExpression="descrCausale" />
<%--<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<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>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' />
<asp:Button ID="btnReset2" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
</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>
<asp:ImageButton ID="imgSelect2" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
</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>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>--%>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.v_intervExpTableAdapter"
OnInserting="recuperaFooter" FilterExpression=" codImpianto LIKE '%{0}%' OR nomeImpianto LIKE '%{0}%' OR codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' "
OnInserted="ods_Updated" OnUpdated="ods_Updated">
FilterExpression=" codImpianto LIKE '%{0}%' OR nomeImpianto LIKE '%{0}%' OR codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' ">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
+62 -141
View File
@@ -16,128 +16,6 @@ public partial class mod_elencoRichieste : ApplicationUserControl
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
@@ -276,15 +154,6 @@ public partial class mod_elencoRichieste : ApplicationUserControl
#region area codice variabile
/// <summary>
/// verifica complessiva non esistenza record child
/// </summary>
/// <param name="idxObj"></param>
/// <returns></returns>
protected bool objIsNotRelated(object idxObj)
{
return false;// taMacchine.getByIdxFase(idxObj.ToString()).Rows.Count == 0;
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
@@ -331,15 +200,6 @@ public partial class mod_elencoRichieste : ApplicationUserControl
}
}
/// <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>
/// in caso di aggiornamento verifico se sia salvato un comando clona...
/// </summary>
/// <param name="sender"></param>
@@ -371,6 +231,67 @@ public partial class mod_elencoRichieste : ApplicationUserControl
break;
}
}
/// <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;
}
#endregion
}
+16
View File
@@ -45,6 +45,20 @@
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrPriorita") %>'></asp:Label>
</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") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
@@ -73,6 +87,7 @@
<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>
@@ -84,5 +99,6 @@
<InsertParameters>
<asp:Parameter Name="idxPriorita" Type="Int32" />
<asp:Parameter Name="descrPriorita" Type="String" />
<asp:Parameter Name="stile" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
+1 -1
View File
@@ -90,7 +90,7 @@ public partial class mod_priorita : ApplicationUserControl
{
logger.lg.scriviLog("Errore nel recupero del max idx di prorità", tipoLog.EXCEPTION);
}
taPrior.Insert(nextFree, "-- [NUOVA] non definita --");
taPrior.Insert(nextFree, "-- [NUOVA] non definita --", "semaforoVerde");
grView.DataBind();
}
}