Esempio n. 1
0
 public static List <NOW> pesquisarNome(string pesquisa)
 {
     using (var ctx = new NowContext())
     {
         return(ctx.Now.Where(a => a.Nome.Contains(pesquisa) || a.Descricao.Contains(pesquisa)).ToList());
     }
 }
Esempio n. 2
0
 public static NOW pesquisarID(int id)
 {
     using (var ctx = new NowContext())
     {
         return(ctx.Now.Find(id));
     }
 }
Esempio n. 3
0
 public static void Cadastrar(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Add(now);
         ctx.SaveChanges();
     }
 }
Esempio n. 4
0
 public static void CadastrarCompras(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).Compras        = now.Compras;
         ctx.Now.Find(now.ID_now).Compras_status = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 5
0
 public static void CadastrarQualidade(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).Qualidade        = now.Qualidade;
         ctx.Now.Find(now.ID_now).Qualidade_status = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 6
0
 public static void CadastrarTi(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).TI        = now.TI;
         ctx.Now.Find(now.ID_now).TI_status = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 7
0
 public static void CadastrarFinanceiro(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).Financeiro        = now.Financeiro;
         ctx.Now.Find(now.ID_now).Financeiro_status = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 8
0
 public static void CadastrarProdSoft(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).ProdSoft        = now.ProdSoft;
         ctx.Now.Find(now.ID_now).ProdSoft_status = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 9
0
 public static void CadastrarEngenharia(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).Engenharia           = now.Engenharia;
         ctx.Now.Find(now.ID_now).NecessitaNovaMaquina = now.NecessitaNovaMaquina;
         ctx.Now.Find(now.ID_now).DescricaoMaquina     = now.DescricaoMaquina;
         ctx.Now.Find(now.ID_now).Engenharia_status    = true;
         ctx.SaveChanges();
     }
 }
Esempio n. 10
0
 public static void CadastrarProduto(NOW now)
 {
     using (var ctx = new NowContext())
     {
         ctx.Now.Find(now.ID_now).Produto           = now.Produto;
         ctx.Now.Find(now.ID_now).Produto_status    = true;
         ctx.Now.Find(now.ID_now).Qualidade_status  = now.Qualidade_status == true ? false : true;
         ctx.Now.Find(now.ID_now).Engenharia_status = now.Engenharia_status == true ? false : true;
         ctx.Now.Find(now.ID_now).ProdSoft_status   = now.ProdSoft_status == true ? false : true;
         ctx.Now.Find(now.ID_now).TI_status         = now.TI_status == true ? false : true;
         ctx.SaveChanges();
     }
 }
Esempio n. 11
0
 public static List <NOW> listar()
 {
     try
     {
         using (var ctx = new NowContext())
         {
             return(ctx.Now.Where(a => a.Compras_status == false && a.TI_status == true && a.Engenharia_status == true && a.Produto_status == true).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     };
 }
Esempio n. 12
0
 public static List <NOW> listar()
 {
     try
     {
         using (var ctx = new NowContext())
         {
             return(ctx.Now.Where(a => a.Produto_status == false).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     };
 }
Esempio n. 13
0
 public static List <NOW> listar()
 {
     try
     {
         using (var ctx = new NowContext())
         {
             return(ctx.Now.ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     };
 }
Esempio n. 14
0
        /*public static void CadastrarQualidade(NOW now)
         * {
         *  using (var ctx = new NowContext())
         *  {
         *      ctx.Now.Find(now.ID_now).Qualidade = now.Qualidade;
         *      ctx.Now.Find(now.ID_now).Qualidade_status = true;
         *      ctx.SaveChanges();
         *  }
         * }*/
        #endregion

        #region Cadastrar TI

        /* public static void CadastrarTI(NOW now)
         * {
         *   using (var ctx = new NowContext())
         *   {
         *       ctx.Now.Find(now.ID_now).TI = now.TI;
         *       ctx.Now.Find(now.ID_now).TI_status = true;
         *       ctx.SaveChanges();
         *   }
         * }*/
        #endregion

        #region Editar TUDO
        public static void editarTudo(NOW now)
        {
            using (var ctx = new NowContext())
            {
                ctx.Now.Find(now.ID_now).Nome       = now.Nome;
                ctx.Now.Find(now.ID_now).Descricao  = now.Descricao;
                ctx.Now.Find(now.ID_now).Compras    = now.Compras;
                ctx.Now.Find(now.ID_now).Engenharia = now.Engenharia;
                ctx.Now.Find(now.ID_now).Qualidade  = now.Qualidade;
                ctx.Now.Find(now.ID_now).TI         = now.TI;

                ctx.Now.Find(now.ID_now).Compras_status    = now.Compras_status;
                ctx.Now.Find(now.ID_now).Engenharia_status = now.Engenharia_status;
                ctx.Now.Find(now.ID_now).Qualidade_status  = now.Qualidade_status;
                ctx.Now.Find(now.ID_now).TI_status         = now.TI_status;

                ctx.SaveChanges();
            }
        }