public void AddText(Text ent) { using (ISession session = NHibernateHelper.OpenSession()) { Text t = this.GetTextById(ent.TextID); if (t != null) { ent.ID = t.ID; this.UpdateEntity(ent); } else this.AddEntity(ent); } }
public void RemoveText(Text ent) { this.DeleteEntity(ent); }
public void UpdateText(Text ent) { this.UpdateEntity(ent); }
private void doTexts(string xmlContent) { IBombaJobRepository repo = new BombaJobRepository(); XDocument doc = XDocument.Parse(xmlContent); foreach (XElement txt in doc.Descendants("tctxt")) { var t = new Text { TextID = (int)txt.Attribute("id"), Title = (string)txt.Element("tctitle"), Content = (string)txt.Element("tccontent") }; repo.AddText(t); } this.syncCategories(); }