Modifiche struttura dati ed inserimento arrow x spostamento ordine su SCFM

This commit is contained in:
Samuele E. Locatelli
2015-11-27 18:20:55 +01:00
parent efac09035d
commit 8925d382db
16 changed files with 170 additions and 12 deletions
@@ -16,7 +16,7 @@ namespace CMS_SC.WebUserControls
/// </summary>
public event EventHandler eh_selezioneValore;
/// <summary>
/// richeista SAVE (da enter)
/// richiesta SAVE (da enter)
/// </summary>
public event EventHandler eh_reqSave;
/// <summary>
@@ -36,6 +36,21 @@
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CodSchedaVers") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-Width="80px">
<HeaderTemplate>
<%# traduci("moveMis") %>
</HeaderTemplate>
<EditItemTemplate>
</EditItemTemplate>
<ItemTemplate>
<div class="col-xs-6">
<asp:LinkButton ID="lbMoveUp" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="moveUp" OnClick="lb_Click" ToolTip="Move Up" CssClass="fa fa-arrow-up fa-2x" Visible='<%# arrowVisible("UP", Eval("CodFam"), Eval("CodSchedaVers")) %>' />
</div>
<div class="col-xs-6">
<asp:LinkButton ID="lbMoveDown" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="moveDown" OnClick="lb_Click" ToolTip="Move Down" CssClass="fa fa-arrow-down fa-2x" Visible='<%# arrowVisible("DOWN", Eval("CodFam"), Eval("CodSchedaVers")) %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="opz" HeaderText="opz" SortExpression="opz" ControlStyle-Width="4em" />
<asp:BoundField DataField="NumSchede" HeaderText="#" SortExpression="NumSchede" />
<asp:BoundField DataField="Descrizione" HeaderText="Descrizione" SortExpression="Descrizione" ControlStyle-Width="100%" />
@@ -10,7 +10,34 @@ using SteamWare;
namespace CMS_SC.WebUserControls
{
public partial class mod_SchemaCollFamMacc : SteamWare.UserControl
{
{/// <summary>
/// selezione valore in DettScheda
/// </summary>
public event EventHandler eh_selezioneValore;
/// <summary>
/// richiesta SAVE (da enter)
/// </summary>
public event EventHandler eh_reqSave;
/// <summary>
/// sollevo evento selezione
/// </summary>
protected void raiseEvent()
{
// sollevo evento nuovo valore...
if (eh_selezioneValore != null)
{
eh_selezioneValore(this, new EventArgs());
}
}
/// <summary>
/// resetto selezione
/// </summary>
private void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
raiseEvent();
}
protected void Page_Load(object sender, EventArgs e)
{
}
@@ -61,5 +88,89 @@ namespace CMS_SC.WebUserControls
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
}
/// <summary>
/// selezionato valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// verifico se ho un argomento di tipo moveUp / moveDown... quale comando?
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
if (_comando != "")
{
#if false
// SE c'era comando eseguo move...
switch (_comando)
{
case "moveUp":
case "moveDown":
DtProxy.man.taDS.moveUpDown(_comando, CodSchedaSel, VersSel, CodMisuraSel);
break;
case "clone":
DtProxy.man.taDS.clone(memLayer.ML.QSS("CodSchedaVers"), grView.SelectedDataKey["CodMisura"].ToString());
break;
default:
break;
}
#endif
resetSelezione();
}
else
{
raiseEvent();
}
}
/// <summary>
/// salvo in session il prox comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lb_Click(object sender, EventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// determina visibilità frecce spostamento
/// </summary>
/// <param name="direction">direzione: UP / DOWN</param>
/// <param name="_CodFam">CodFam da verificare</param>
/// <param name="_CodSchedaVers">CodSchedaVers da verificare</param>
/// <returns></returns>
public bool arrowVisible(object _direction, object _CodFam, object _CodSchedaVers)
{
bool answ = false;
string direction = _direction.ToString();
string CodFam = _CodFam.ToString();
string CodSchedaVers = _CodSchedaVers.ToString();
if (memLayer.ML.BoolSessionObj("filtByFamMac"))
{
answ = true;
#if false
// 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 = "";
switch (direction)
{
case "UP":
where = string.Format("CodSchedaVers < '{0}'", CodSchedaVers);
break;
case "DOWN":
where = string.Format("CodSchedaVers > '{0}'", CodSchedaVers);
break;
default:
break;
}
answ = tab.Select(where).Length > 0;
#endif
}
return answ;
}
}
}