private void btnCalculate_Click(object sender, EventArgs e) { if (StartDateTimePicker.Text != null && EndDateTimePicker.Text != null) { var duration = new Duration.Logic.Duration(Convert.ToDateTime(StartDateTimePicker.Text), Convert.ToDateTime(EndDateTimePicker.Text)); lblResult.Text = string.Format(" duration Class : {0} \n Date Time Function Class: \r Years : {1}; \r Months : {2}; \r Days : {3}; \r TotalDays : {4} ", duration.Years, duration.Years, duration.Months, duration.Days, duration.TotalDays); } }
private void btnCalculate_Click(object sender, EventArgs e) { if (StartDateTimePicker.Text != null && EndDateTimePicker.Text != null) { var duration = new Duration.Logic.Duration(Convert.ToDateTime(StartDateTimePicker.Text),Convert.ToDateTime(EndDateTimePicker.Text)); lblResult.Text = string.Format(" duration Class : {0} \n Date Time Function Class: \r Years : {1}; \r Months : {2}; \r Days : {3}; \r TotalDays : {4} ", duration.Years, duration.Years, duration.Months, duration.Days, duration.TotalDays); } }
private void EndDateTimePicker_ValueChanged(object sender, EventArgs e) { try { var duration = new Duration.Logic.Duration(Convert.ToDateTime(StartDateTimePicker.Text), Convert.ToDateTime(EndDateTimePicker.Text)); lblResult.Text = string.Format(" duration Class : {0} \n Date Time Function Class: \r Years : {1}; \r Months : {2}; \r Days : {3}; \r TotalDays : {4} ", duration.Years, duration.Years, duration.Months, duration.Days, duration.TotalDays); } catch (Exception) { throw; } }
private void EndDateTimePicker_ValueChanged(object sender, EventArgs e) { try { var duration = new Duration.Logic.Duration(Convert.ToDateTime(StartDateTimePicker.Text), Convert.ToDateTime(EndDateTimePicker.Text)); lblResult.Text = string.Format(" duration Class : {0} \n Date Time Function Class: \r Years : {1}; \r Months : {2}; \r Days : {3}; \r TotalDays : {4} ", duration.Years, duration.Years, duration.Months, duration.Days, duration.TotalDays); } catch (Exception) { throw; } } }