public void AddSortMenuItems(IList <FoxeSort> sortItems)
 {
     foreach (FoxeSort sortItem in sortItems)
     {
         try
         {
             dbcontext.SortItems.Add(sortItem);
             dbcontext.SaveChanges();
         }
         catch (Exception e)
         {
             // LOG ERROR
             Console.WriteLine(e.ToString());
         }
     }
 }
示例#2
0
 void jobNotifications_JobCompleted(object sender, JobCompletedEventArgs e)
 {
     //string msgtext = "Downloaded " + e.FoxeProducts.Count + " Products";
     //string txt = "Status";
     //MessageBoxButton button = MessageBoxButton.YesNoCancel;
     //MessageBoxResult result = MessageBox.Show(msgtext, txt, button);
     try
     {
         foxeContext.Products.AddRange(e.FoxeProducts);
         foxeContext.SaveChanges();
     }
     catch (Exception exp)
     {
         LogManager.WriteToLog(new LogMessage()
         {
             Message = exp.Message
         });
     }
 }