public HistoryPage() { InitializeComponent(); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); string[] monthNames = System.Globalization.CultureInfo.CurrentCulture .DateTimeFormat.MonthGenitiveNames; foreach (var item in monthNames) { if (!item.Equals("")) { monthPicker.AddItem(item); } } string[] yrNames = new string[3] { "2017", "2016", "2015" }; foreach (var item in yrNames) { YearPicker.AddItem(item); } loadData(); }
protected void LoadDataPickers() { try { if (this.IsInternetAndCloseModal()) { var yearPickerTemp = new ObservableCollection <PickerItem>(); for (int iyear = DateTime.Now.Year - 1; iyear <= (DateTime.Now.Year + 1); iyear++) { yearPickerTemp.Add(new PickerItem { Value = iyear, DisplayName = iyear.ToString() }); } YearPicker = yearPickerTemp; var monthPickerTemp = new ObservableCollection <PickerItem>(); for (int imes = DateTime.MinValue.Month; imes < DateTime.MaxValue.Month + 1; imes++) { monthPickerTemp.Add(new PickerItem { Value = imes, DisplayName = dtinfo.GetMonthName(imes) }); } MonthPicker = monthPickerTemp; var MyDate = DateTime.Now; var InitYearPickerItem = new PickerItem { Value = MyDate.Year, DisplayName = MyDate.Year.ToString(), }; var InitMonthPickerItem = new PickerItem { Value = MyDate.Month, DisplayName = dtinfo.GetMonthName(MyDate.Month), }; MyItemMonthPicker = MonthPicker.Where(x => x.Value == InitMonthPickerItem.Value).FirstOrDefault(); MyItemYearPicker = YearPicker.Where(x => x.Value == InitYearPickerItem.Value).FirstOrDefault(); } } catch (Exception ex) { IsBusy = false; BaseModule.DialogErrorCustomService.DialogErrorCommonTryAgain(); Crashes.TrackError(ex); } }
private void Reset_Click(object sender, EventArgs e) { MName.Clear(); LanguageBox.SelectedItem = null; Lead.Clear(); Others.Clear(); Genre.SelectedItem = null; YearPicker.ResetText(); DatePicker.ResetText(); R1.Checked = false; R2.Checked = false; R3.Checked = false; R4.Checked = false; R5.Checked = false; movier.Checked = false; seriesr.Checked = false; changeMade = false; }