private void ExportSettings_UIContainerExporting(object obj, UIContainerExportingEventArgs args) { string controltext = null; if (args.ExportType == UIContainerExportType.Xaml) { return; } if (args.UIContainer.UIElement is DateTimeEdit) { DateTimeEdit dateTimeEdit = args.UIContainer.UIElement as DateTimeEdit; controltext = dateTimeEdit.Text; if (dateTimeEdit.FontWeight.ToString() == "Bold") { args.UIContainer.CharacterFormat.Bold = true; } args.UIContainer.CharacterFormat.FontColor = (dateTimeEdit.Foreground as SolidColorBrush).Color; } else if (args.UIContainer.UIElement is TextBox) { controltext = (args.UIContainer.UIElement as TextBox).Text; } if (controltext != null) { args.Text = controltext; args.ExportType = UIContainerExportType.Text; } }
public override void OnApplyTemplate() { AddStartTimeMonth = GetTemplateChild("addstartmonth") as DatePicker; AddStartTime = GetTemplateChild("addstarttime") as DateTimeEdit; AddEndTimeMonth = GetTemplateChild("addendmonth") as DatePicker; AddEndTime = GetTemplateChild("addendtime") as DateTimeEdit; EditStartTimeMonth = GetTemplateChild("editstartmonth") as DatePicker; EditStartTime = GetTemplateChild("editstarttime") as DateTimeEdit; EditEndTimeMonth = GetTemplateChild("editendmonth") as DatePicker; EditEndTime = GetTemplateChild("editendtime") as DateTimeEdit; Subject = GetTemplateChild("sub") as TextBox; Notes = GetTemplateChild("notes") as TextBox; Location = GetTemplateChild("where") as TextBox; Close = GetTemplateChild("close") as Button; Save = GetTemplateChild("save") as Button; Reminder = GetTemplateChild("reminder") as ComboBox; Delete = GetTemplateChild("delete") as Button; ShowMorePanel = GetTemplateChild("showmorepanel") as StackPanel; Scroll = GetTemplateChild("scroll") as ScrollViewer; Scroll.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; Visibility = Visibility.Collapsed; AddReminder = GetTemplateChild("addreminder") as ComboBox; AppType = GetTemplateChild("apptype") as ComboBox; Close.Click += Close_Click; Save.Click += Save_Click; Delete.Click += Delete_Click; AddReminder.ItemsSource = Reminder.ItemsSource = Enum.GetValues(typeof(ReminderTimeType)); AddReminder.SelectedIndex = Reminder.SelectedIndex = 0; Visibility = Visibility.Collapsed; base.OnApplyTemplate(); }
private void OnDateTimeEditGotFocus(object sender, RoutedEventArgs e) { DateTimeEdit focusedDateTimeEdit = sender as DateTimeEdit; viewModel.EnablePattern = focusedDateTimeEdit == AssociatedObject.patternDT; viewModel.EnableCulture = focusedDateTimeEdit == AssociatedObject.cultureDT; viewModel.EnableMinMax = focusedDateTimeEdit == AssociatedObject.validationDT || focusedDateTimeEdit == AssociatedObject.minDateTime || focusedDateTimeEdit == AssociatedObject.maxDateTime; }
private void loadedCommandChanged(object obj) { DateTimeEdit dateTimeEdit = obj as DateTimeEdit; //Setting start and end range for blocking dates DateTime StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month - 1, 1); DateTime EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day - 1); Syncfusion.Windows.Controls.CalendarDateRange blackOutDays = new Syncfusion.Windows.Controls.CalendarDateRange() { Start = StartDate, End = EndDate }; Syncfusion.Windows.Controls.Calendar calendar = dateTimeEdit.DateTimeCalender as Syncfusion.Windows.Controls.Calendar; calendar.BlackoutDates.Add(blackOutDays); }
private void OnDateTimeEditLoaded(object sender, RoutedEventArgs e) { DateTimeEdit dateTimeEdit = sender as DateTimeEdit; if (dateTimeEdit.Name == "blackOutDates") { CalendarDateRange blackOutDays = new CalendarDateRange(); DateTime StartDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); DateTime EndDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day - 2); blackOutDays = new CalendarDateRange() { Start = StartDate, End = EndDate }; Calendar calendar = dateTimeEdit.DateTimeCalender as Calendar; calendar.BlackoutDates.Add(blackOutDays); } }
public int nbLigneBetween(DateTimeEdit dateDebut, DateTimeEdit dateFin) { int cpt = 0; string Date_de_debut = dateConvert(dateDebut); string Date_de_fin = dateConvert(dateFin); string Query = "SELECT count(*) FROM DemandePrime D"; Query += " INNER JOIN TypePrime P ON P.CodePrime=D.CodePrime"; Query += " INNER JOIN PV V ON V.CodePV=D.pv_codepv"; Query += " WHERE D.EtatDem='A' AND V.DatePV BETWEEN '" + Date_de_debut + "' AND '" + Date_de_fin + "' "; try { cpt = Int32.Parse(getExcuteScalar(Query).ToString()); } catch (SqlException e) { MessageBox.Show(e.Message); } return(cpt); }
public string dateConvert(DateTimeEdit date) { return(date.Text.Substring(6, 4) + "-" + date.Text.Substring(3, 2) + "-" + date.Text.Substring(0, 2)); }