public static void Update(EquGroupVM item) { EquGroup dbItem = GetSingleById(item.Id); dbItem.UpdateEquGroup(item); RepositoryBase <EquGroup> .Update(dbItem); RepositoryBase <EquGroup> .SaveChanges(); }
public static EquGroup Add(EquGroupVM item) { EquGroup dbItem = new EquGroup(); dbItem.UpdateEquGroup(item); dbItem.Id = item.Id; dbItem.Actived = item.Actived; dbItem.CreatedDate = DateTime.Now; dbItem.CreatedBy = HttpContext.Current.User.Identity.Name; EquGroup model = RepositoryBase <EquGroup> .Add(dbItem); RepositoryBase <EquGroup> .SaveChanges(); return(dbItem); }