void fillPgae(DiaryPage currentPage) { dateText.text = currentPage.getDate(); contentTextLeft.text = currentPage.getContentLeft(); contentTextRight.text = currentPage.getContentRight(); WeatherText.text = currentPage.getWeather(); }
private void UpdatePageEntity(EditPageRequest editPageRequest) { DiaryPage page = _pageRepository.GetPageById(editPageRequest.DiaryId, editPageRequest.PageId); page.Title = editPageRequest.Title; _diaryModifier.UpdatePage(page); }
public async Task <IActionResult> Create([Bind("Title,Message")] DiaryPage diaryPage) { if (ModelState.IsValid) { if (diaryPage.Title == null || diaryPage.Message == null) { return(View()); } diaryPage.Type = DiaryPageType.User; diaryPage.GameId = (Guid)GameId(); diaryPage.CharacterId = (await GetCharacter()).Id; diaryPage.DateTime = DateTime.UtcNow; _context.Diary.Add(diaryPage); await _context.SaveChangesAsync();; return(RedirectToAction(nameof(Index), "InGame", null)); } var game = await GameAsync(); if (IsMaster(game)) { ViewData["IsMaster"] = "true"; ViewData["Id"] = game.Id; } return(View(diaryPage)); }
public void UpdatePage(DiaryPage page) { using (var dbContext = new TripMeContext()) { dbContext.DiaryPages.AddOrUpdate(page); dbContext.SaveChanges(); } }
public void CreateNewPage(DiaryPage page) { using (var dbContext = new TripMeContext()) { dbContext.DiaryPages.Add(page); dbContext.SaveChanges(); } }
public long CreateNewDiaryPage(AddNewPageRequest newPageRequest) { DiaryPage newPage = Mapper.Map <DiaryPage>(newPageRequest); _diaryModifier.CreateNewPage(newPage); StorePageReviews(newPage.PageId, newPageRequest.Reviews); return(newPage.PageId); }
//create new page when a day is end(either because tired, time or die) public void createNewPage() { //create a new page with current info DiaryPage newPage = new DiaryPage((int)Mathf.Round(day), weathers, currentWeather, events); pageList.Add(newPage); showDiary(); //clear current info for next day //day and weather is alreay subscribed sp we don't need to modify it events.Clear(); weathers.Clear(); }
public ItemDetailPage() { InitializeComponent(); var item = new DiaryPage { Title = "Item 1", Description = "This is an item description." }; viewModel = new ItemDetailViewModel(item); BindingContext = viewModel; }
// Opens the given page and starts the input delay timer. This deactivates all pages, while it activates the page that matches the enum index. public void OpenPage(DiaryPage newPage, List <Reaction> triggerOnClose) { inputDelayTimer = 0.1f; currentPage = newPage; this.triggerOnClose = triggerOnClose; int index = (int)newPage - 1; for (int i = 0; i < pageObjects.Count; i++) { pageObjects[i].SetActive(i == index); } player.enabled = newPage == DiaryPage.none; }
public DiaryPageDto GetPageById(long diaryId, long pageId) { DiaryPage page = _pageRepository.GetPageById(diaryId, pageId); if (page == null) { return(null); } DiaryPageDto diaryPageDto = Mapper.Map <DiaryPageDto>(page); Dictionary <Guid, ReviewQuestionnaireAnswerDto> pageReviews = _reviewGetter.GetPageReviews(pageId); diaryPageDto.Reviews = pageReviews; return(diaryPageDto); }
public async Task <ActionResult <DiaryPage> > PostDiaryPage([FromBody] DiaryPage diaryPage, string id) { var diary = await _context.Diaries.FindAsync(id); if (diary == null) { return(NotFound()); } diaryPage.diary = await _context.Diaries.FindAsync(id); _context.Pages.Add(diaryPage); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDiaryPage", new DiaryPageResource { id = diaryPage.id, number = diaryPage.number, text = diaryPage.text })); }
void displayContent(int pageIndex) { if (pageIndex == 0) { previousButton.SetActive(false); if (pageList.Count <= 1) { nextButton.SetActive(false); } } else if (pageIndex == pageList.Count - 1) { nextButton.SetActive(false); previousButton.SetActive(true); } else { previousButton.SetActive(true); nextButton.SetActive(true); } DiaryPage currentPage = pageList[pageIndex]; fillPgae(currentPage); }
public ItemDetailViewModel(DiaryPage item = null) { Title = item?.Title; Item = item; }
private async void EditItem(DiaryPage item) { await App.Current.MainPage.Navigation.PushModalAsync(new NavigationPage(new NewItemPage(item))); }
public NewItemPage(DiaryPage item) { InitializeComponent(); Item = item; BindingContext = this; }