public static List <Cotizaciones> GetList(Expression <Func <Cotizaciones, bool> > filter) { List <Cotizaciones> Lista = null; try { ContextoCot dbase = new ContextoCot(); Lista = dbase.Co.Where(filter).ToList(); } catch (Exception) { throw; } return(Lista); }
public static Cotizaciones Buscar(int Id) { Cotizaciones cotizacion = new Cotizaciones(); try { ContextoCot dbase = new ContextoCot(); cotizacion = dbase.Co.Find(Id); } catch (Exception) { throw; } return(cotizacion); }
public static bool Modificar(Cotizaciones Co) { bool paso = false; try { ContextoCot dbase = new ContextoCot(); dbase.Entry(Co).State = EntityState.Modified; dbase.SaveChanges(); paso = true; } catch (Exception) { throw; } return(paso); }
public static bool Guardar(Cotizaciones Co) { bool paso = false; try { ContextoCot dbase = new ContextoCot(); dbase.Co.Add(Co); dbase.SaveChanges(); paso = true; } catch (Exception) { throw; } return(paso); }
public static bool Eliminar(int Id) { bool paso = false; try { ContextoCot dbase = new ContextoCot(); Cotizaciones Cot = dbase.Co.Find(Id); dbase.Co.Remove(Cot); dbase.SaveChanges(); paso = true; } catch (Exception) { throw; } return(paso); }