Esempio n. 1
0
        // Insert Seccao
        public static int I2()
        {
            Console.WriteLine("Create Seccao");
            Console.Write("Sigla? = ");
            var sigla = Console.ReadLine();

            Console.Write("Departamento? = ");
            var dep = Console.ReadLine();

            Console.Write("Coordenador? = ");
            var c = Console.ReadLine();

            Console.Write("Descricao? = ");
            var    desc = Console.ReadLine();
            Seccao d    = new Seccao
            {
                Sigla        = sigla,
                Departamento = dep,
                Coordenador  = c,
                Descricao    = desc
            };
            Seccao ans = InsertFuncions.CreateSeccao(d);

            if (ans.Sigla == null)
            {
                Console.WriteLine("An error has ocurred. Seccao wasn't created.");
                return(-1);
            }
            else
            {
                Console.WriteLine("Seccao {0} was created, with the following parameters : {1}, {2}, {3}.", ans.Sigla, ans.Departamento, ans.Coordenador, ans.Descricao);
                return(0);
            }
        }
Esempio n. 2
0
        public static void CreateSeccao(string sigla, string departamento, string coordenador, string descricao)
        {
            Seccao s = new Seccao();

            s.Sigla        = sigla;
            s.Departamento = departamento;
            s.Coordenador  = coordenador;
            s.Descricao    = descricao;
            s = InsertFuncions.CreateSeccao(s);
            Console.WriteLine("Seccao " + s.Sigla + "\t" + " created");
        }