private void TranDateValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     DatePicker box = (DatePicker)sender;
     BindingExpression be = box.GetBindingExpression(DatePicker.ValueProperty);
     be.UpdateSource();
     Validate();
 }
示例#2
0
 private void dpHarvestDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (!_isCreateView)
     {
         _cropInfo.HarvestDate = dpHarvestDate.Value;
         dpHarvestDate.Value = _cropInfo.HarvestDate;
     }
 }
 private void DatePickerValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     //            var value = DatePickerControl.Value;
     //            if(value == null)
     //                return;
     //            if (DateTime.Today.CompareTo(value) > 0)
     //                DatePickerControl.Value = DateTime.Today;
 }
示例#4
0
 private void datePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (e.NewDateTime.HasValue)
     {
         App.ViewModel.StopPageModel.DateContext = e.NewDateTime.Value;
         App.ViewModel.StopPageModel.StopTimes.Clear();
     }
 }
示例#5
0
 private void dpCreatedDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (!_isCreateView)
     {
         _cropInfo.PlantingDate = dpCreatedDate.Value.Value;
         dpCreatedDate.Value = _cropInfo.PlantingDate;
     }
 }
示例#6
0
		/// <summary>
		/// Called when the value changes.
		/// </summary>
		/// <param name="e">The event data.</param>
		protected virtual void OnValueChanged(DateTimeValueChangedEventArgs e)
		{
			var handler = ValueChanged;
			if (null != handler)
			{
				handler(this, e);
			}
		}
示例#7
0
 private void ttp_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     ListaRefeicao.ElementAt(panoramaDieta.SelectedIndex).Horario = MetodosTempo.DateTimeToString((DateTime)e.NewDateTime);
     Configuracoes configuracoes = new Configuracoes();
     if (configuracoes.IsReminderRefeicaoOn())
         ProgramarReminders((DateTime)e.NewDateTime);
     configuracoes.SetHorarioReminderRefeicao(ListaRefeicao.ElementAt(panoramaDieta.SelectedIndex).Nome, ListaRefeicao.ElementAt(panoramaDieta.SelectedIndex).Horario);
     AtualizarPanorama();
 }
 private void TPickerFimAgua_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     Configuracoes configuracoes = new Configuracoes();
     configuracoes.SetHorarioFimAgua(MetodosTempo.DateTimeToString((DateTime)e.NewDateTime));
     NotificadorAgua nAgua = new NotificadorAgua();
     nAgua.ApagarRemindersAgua();
     nAgua.CriarRemindersAgua((Application.Current as App).Usuario.Peso);
     Atualizar();
 }
示例#9
0
 private void DatePickerValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     // Hack : The control is not yet very stable and the twoway bindings aren't quite working : This event handler is a little hacky workaround to make it work without a binding.
     var viewModel = (EditTaskViewModel)DataContext;
     if (e.NewDateTime.HasValue)
     {
         viewModel.Task.DueDate = e.NewDateTime.Value;
     }
 }
示例#10
0
 private void OnDatePickerValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (DatePicker.Value.HasValue)
     {
         var givenDate = DatePicker.Value.Value;
         TransformedWeekNumber.Text = Convert.ToString(Helper.GetWeekNumber(givenDate));
         DateRange.Text = Helper.GetFriendlyDateRange(givenDate);
         IsReloaded = true;
     }
 }
示例#11
0
 /// <summary>
 /// 当DatePicker的值变更时, 更新数据源.
 /// </summary>
 private void DatePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     DatePicker datePicker = (DatePicker)sender;
     Travel travel = datePicker.DataContext as Travel;
     if (travel != null && travel.Time != datePicker.Value)
     {
         travel.Time = datePicker.Value.Value;
         App.DataSource.UpdateTravel(travel);
     }
 }
示例#12
0
        /// <summary>
        /// On Picker Date Changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnValueChanged(object sender, Microsoft.Phone.Controls.DateTimeValueChangedEventArgs e)
        {
            KreyosUtils.Log("SimpleAlarmScreen::OnValueChanged", "Value Changed..");
            KreyosTimePicker timePicker = sender as KreyosTimePicker;
            DateTime?        timeSet    = timePicker.Value;
            AlarmView        view       = m_alarmViews[m_selectedIndex];

            view.SetAlarm((DateTime)timeSet);
            view.UpdateView((bool)view.ToggleSwitch.IsChecked);
        }
