public void Save() { var store = DynamicDataStoreFactory.Instance.CreateStore(typeof(DynamicComment)); store.Save(this); // Check PageID exist in ListPage if (ListPage == null) { ListPage.Add(DynamicComment.LastComment().PageID); } else { int testIdExitsInList = 0; foreach (int newID in ListPage) { if (newID == LastComment().PageID) { testIdExitsInList = 1; break; } } if (testIdExitsInList == 0) { ListPage.Add(LastComment().PageID); } } }
public DynamicComment(int PageID, String email, String text) { this.IdComment = DynamicComment.LastId().IdComment + 1; this.PageID = PageID; this.Comment = text; this.Email = email; this.TimeComment = DateTime.Now; this.Status = "none"; }