|
@@ -3,6 +3,8 @@ using Avalonia.Interactivity;
|
|
|
using Avalonia.Media;
|
|
|
using Avalonia.Styling;
|
|
|
using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
|
|
namespace Task1
|
|
|
{
|
|
@@ -33,7 +35,7 @@ namespace Task1
|
|
|
InfoYear.Text = Convert.ToString(separateYear) + " ëåò " + Convert.ToString(separateMonth) + " ìåñÿöåâ " + Convert.ToString(separateDay) + " äíåé.";
|
|
|
InfoDay.Text = Convert.ToString((today - dateUsed).TotalDays) + " äíåé ";
|
|
|
|
|
|
- WeekDay.Text = Convert.ToString(dateUsed.DayOfWeek);
|
|
|
+ WeekDay.Text = "Äåíü íåäåëè: " + Convert.ToString(dateUsed.DayOfWeek);
|
|
|
DateTime buffer = dateUsed;
|
|
|
while (buffer <= today)
|
|
|
{
|
|
@@ -48,16 +50,74 @@ namespace Task1
|
|
|
BirthDates.Children.Add(BDate);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ ShowPanelDate.IsVisible = true;
|
|
|
+ Calendars.IsVisible = true;
|
|
|
}
|
|
|
catch(Exception ex) {
|
|
|
- Info.Text = ex.Message;
|
|
|
}
|
|
|
|
|
|
- ShowPanelDate.IsVisible = true;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Button_Click_CalendarEastern(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ ShowPanelDate.IsVisible = false;
|
|
|
+ Calendars.IsVisible = false;
|
|
|
+ Backbutton.IsVisible = true;
|
|
|
+ EasternGoro.IsVisible = true;
|
|
|
+ ButtonShow.IsVisible = false;
|
|
|
+ }
|
|
|
+ private void Button_Click_CalendarZodiac(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ Backbutton.IsVisible = true;
|
|
|
+ EasternGoro.IsVisible= false;
|
|
|
+ ShowPanelDate.IsVisible = false;
|
|
|
+ Calendars_Buttons.IsVisible = false;
|
|
|
+
|
|
|
+ List<string> Signs = new List<string>() { "Âîäîëåé", "Ðûáû", "Îâåí", "Òåëåö", "Áëèçíåöû", "Ðàê", "Ëåâ", "Äåâà", "Âåñû", "Ñêîðïèîí", "Ñòðåëåö", "Êîçåðîã" };
|
|
|
+
|
|
|
|
|
|
+ string date = DatePick.SelectedDate.ToString();
|
|
|
+ DateTime dateUsed = Convert.ToDateTime(date);
|
|
|
+ switch (dateUsed.Month)
|
|
|
+ {
|
|
|
+ case 1: { if (dateUsed.Day >= 20) { ZodiacSign.Text = Signs[0]; } else { ZodiacSign.Text = Signs[11]; } break; }
|
|
|
+ case 2: { if (dateUsed.Day >= 20) { ZodiacSign.Text = Signs[1]; } else { ZodiacSign.Text = Signs[0]; } break; }
|
|
|
+ case 3: { if (dateUsed.Day >= 21) { ZodiacSign.Text = Signs[2]; } else { ZodiacSign.Text = Signs[1]; } break; }
|
|
|
+ case 4: { if (dateUsed.Day >= 20) { ZodiacSign.Text = Signs[3]; } else { ZodiacSign.Text = Signs[2]; } break; }
|
|
|
+ case 5: { if (dateUsed.Day >= 21) { ZodiacSign.Text = Signs[4]; } else { ZodiacSign.Text = Signs[3]; } break; }
|
|
|
+ case 6: { if (dateUsed.Day >= 21) { ZodiacSign.Text = Signs[5]; } else { ZodiacSign.Text = Signs[4]; } break; }
|
|
|
+ case 7: { if (dateUsed.Day >= 23) { ZodiacSign.Text = Signs[6]; } else { ZodiacSign.Text = Signs[5]; } break; }
|
|
|
+ case 8: { if (dateUsed.Day >= 23) { ZodiacSign.Text = Signs[7]; } else { ZodiacSign.Text = Signs[6]; } break; }
|
|
|
+ case 9: { if (dateUsed.Day >= 23) { ZodiacSign.Text = Signs[8]; } else { ZodiacSign.Text = Signs[7]; } break; }
|
|
|
+ case 10: { if (dateUsed.Day >= 24) { ZodiacSign.Text = Signs[9]; } else { ZodiacSign.Text = Signs[8]; } break; }
|
|
|
+ case 11: { if (dateUsed.Day >= 23) { ZodiacSign.Text = Signs[10]; } else { ZodiacSign.Text = Signs[9]; } break; }
|
|
|
+ case 12: { if (dateUsed.Day >= 21) { ZodiacSign.Text = Signs[11]; } else { ZodiacSign.Text = Signs[10]; } break; }
|
|
|
+ }
|
|
|
+ ButtonShow.IsVisible = false;
|
|
|
+ ZodiacSign.IsVisible = true;
|
|
|
+ Zodiac.IsVisible = true;
|
|
|
+
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ private void Button_Click_Back(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+
|
|
|
+ Calendars_Buttons.IsVisible = true;
|
|
|
+ ShowPanelDate.IsVisible = true;
|
|
|
+ Calendars.IsVisible = true;
|
|
|
+ Backbutton.IsVisible = false;
|
|
|
+ EasternGoro.IsVisible = false;
|
|
|
+ Zodiac.IsVisible = false;
|
|
|
+ ButtonShow.IsVisible = true;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|