Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 public void UpdateCategory(Category ent)
 {
     this.UpdateEntity(ent);
 }
Exemplo n.º 3
0
 public void RemoveCategory(Category ent)
 {
     this.DeleteEntity(ent);
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
 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];
 }
Exemplo n.º 7
0
 public void SelectedItemChanged(Category cat)
 {
     this.SelectedCategory = cat;
 }