public bool Update(SolutionKindNew solution_kind) { // { Func <bool> func = new Func <bool>(() => { // var solutionkind_new = _entity.SolutionKindNew .Where(e => e.Num == solution_kind.Num).FirstOrDefault(); solutionkind_new.Kind = solution_kind.Kind; solutionkind_new.Range = solution_kind.Range; solutionkind_new.Pic1 = solution_kind.Pic1; solutionkind_new.DtUpdate = DateTime.Now; solutionkind_new.UpdateBy = solution_kind.UpdateBy; _entity.Entry(solutionkind_new).State = EntityState.Modified; _entity.SaveChanges(); return(true); }); return(_adapter.Catch <bool>(func)); } }
public bool Update(SolutionNew product) { Func <bool> func = new Func <bool>(() => { _entity.Entry(product).State = EntityState.Modified; _entity.SaveChanges(); return(true); }); return(_adapter.Catch <bool>(func)); }
public bool Insert(ProductNew product) { { Func <bool> func = new Func <bool>(() => { _entity.Entry(product).State = EntityState.Added; _entity.SaveChanges(); return(true); }); return(_adapter.Catch <bool>(func)); } }
public bool Insert(CarouselNew carousel) { { Func <bool> func = new Func <bool>(() => { _entity.Entry(carousel).State = EntityState.Added; _entity.SaveChanges(); return(true); }); return(_adapter.Catch <bool>(func)); } }
public bool Update(NewsKindNew prokind) { { Func <bool> func = new Func <bool>(() => { _entity.Entry(prokind).State = EntityState.Modified; _entity.SaveChanges(); return(true); }); return(_adapter.Catch <bool>(func)); } }
public bool Insert(ProKindNew pro_kind) { { Func <bool> func = new Func <bool>(() => { _entity.Entry(pro_kind).State = EntityState.Added; try { _entity.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } return(true); }); return(_adapter.Catch <bool>(func)); } }