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()); } }
public static NOW pesquisarID(int id) { using (var ctx = new NowContext()) { return(ctx.Now.Find(id)); } }
public static void Cadastrar(NOW now) { using (var ctx = new NowContext()) { ctx.Now.Add(now); ctx.SaveChanges(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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); }; }
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); }; }
public static List <NOW> listar() { try { using (var ctx = new NowContext()) { return(ctx.Now.ToList()); } } catch (Exception) { return(null); }; }
/*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(); } }