public static void VersionPost(Post old_Post) { VersionStore vs = new VersionStore(); vs.Type = "post/xml"; vs.ItemId = old_Post.Id; vs.Name = "Post:" + old_Post.Id; vs.UniqueId = Guid.NewGuid(); vs.Data = old_Post.ToXML(); vs.Version = old_Post.Version; vs.Save(GraffitiUsers.Current.Name); }
public static int VersionFile(FileInfo fi) { VersionStore vs = new VersionStore(); vs.Name = fi.FullName; vs.Version = CurrentVersion(fi) + 1; vs.Type = Util.GetMapping(fi.FullName); vs.UniqueId = Guid.NewGuid(); using (StreamReader sr = new StreamReader(fi.FullName)) { vs.Data = sr.ReadToEnd(); sr.Close(); } vs.Save(GraffitiUsers.Current.Name, SiteSettings.CurrentUserTime); return vs.Id; }
public static int VersionFile(FileInfo fi) { VersionStore vs = new VersionStore(); vs.Name = fi.FullName; vs.Version = CurrentVersion(fi) + 1; vs.Type = Util.GetMapping(fi.FullName); vs.UniqueId = Guid.NewGuid(); using (StreamReader sr = new StreamReader(fi.FullName)) { vs.Data = sr.ReadToEnd(); sr.Close(); } vs.Save(GraffitiUsers.Current.Name, SiteSettings.CurrentUserTime); return(vs.Id); }
public static void VersionPost(Post old_Post) { VersionStore vs = new VersionStore(); vs.Type = "post/xml"; vs.ItemId = old_Post.Id; vs.Name = "Post:" + old_Post.Id; vs.UniqueId = Guid.NewGuid(); vs.Data = old_Post.ToXML(); vs.Version = old_Post.Version; vs.Save(GraffitiUsers.Current.Name); }