Exemplo n.º 1
0
        public static void NovoPais()
        {
            using (UnitOfWorkDataBaseCartNew unitOfWork = new UnitOfWorkDataBaseCartNew("contextOraCartNew"))
            {
                //Pais pais = new Pais();
                //pais.NomePais = "Teste id pelo banco realizado em :" + DateTime.Now.ToString();
                //pais.SiglaPais = "TES";
                //pais.CodIbge = "1234";


                Pais pais2 = new Pais();
                pais2.NomePais  = "Teste forneci o id realizado em :" + DateTime.Now.ToString();
                pais2.SiglaPais = "TES2";
                pais2.CodIbge   = "00111";

                unitOfWork.Repositories.GenericRepository <Pais>().Add(pais2);
                Console.WriteLine(pais2.Id);
                //unitOfWork.Repositories.GenericRepository<Pais>().Add(pais2);
                var resultado = unitOfWork.SaveChanges();

                Console.WriteLine(resultado);
            }

            Console.ReadKey();
        }
Exemplo n.º 2
0
        public static void ListaPaizes()
        {
            Console.Clear();
            //Console.WriteLine("----------------------------------------------------------------");
            //Console.WriteLine("***************|       RELATORIO     |**************************");
            //Console.WriteLine("----------------------------------------------------------------");

            using (UnitOfWorkDataBaseCartNew unitOfWork2 = new UnitOfWorkDataBaseCartNew("contextOraCartNew"))
            {
                using (AppServiceModelosDoc appService = new AppServiceModelosDoc(unitOfWork2, 1))
                {
                    //
                }
                //unitOfWork2.SaveChanges();
            }
            Console.ReadKey();
        }
Exemplo n.º 3
0
        public static void ListaMatriculas()
        {
            Console.Clear();
            Console.WriteLine("----------------------------------------------------------------");
            Console.WriteLine("***************|       RELATORIO     |**************************");
            Console.WriteLine("----------------------------------------------------------------");

            using (UnitOfWorkDataBaseCartNew unitOfWork = new UnitOfWorkDataBaseCartNew("contextOraCartNew"))
            {
                List <MATRICULAS> listMatriculas = unitOfWork.Repositories.GenericRepository <MATRICULAS>().GetAll().ToList();

                foreach (var matricula in listMatriculas)
                {
                    Console.WriteLine("  {0}  {1}  {2}  {3}  ", matricula.NUMERO, matricula.HORAENTRADA, matricula.RESPONSAVEL, matricula.MOTIVO);
                }
                Console.WriteLine("----------------------------fim relatório----------------------");
            }

            Console.ReadKey();
        }