예제 #1
0
 //Última data de inserção do REP
 public void CadastraUltimaColeta(int IDREP, DateTime DTUltimaColeta)
 {
     DataSetREPTableAdapters.TBREPColetaTableAdapter adpColetaREP = new DataSetREPTableAdapters.TBREPColetaTableAdapter();
     try
     {
         adpColetaREP.Insert(IDREP, DTUltimaColeta);
     }
     catch (Exception ex)
     {
     }
 }
예제 #2
0
        //Última coleta da REP
        public DateTime UltimaColetaREP(DataSetREP ds, int IDREP)
        {
            DataSetREPTableAdapters.TBREPColetaTableAdapter adpREPColeta = new DataSetREPTableAdapters.TBREPColetaTableAdapter();
            DateTime dd = new DateTime(1900, 01, 01);

            try
            {
                adpREPColeta.FillIDREP(ds.TBREPColeta, IDREP);
                dd = ds.TBREPColeta[0].DTUltimaColeta;
            }
            catch (System.Data.OleDb.OleDbException ex)
            {
                ex.ToString();
            }
            catch (Exception ex)
            {
                ex.ToString();
            }

            return(dd);
        }
예제 #3
0
        //Para ultima coleta quando for cadastro de usuário

        public void CadastraUltimaColetaUsuario(int IDREP, DateTime DTUltimaColeta, string DT)
        {
            DataSetREPTableAdapters.TBREPColetaTableAdapter adpColeta = new DataSetREPTableAdapters.TBREPColetaTableAdapter();
            DataSetREP.TBREPColetaDataTable TBcoleta = new DataSetREP.TBREPColetaDataTable();

            adpColeta.FillIDREPColeta(TBcoleta, IDREP, DT);

            if (TBcoleta.Rows.Count == 0)
            {
                try
                {
                    adpColeta.Insert(IDREP, DTUltimaColeta);
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                adpColeta.UpdateUltimaColeta(DTUltimaColeta, IDREP);
            }
        }