public void ModificaIntervento(decimal IdIntervento, DateTime Data, string Stato, decimal Durata, decimal IdManutentore, string Frequenza, string Nota, string account) { using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness()) { bManutenzione.FillInterventi(_ds, true); ManutenzioneDS.INTERVENTIRow intervento = _ds.INTERVENTI.Where(x => x.IDINTERVENTO == IdIntervento).FirstOrDefault(); if (intervento == null) { return; } intervento.DATAMODIFICA = DateTime.Now; intervento.UTENTEMODIFICA = account; intervento.DURATA = Durata; if (IdManutentore > 0) { intervento.IDMANUTENTORE = IdManutentore; } if (IdManutentore == -1) { intervento.SetIDMANUTENTORENull(); } intervento.FREQUENZA = correggiString(Frequenza, 20); intervento.NOTE = correggiString(Nota, 200); intervento.DATAINTERVENTO = Data; intervento.STATO = correggiString(Stato, 25); bManutenzione.UpdateTable(_ds.INTERVENTI.TableName, _ds); } }
public void CancellaIntervento(decimal IdIntervento, string account) { using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness()) { bManutenzione.FillInterventi(_ds, true); ManutenzioneDS.INTERVENTIRow intervento = _ds.INTERVENTI.Where(x => x.IDINTERVENTO == IdIntervento).FirstOrDefault(); if (intervento != null) { intervento.CANCELLATO = SiNo.Si; intervento.DATAMODIFICA = DateTime.Now; intervento.UTENTEMODIFICA = account; bManutenzione.UpdateTable(_ds.INTERVENTI.TableName, _ds); } } }
public List <InterventoModel> CreaListaInterventoModel() { List <InterventoModel> lista = new List <InterventoModel>(); using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness()) { bManutenzione.FillMacchine(_ds, true); bManutenzione.FillManutentori(_ds, true); bManutenzione.FillInterventi(_ds, true); foreach (ManutenzioneDS.INTERVENTIRow d in _ds.INTERVENTI) { lista.Add(CreaInterventoModel(d, _ds)); } } return(lista); }