128 lines
3.3 KiB
C#
128 lines
3.3 KiB
C#
using GIM_dataLayer;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace GIM_site.WebUserControls
|
|
{
|
|
public partial class mod_dettInt_default : SteamWare.UserControl
|
|
{
|
|
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_default.DataBind();
|
|
}
|
|
|
|
public FormViewMode currMode
|
|
{
|
|
get
|
|
{
|
|
return frmView_default.CurrentMode;
|
|
}
|
|
set
|
|
{
|
|
frmView_default.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_default_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();
|
|
}
|
|
}
|
|
} |