public void alteraStatusDesativo(MotivosLiberacao mot)
        {
            var motivoOriginal = context.motivos.Find(mot.MotivosLiberacaoId);

            if (motivoOriginal != null)
            {
                motivoOriginal.ativado = false;
                context.SaveChanges();
            }
        }
Exemple #2
0
        public void ativaMotivo(string nome)
        {
            var motivos          = im.getMotivos();
            MotivosLiberacao aux = new MotivosLiberacao();

            foreach (MotivosLiberacao reasons in motivos)
            {
                if (reasons.motivo.Equals(nome))
                {
                    aux = reasons;
                }
            }
            im.ativa(aux);
        }
        public MotivosLiberacao getMotivoById(int id)
        {
            MotivosLiberacao motivo;
            var motivos = getMotivos();

            foreach (MotivosLiberacao motiv in motivos)
            {
                if (motiv.MotivosLiberacaoId == id)
                {
                    motivo = motiv;
                    return(motivo);
                }
            }
            motivo        = new MotivosLiberacao();
            motivo.motivo = "Not Found :o";
            return(motivo);
        }
        public void alteraStatusAtivado(MotivosLiberacao mot)
        {
            var motivos        = getMotivos();
            var motivoOriginal = context.motivos.Find(mot.MotivosLiberacaoId);

            if (motivoOriginal != null)
            {
                foreach (MotivosLiberacao motiv in motivos)
                {
                    var motivoFalse = context.motivos.Find(motiv.MotivosLiberacaoId);
                    motivoFalse.ativado = false;
                    context.SaveChanges();
                }
                motivoOriginal.ativado = true;
                context.SaveChanges();
            }
        }
Exemple #5
0
 public void desativa(MotivosLiberacao mot)
 {
     ml.alteraStatusDesativo(mot);
 }
Exemple #6
0
 public void ativa(MotivosLiberacao mot)
 {
     ml.alteraStatusAtivado(mot);
 }
 public void Add(MotivosLiberacao mot)
 {
     context.motivos.Add(mot);
     context.SaveChanges();
 }
 public void Update(MotivosLiberacao mot)
 {
     throw new NotImplementedException();
 }