public void AddCategory(Category ent) { using (ISession session = NHibernateHelper.OpenSession()) { Category t = this.GetCategoryById(ent.CategoryID); if (t != null) { ent.ID = t.ID; this.UpdateEntity(ent); } else this.AddEntity(ent); } }
public void UpdateCategory(Category ent) { this.UpdateEntity(ent); }
public void RemoveCategory(Category ent) { this.DeleteEntity(ent); }
private void doCategories(string xmlContent) { IBombaJobRepository repo = new BombaJobRepository(); XDocument doc = XDocument.Parse(xmlContent); foreach (XElement cat in doc.Descendants("cat")) { var t = new Category { CategoryID = (int)cat.Attribute("id"), Title = (string)cat.Element("cttl"), OffersCount = (int)cat.Attribute("cnt") }; repo.AddCategory(t); } this.syncNewestOffers(); }
private void PostFinished() { if (Properties.Settings.Default.stPrivateData) Properties.Settings.Default.stPDEmail = this.OfferEmail; this.SelectedCategory = this.Categories[0]; this.IsHuman = true; this.SetLabels(this.IsHuman); this.OfferFreelance = true; this.OfferTitle = ""; this.OfferEmail = ""; this.OfferPositiv = ""; this.OfferNegativ = ""; NotifyOfPropertyChange(() => SelectedCategory); NotifyOfPropertyChange(() => IsHuman); NotifyOfPropertyChange(() => OfferFreelance); NotifyOfPropertyChange(() => OfferTitle); NotifyOfPropertyChange(() => OfferEmail); NotifyOfPropertyChange(() => OfferPositiv); NotifyOfPropertyChange(() => OfferNegativ); this.tabm.StopLoading(); Caliburn.Micro.Execute.OnUIThread(() => IoC.Get<IWindowManager>().ShowMessageBox(Properties.Resources.offer_ThankYou, Properties.Resources.offer_Boom, MessageBoxButton.OK)); }
private void LoadCategories() { if (this.dbRepo == null) this.dbRepo = new BombaJobRepository(); this.Categories = this.dbRepo.GetCategories(); NotifyOfPropertyChange(() => Categories); if (this.Categories != null && this.Categories.Count > 0) this.SelectedCategory = this.Categories[0]; }
public void SelectedItemChanged(Category cat) { this.SelectedCategory = cat; }