Fix gestioen delete (solo ULTIMO valore)

This commit is contained in:
Samuele E. Locatelli
2015-06-10 10:13:58 +02:00
parent cacd59f490
commit dba89cf6b9
8 changed files with 23 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -56,7 +56,7 @@
&nbsp;<asp:LinkButton ID="lbCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip="Cancel" CssClass="fa fa-undo fa-2x" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" ToolTip="Delete" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' CssClass="fa fa-trash fa-2x" />
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" ToolTip="Delete" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' CssClass="fa fa-trash fa-2x" Visible='<%# delEnabled(Eval("CodMisura")) %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
+22 -1
View File
@@ -163,7 +163,7 @@ namespace CMS_SC.WebUserControls
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
// SE c'era comando eseguo move...
if(_comando!="")
if (_comando != "")
{
DtProxy.man.taDS.moveUpDown(_comando, CodSchedaSel, VersSel, CodMisuraSel);
grView.DataBind();
@@ -208,5 +208,26 @@ namespace CMS_SC.WebUserControls
}
return answ;
}
/// <summary>
/// determina visibilità delete (solo se è ultima misura)
/// </summary>
/// <param name="direction">direzione: UP / DOWN</param>
/// <param name="CodMisura">CodMisura da verificare</param>
/// <returns></returns>
public bool delEnabled(object _CodMisura)
{
bool answ = false;
string CodMisura = _CodMisura.ToString();
if (memLayer.ML.QSS("CodSchedaVers") != "")
{
// recupero TUTTE le righe della scheda dett corrente
DS_Applicazione.DettSchedaDataTable tab = DtProxy.man.taDS.getByScheda(memLayer.ML.QSS("CodSchedaVers"));
// a seconda della direzione CERCO se ci siano misure prima/dopo...
string where = string.Format("CodMisura > '{0}'", CodMisura);
answ = tab.Select(where).Length == 0;
}
return answ;
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.