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