Пример #1
0
        public void ExecuteEnt()
        {
            prms = InfoGetter(prms);
            int    id;
            string tipo;

            try
            {
                tipo = prms[0];
                id   = Convert.ToInt32(prms[1]);
            }
            catch (FormatException)
            {
                Console.WriteLine("Alguns parametros estavam errados.");
                return;
            }
            using (var ctx = new GlampinhoEntities())
            {
                try
                {
                    ctx.UpdateExtraAloj(id, tipo);
                    ctx.SaveChanges();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.InnerException.Message);
                    return;
                }
            }

            Console.WriteLine("Extra de Alojamento atualizado com sucesso!");
        }