예제 #1
0
        // Update Departamento
        public static int U1()
        {
            Console.WriteLine("Update Departamento");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Descricao? = ");
            var          desc = Console.ReadLine();
            Departamento d    = new Departamento();
            Departamento ans  = new Departamento();

            d.Sigla     = sigla;
            d.Descricao = desc;
            ans         = UpdateFunctions.UpdateDepartamento(d);
            if (ans == null)
            {
                Console.WriteLine("An error has ocurred. Department wasn't updated.");
                return(-1);
            }
            else
            {
                Console.WriteLine("Department {0} was updated with description \"{1}\".", ans.Sigla, ans.Descricao);
                return(0);
            }
        }
예제 #2
0
        public static void TesteUpdateDepartamento(string sigla, string desc)
        {
            Departamento d = new Departamento();

            d.Sigla     = sigla;
            d.Descricao = desc;
            d           = UpdateFunctions.UpdateDepartamento(d);
            Console.WriteLine("Departamento " + d.Sigla + "\t" + "updated with descrpition " + d.Descricao);
        }