Aggiunto rischedula anche in mtz FULL
This commit is contained in:
@@ -182,8 +182,10 @@
|
||||
<div class="col-xs-12">
|
||||
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-info" Text='<%# traduci("Update") %>' Width="100%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-warning">
|
||||
<div class="col-xs-6">
|
||||
<asp:LinkButton ID="btnReschedule" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-default" Width="100%" CommandArgument="Reschedule" Visible='<%# checkResch(Eval("numIntMtz"),Eval("scheduled")) %>'>
|
||||
<asp:LinkButton ID="btnReschedule" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-warning" Width="100%" CommandArgument="Reschedule" Visible='<%# checkResch(Eval("numIntMtz"),Eval("scheduled")) %>'>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i> <%# traduci("ReschMtzProg") %> <i class="fa fa-arrow-right" aria-hidden="true"></i>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,21 @@
|
||||
<div id="divEditFull" style="background-color: #E5E2E1; padding: 10px; border-top: solid 2px orange;">
|
||||
<div class="row">
|
||||
<div class="col-xs-offset-9 col-xs-3">
|
||||
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-info" Text='<%# traduci("Update") %>' Width="100%" />
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-info" Text='<%# traduci("Update") %>' Width="100%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-warning">
|
||||
<div class="col-xs-6">
|
||||
<asp:LinkButton ID="btnReschedule" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn btn-warning" Width="100%" CommandArgument="Reschedule" Visible='<%# checkResch(Eval("numIntMtz"),Eval("scheduled")) %>'>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i> <%# traduci("ReschMtzProg") %> <i class="fa fa-arrow-right" aria-hidden="true"></i>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<uc2:mod_dataOra ID="dtDataRisc" runat="server" valore='<%# DateTime.Today.AddDays(SteamWare.memLayer.ML.CRI("defRetGg")) %>' css="textEv_1" tipoOrario="tendina" mostraLabel="false" Visible='<%# checkResch(Eval("numIntMtz"),Eval("scheduled")) %>' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -1,60 +1,129 @@
|
||||
using System;
|
||||
using GIM_dataLayer;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GIM_site.WebUserControls
|
||||
{
|
||||
public partial class mod_dettInt_full : SteamWare.UserControl
|
||||
public partial class mod_dettInt_full : SteamWare.UserControl
|
||||
{
|
||||
public event EventHandler eh_updated;
|
||||
|
||||
private void raiseEventUpd()
|
||||
{
|
||||
public event EventHandler eh_updated;
|
||||
|
||||
private void raiseEventUpd()
|
||||
{
|
||||
if (eh_updated != null)
|
||||
{
|
||||
eh_updated(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
frmView_full.DataBind();
|
||||
}
|
||||
|
||||
public FormViewMode currMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return frmView_full.CurrentMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
frmView_full.ChangeMode(value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void odsCausali_DataBinding(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// impostazione visibilità modulo ricambi
|
||||
/// </summary>
|
||||
public bool showMR { get; set; }
|
||||
/// <summary>
|
||||
/// modificabilità controlli da parte dell'utente
|
||||
/// </summary>
|
||||
public bool userCanEditData { get; set; }
|
||||
|
||||
|
||||
protected void ods_full_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
raiseEventUpd();
|
||||
}
|
||||
if (eh_updated != null)
|
||||
{
|
||||
eh_updated(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
frmView_full.DataBind();
|
||||
}
|
||||
|
||||
public FormViewMode currMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return frmView_full.CurrentMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
frmView_full.ChangeMode(value);
|
||||
}
|
||||
}
|
||||
|
||||
protected void odsCausali_DataBinding(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// impostazione visibilità modulo ricambi
|
||||
/// </summary>
|
||||
public bool showMR { get; set; }
|
||||
/// <summary>
|
||||
/// modificabilità controlli da parte dell'utente
|
||||
/// </summary>
|
||||
public bool userCanEditData { get; set; }
|
||||
|
||||
|
||||
protected void ods_full_Updated(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
{
|
||||
raiseEventUpd();
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se sia possibile rischedulare intervento (deve essere ULTIMO della serie di mtz programmata...)
|
||||
/// </summary>
|
||||
/// <param name="_numInt"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkResch(object _numInt, object _scheduled)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
bool scheduled = Convert.ToBoolean(_scheduled);
|
||||
if (scheduled)
|
||||
{
|
||||
int numMtz = Convert.ToInt32(_numInt);
|
||||
// in primis: VERIFICO se sia ultimo della serie...
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
public int numIntMtz
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.QSI("numIntMtz");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void frmView_default_ItemUpdating(object sender, FormViewUpdateEventArgs e)
|
||||
{
|
||||
// se è rischedula mi fermo...
|
||||
if (e.CommandArgument.ToString() == "Reschedule")
|
||||
{
|
||||
try
|
||||
{
|
||||
// salvo record corrente con nota rischedulazione alla data
|
||||
DS_applicazione.v_intervExpDataTable tab = TA_app.obj.taInterventiMtz.getByIdx(numIntMtz);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
int idxStChiuso = 3;
|
||||
DS_applicazione.v_intervExpRow riga = tab[0];
|
||||
FormView frm = (FormView)sender;
|
||||
mod_dataOra dataOra = (mod_dataOra)frm.FindControl("dtDataRisc");
|
||||
DateTime newData = dataOra.valore;
|
||||
string notaRisched = string.Format("{0} {1:yyyy.MM.dd}", traduci("notaRiscIntMtzPro"), newData);
|
||||
TA_app.obj.taInterventiMtz.updateIntervento(numIntMtz, idxStChiuso, riga.inizioIntervento, DateTime.Now, riga.isPreventivabile, notaRisched, riga.isFermo, riga.isExt, riga.idxAmbito, riga.idxCausale);
|
||||
e.Cancel = true;
|
||||
// ...sposto intervento alla data schedulata...
|
||||
DS_applicazione.MtzProg_ScadenzeDataTable tabMtzProg = TA_app.obj.taScadenze.GetData(riga.idxIntPro);
|
||||
mtzProgr.obj.taMtzPend.updDataScad(tabMtzProg[0].idxPending, newData, true);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
raiseEventUpd();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user