示例#13
0
        private void MyDatePicker_OnValueChanged(object sender, DateTimeValueChangedEventArgs e)
        {
            TimeSpan time = ((DateTime)e.NewDateTime).Subtract(DateTime.Now);
            if (time.Days >= 0)
            {
                dateString = string.Format("{0:dd-MM-yyyy}", e.NewDateTime);
                FechaCita = Convert.ToDateTime(dateString);
            }
            
            else
                MessageBox.Show("No puedes agendar una cita para el pasado", "No te pases de listo", MessageBoxButton.OK);

        }
示例#14
0
        private void OnTimeChanged(object sender, Microsoft.Phone.Controls.DateTimeValueChangedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            if (e.NewDateTime == null || e.OldDateTime == null)
            {
                return;
            }

            DateTime dateTime = (DateTime)e.NewDateTime;

            BluetoothManager.Instance.SetDateTime(dateTime);
            // KreyosUtils.Log("DateTime", "Set Time");
        }
 void datePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
       //DateTime fechaActual = !string.IsNullOrEmpty(this.App().fechaActual.fecha) ? Convert.ToDateTime(this.App().fechaActual.fecha, new CultureInfo("es-MX")) : DateTime.Now;
       DateTime fechaActual = !string.IsNullOrEmpty(this.App().fechaActual.fecha) ? Global.ConvertToDatetime(this.App().fechaActual.fecha).Value : DateTime.Now;
       DateTime fecha3MesesAntes = fechaActual.AddMonths(-3);
       if (e.NewDateTime >= fecha3MesesAntes && e.NewDateTime <= fechaActual) {
             this.App().FechaTransferenciasConsultaPorDia = e.NewDateTime ?? fechaActual;
             this.App().TransferenciasConsultaPorDia = true;
             NavigationService.GoBack();
       }
       else {
             MessageBox.Show(TextosPantallas.tFechaMenor);
       }
 }
示例#16
0
 private void Time_Changed(object sender, DateTimeValueChangedEventArgs e)
 {
     System.DateTime? valueOpt = e.NewDateTime;
     if (valueOpt.HasValue && TimePicker != null)
     {
         var value = valueOpt.Value;
         int seconds = value.Second + value.Minute * 60 + value.Hour * 3600;
         double roundToInterval = 60 * 30;
         seconds = (int) (Math.Round(seconds / roundToInterval) * roundToInterval);
         var newValue = new System.DateTime();
         newValue = newValue.AddSeconds(-getSecondsFromStartOfDay(newValue));
         newValue = newValue.AddSeconds(seconds);
         TimePicker.Value = newValue;
     }
 }
 private void pkLastCycle_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (e.NewDateTime != DateTime.MinValue && e.NewDateTime != e.OldDateTime && e.NewDateTime.HasValue)
     {
         if (e.NewDateTime.Value > DateTime.Now)
         {
             (sender as DatePicker).BorderBrush = Application.Current.Resources["PinkColor"] as SolidColorBrush;
             (ContentPanel as Grid).RowDefinitions[5].Height = new GridLength(80);
         }
         else
         {
             (ContentPanel as Grid).RowDefinitions[5].Height = new GridLength(0);
             (sender as DatePicker).BorderBrush = new SolidColorBrush(Colors.White);
         }
     }
 }
        private void DatePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
        {
            resetValues();

            if (App.MainViewModel.Sales != null)
            {
                foreach (var oSale in App.MainViewModel.Sales)
                {
                    if (oSale.DateTimeOfSale >= m_oStartDatePicker.Value && oSale.DateTimeOfSale <= m_oEndDatePicker.Value)
                    {
                        m_dTotalSales += oSale.Total;
                        m_dTotalTax += oSale.TaxAmount;

                        // Count all the products in sale
                        if (oSale.Products != null)
                        {
                            foreach (var oProduct in oSale.Products)
                            {
                                m_iProductsSold += 1;
                            }
                        }

                        // Count all the items in sale
                        if (oSale.ItemList != null)
                        {
                            foreach (var oItem in oSale.ItemList)
                            {
                                m_iItemsSold += 1;
                            }
                        }
                    }
                }

                // set the filtered list for the VM
                App.MainViewModel.setFilteredSalesList(StartDate, EndDate);

                OnPropertyChanged("TotalSales");
                OnPropertyChanged("TotalTax");
                OnPropertyChanged("ProductsSold");
                OnPropertyChanged("ItemsSold");
            }
        }
