public bool TerminaAttivita(string BarcodeLavoratore, string BarcodeOLD, string Nota, decimal Quantita) { try { RilevazioniDS ds = new RilevazioniDS(); using (RilevazioneBusiness bRilevazione = new RilevazioneBusiness()) { bRilevazione.FillRW_TEMPI_APERTI(ds, BarcodeLavoratore); RilevazioniDS.RW_TEMPIRow tempo = ds.RW_TEMPI.FirstOrDefault(); if (tempo.BARCODE_ODL != BarcodeOLD) { return(false); } tempo.APERTO = 0; tempo.FINE = DateTime.Now; tempo.NOTA = Nota.Length > 100 ? Nota.Substring(0, 100) : Nota; tempo.QUANTITA = Quantita; bRilevazione.UpdateRW_TEMPI(ds); return(true); } } catch { return(false); } }
public bool InizioAttivita(string Utente, string Lavorazione) { try { RilevazioniDS ds = new RilevazioniDS(); using (RilevazioneBusiness bRilevazione = new RilevazioneBusiness()) { RilevazioniDS.RW_TEMPIRow tempo = ds.RW_TEMPI.NewRW_TEMPIRow(); tempo.APERTO = 1; tempo.UTENTE = Utente; tempo.IDDATO = bRilevazione.GetID(); tempo.LAVORAZIONE = (Lavorazione.Length > 100) ? Lavorazione.Substring(0, 100) : Lavorazione; tempo.INIZIO = DateTime.Now; ds.RW_TEMPI.AddRW_TEMPIRow(tempo); bRilevazione.UpdateRW_TEMPI(ds); return(true); } } catch { return(false); } }
public string CaricaSchedaAperto(string Utente) { RilevazioniDS ds = new RilevazioniDS(); using (RilevazioneBusiness bRilevazione = new RilevazioneBusiness()) { bRilevazione.FillRW_TEMPI_APERTI_PER_UTENTE(ds, Utente); RilevazioniDS.RW_TEMPIRow tempoAperto = ds.RW_TEMPI.FirstOrDefault(); if (tempoAperto == null) { return(string.Empty); } return(tempoAperto.LAVORAZIONE); } }
public string CaricaSchedaAperto(string BarcodeLavoratore, out string BarcodeOdl) { BarcodeOdl = string.Empty; RilevazioniDS ds = new RilevazioniDS(); using (RilevazioneBusiness bRilevazione = new RilevazioneBusiness()) { bRilevazione.FillRW_TEMPI_APERTI(ds, BarcodeLavoratore); RilevazioniDS.RW_TEMPIRow tempoAperto = ds.RW_TEMPI.FirstOrDefault(); if (tempoAperto == null) { return(string.Empty); } BarcodeOdl = tempoAperto.BARCODE_ODL; return(tempoAperto.LAVORAZIONE); } }
public bool TerminaAttivita(string Utente, string Nota, decimal Quantita) { try { RilevazioniDS ds = new RilevazioniDS(); using (RilevazioneBusiness bRilevazione = new RilevazioneBusiness()) { bRilevazione.FillRW_TEMPI_APERTI_PER_UTENTE(ds, Utente); RilevazioniDS.RW_TEMPIRow tempo = ds.RW_TEMPI.FirstOrDefault(); tempo.APERTO = 0; tempo.FINE = DateTime.Now; tempo.NOTA = Nota.Length > 100 ? Nota.Substring(0, 100) : Nota; tempo.QUANTITA = Quantita; bRilevazione.UpdateRW_TEMPI(ds); return(true); } } catch { return(false); } }