コード例 #1
0
        public string CreaManutentore(string NomeCognome, string Account, decimal IdDitta, string Nota, string account)
        {
            string nomeCognome = correggiString(NomeCognome, 45);
            string utente      = correggiString(Account, 45);
            string nota        = correggiString(Nota, 100);

            using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness())
            {
                bManutenzione.FillManutentori(_ds, false);

                if (_ds.MANUTENTORI.Any(x => x.NOMECOGNOME.Trim() == nomeCognome))
                {
                    return("Manutentore già inserito a sistema");
                }

                ManutenzioneDS.MANUTENTORIRow manutentore = _ds.MANUTENTORI.NewMANUTENTORIRow();

                manutentore.CANCELLATO     = SiNo.No;
                manutentore.DATAMODIFICA   = DateTime.Now;
                manutentore.UTENTEMODIFICA = account;
                manutentore.NOMECOGNOME    = nomeCognome;
                manutentore.ACCOUNT        = utente;
                manutentore.IDDITTA        = IdDitta;
                manutentore.NOTA           = nota;

                _ds.MANUTENTORI.AddMANUTENTORIRow(manutentore);

                bManutenzione.UpdateTable(_ds.MANUTENTORI.TableName, _ds);
            }
            return(string.Empty);
        }
コード例 #2
0
        public void CancellaManutentore(decimal IdManutentore, string account)
        {
            using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness())
            {
                bManutenzione.FillManutentori(_ds, true);
                ManutenzioneDS.MANUTENTORIRow manutentore = _ds.MANUTENTORI.Where(x => x.IDMANUTENTORE == IdManutentore).FirstOrDefault();
                if (manutentore != null)
                {
                    manutentore.CANCELLATO     = SiNo.Si;
                    manutentore.DATAMODIFICA   = DateTime.Now;
                    manutentore.UTENTEMODIFICA = account;

                    bManutenzione.UpdateTable(_ds.MANUTENTORI.TableName, _ds);
                }
            }
        }
コード例 #3
0
        public void ModificaManutentore(decimal IdManutentore, string utente, string nota, string account)
        {
            using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness())
            {
                bManutenzione.FillManutentori(_ds, true);
                ManutenzioneDS.MANUTENTORIRow manutentore = _ds.MANUTENTORI.Where(x => x.IDMANUTENTORE == IdManutentore).FirstOrDefault();
                if (manutentore != null)
                {
                    manutentore.ACCOUNT = correggiString(utente, 45);;
                    manutentore.NOTA    = correggiString(nota, 100);

                    manutentore.DATAMODIFICA   = DateTime.Now;
                    manutentore.UTENTEMODIFICA = account;

                    bManutenzione.UpdateTable(_ds.MANUTENTORI.TableName, _ds);
                }
            }
        }
コード例 #4
0
        public List <ManutentoreModel> CreaListaManutentoreModel()
        {
            List <ManutentoreModel> lista = new List <ManutentoreModel>();

            using (ManutezioneBusiness bManutenzione = new ManutezioneBusiness())
            {
                bManutenzione.FillManutentori(_ds, true);
                bManutenzione.FillDitte(_ds, true);
                bManutenzione.FillRiferimenti(_ds, true);

                foreach (ManutenzioneDS.MANUTENTORIRow d in _ds.MANUTENTORI)
                {
                    lista.Add(CreaManutentoreModel(d, _ds));
                }
            }

            return(lista);
        }
コード例 #5
0
        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);
        }