示例#19
0
        private void DateTimePickerBase_OnValueChanged(object sender, DateTimeValueChangedEventArgs e)
        {
            //DateTime a  = new DateTime();

            TimeSpan time = ((DateTime)e.NewDateTime).Subtract(DateTime.Now);
            //DateTime time = (DateTime)e.NewDateTime;

            if (time.Days <= -6570 && time.Days >= -23725)
            {
                var dateString = string.Format("{0:dd-MM-yyyy}", e.NewDateTime);
                //a = Convert.ToDateTime(dateString);
                //ProfilePage.StoreBirthDate(dateString);
                User.BirthDate = dateString;
            }
            else
            {
                MessageBox.Show("No eres candidato para donar sangre.", "Lo sentimos :(", MessageBoxButton.OK);
                return;
            }
            

            NavigationService.Navigate(new Uri("/Pages/Profile/TestPage/TestPage.xaml", UriKind.Relative));
        }
示例#20
0
 void startDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if (this.datePickerEnd.Value < this.datePickerStart.Value) 
         this.datePickerEnd.Value = datePickerStart.Value;
 }
示例#21
0
 private void datePicker1_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     DateTime dateTemp = (DateTime)datePicker1.Value;
     date = dateTemp.ToString("yyyyMMdd");
     System.Diagnostics.Debug.WriteLine("date in Constructor: " + date + ", " + dateTemp.ToString());
 }
示例#22
0
 /// <summary>
 /// Handles the ValueChanged event of the toDatePicker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DateTimeValueChangedEventArgs"/> instance containing the event data.</param>
 private void toDatePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     SetLeaveCount();
     EnableSecondLeaveDuration();
 }
示例#23
0
 /// <summary>
 /// Handles the ValueChanged event of the fromDatePicker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DateTimeValueChangedEventArgs"/> instance containing the event data.</param>
 private void fromDatePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if(fromDatePicker.Value.HasValue)
     {
         ApplicationData.CurrentDate = fromDatePicker.Value.Value.ToString(DateFormat);
         if (!this.leaveRequestRepository.IsValidSecondDate(fromDatePicker.Value.Value, Convert.ToDateTime((DateTime)toDatePicker.Value, CultureInfoUS)))
         {
             toDatePicker.Value = fromDatePicker.Value;
         }
     }
     SetLeaveCount();
     EnableSecondLeaveDuration();
 }
 private void dpUploadFrom_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     Settings.StartFrom = (DateTime)dpUploadFrom.Value;
 }
        private void TimePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
        {

        }
 private void RepayDueDateTime_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     if ((sender != null) && (this.RepayDueDateTime != null))
     {
         System.DateTime time = this.RepayDueDateTime.Value.Value;
         this.addOrEditRepaymentViewModel.Current.DueDate = this.RepayDueDate.Value.GetValueOrDefault().Date.AddHours((double)time.Hour).AddMinutes((double)time.Minute).AddSeconds((double)time.Second);
     }
 }
 void MyTimePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     DateTime dt = (DateTime)e.NewDateTime;
     System.Diagnostics.Debug.WriteLine("Time is " + dt.ToShortTimeString());
 }
示例#28
0
 private void endDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
 }
示例#29
0
        private void beginDate_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
        {
            tmp_begin = ((DateTime)beginDate.Value).Date.Add(((DateTime)beginTime.Value).TimeOfDay);

            beginTime.Value = tmp_begin;
            beginDate.Value = tmp_begin;
            endDate.Value = tmp_begin.Add(eventDuration);
            endTime.Value = tmp_begin.Add(eventDuration);
        }
 private void EndDateOfWritingTrainings_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     UpdateNumOfTrainingsThatWillBeAddedBox();
 }
示例#31
0
 private void timePicker1_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     DateTime timeTemp = (DateTime)timePicker1.Value;
     time = timeTemp.ToString("HHmm");
     System.Diagnostics.Debug.WriteLine("time in Constructor: " + time + ", " + timeTemp.ToString());
 }
 private void datePicker_ValueChanged(object sender, DateTimeValueChangedEventArgs e)
 {
     try
     {
         DateTime value = (DateTime)datePicker.Value;
         if (!value.IsFutureDate())
         {
             ApplicationData.CurrentDate = ((DateTime)datePicker.Value).ToString(DateFormat);
             SetHeaderDate(ApplicationData.CurrentDate);
         }
         else
         {
             datePicker.Value = Convert.ToDateTime(ApplicationData.CurrentDate, CultureInfoUS);
             ShowMessageBox("Insight", "Task details for future date are not available.");
         }
     }
     catch (Exception)
     {
     }
     finally
     {
     }
 }