예제 #1
0
        public HaikuWindow()
        {
            InitializeComponent();
            uxHaikuList.DataContext = MainViewModel.Recents;
            Lorry.Main.Recent recentHaiku = MainViewModel.Recents.Where(t => t.RecentType == "haiku").LastOrDefault();
            uxHaikuRecent.DataContext = recentHaiku.RecentContent;

            uxHaikuList.ItemsSource = MainViewModel.Recents.Where(t => t.RecentType == "haiku");

            uxHaikuRecent.Content = recentHaiku.RecentContent;
        }
예제 #2
0
        public Lorry.Main.Recent SaveRecent(Lorry.Main.Recent inputObject)
        {
            Lorry.Repository.IDatabaseRepository <Repository.Recents.Recent> getRecent = new Lorry.Repository.Recents.RecentRepository();

            if (inputObject.RecentId > 0)
            {
                return(getRecent.Update(inputObject.ToRepositoryModel()).ToUIModel());
            }
            else
            {
                return(getRecent.Insert(inputObject.ToRepositoryModel()).ToUIModel());
            }
        }
예제 #3
0
 /// <summary>
 /// Converts Lorry.Main.Recent object to Database object Lorry.Database.Recent for CRUD operations.
 /// </summary>
 /// <param name="databaseObject"></param>
 /// <returns></returns>
 public static Lorry.Repository.Recents.Recent ToRepositoryModel(this Lorry.Main.Recent applicationObject)
 {
     return(mapper.Map <Lorry.Repository.Recents.Recent>(applicationObject));
 }