/// <summary>
        /// NÃO IMPLEMENTADO - COLOCAR ELE COMO PUBLICO DEPOIS.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="n"></param>
        public void GravaOrdem(Order o, NSAADMEntities n)
        {
            try
            {
                ML_Order Ordem;
                ConverterObjetoMLparaEF cf = new ConverterObjetoMLparaEF();

                Ordem = (from p in n.ML_Order where p.id == o.id select p).FirstOrDefault();
                if (Ordem == null)
                {
                    Ordem = cf.ConverteOrdem(o, n);
                    n.ML_Order.AddObject(Ordem);
                }
                else
                {
                    cf.AtualizaOrdem(Ordem, o, n);
                }

                n.SaveChanges();
            }
            catch (Exception ex)
            {
                throw new Exception("Erro na rotina GravaOrdem.", ex);
            }
        }
        public void GravaPergunta(Question q, NSAADMEntities n)
        {
            try
            {
                var i = (from p in n.ML_Question where p.id_question == q.id select p).First();

                i.status = q.status;

                if (q.from != null)
                {
                    i.answered_questions = q.from.answered_questions;
                }
                if (q.answer != null)
                {
                    i.Answer_date_created = q.answer.date_created;
                    i.Answer_status = q.answer.status;
                    i.Answer_text = q.answer.text;
                }

            }
            catch (Exception)
            {

                ML_Question mlQ = conv.ConverteQuestion(q);

                n.ML_Question.AddObject(mlQ);

            }

            n.SaveChanges();
        }
        public void GravaItem(ML_Item item, NSAADMEntities n)
        {
            ML_Item it = new ML_Item();

            try
            {
                it = (from p in n.ML_Item where p.id == item.id select p).First();

            }
            catch (InvalidOperationException)
            {

                it.id_org = item.id_org;
                it.id = item.id;
                it.title = item.title;
                it.variation_id = item.variation_id;

                n.ML_Item.AddObject(it);

                n.SaveChanges();
            }
            catch (Exception ex)
            {
                throw new Exception("Erro na rotina GravaItem", ex);
            }
        }
        public void GravaPergunta(ML_Question q, NSAADMEntities n)
        {
            try
            {
                var i = (from p in n.ML_Question where p.id == q.id select p).First();

                i.Answer_date_created = q.Answer_date_created;
                i.Answer_status = q.Answer_status;
                i.Answer_text = q.Answer_text;
                i.answered_questions = q.answered_questions;

                n.SaveChanges();

            }
            catch (Exception ex)
            {

                throw new Exception("Erro na rotina GravaPergunta(ML_Question q, NSAADMEntities n)", ex);
            }
        }