Beispiel #1
0
        private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            YearInfo yearInfo = Database.Current.GetYearInfo((int)e.NavigationParameter);

            this._year          = yearInfo.Number;
            this.pageTitle.Text = yearInfo.Number.ToString();
            this.BriefBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, yearInfo.Brief);
            this.ColorBox.Text = yearInfo.ColorCode;
        }
Beispiel #2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     ((Button)sender).IsEnabled = false;
     try
     {
         string brief;
         this.BriefBox.Document.GetText(Windows.UI.Text.TextGetOptions.UseCrlf, out brief);
         UIHelper.GetColorFromHex(this.ColorBox.Text); //проверка корректности формата
         YearInfo yearInfo = new YearInfo(this._year, brief, this.ColorBox.Text);
         Database.Current.SetYearInfo(yearInfo);
         Frame.GoBack();
     }
     catch
     {
         UIHelper.ShowMessageDialogAsync("Цвет не соответствует формату \"#FFFFFF\"");
     }
     ((Button)sender).IsEnabled = true;
 }
Beispiel #3
0
 /// <summary>
 /// Добавить или изменить информацию о годе
 /// </summary>
 /// <param name="YearInfo"></param>
 public void SetYearInfo(YearInfo YearInfo)
 {
     using (var query = con.Prepare("INSERT OR REPLACE INTO years(year, brief, color) VALUES (" + YearInfo.Number + ",'" + YearInfo.Brief.Shielding() + "','" + YearInfo.ColorCode + "')"))
         query.Step();
 }