.net - DateTimePicker is not working Properly -


Actually, I have a 2-timer timer picture which is in my fast-sized bit Net Net 2008. Both of them do the same event. But one of them is not working properly until I use one more. Please let me !!!! Help

  private void dtpStart_ValueChanged (object sender, EventArgs e) {if (cmbDay.SelectedIndex == -1 | | CmbLeaveName.SelectedIndex == -1) {MessageBox.Show ( "Please Day Select and leave name "," error ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); DtpStart.ValueChanged - = New EventHeader (dtpStart_ValueChanged); } If (dtpStart.Value & gt; dtpEnd.Value) {MessageBox.Show ( "release date from date can not occur before", "illegal entry ', MessageBoxButtons.OK); DtpStart.Value = dtpEnd .Value;} Getdays (); Czech = validate (); if (Czech == "false") {Czech = "right"; return;} LoadDataGridView ();} private void DtpEnd_ValueChanged (object sender, EventArgs e) { if (cmbDay.SelectedIndex == -1 || cmbLeaveName.SelectedIndex == -1) {MessageBox.Show ( "select day and leave name", "error", MessageBoxButtons .OK, MessageBoxIcon.Exclamation); DtpEnd. ValueChanged - = new event handler (dtpind_wolves); return;} if (dtpEnd.Valu E & lt; dtpStart.Value) {MessageBox.Show ("The last date for release can not happen before the holiday date", "Invalid Entry", MessageBoxButtons.OK); DtpEnd.Value = dtpStart.Value; } Getdays (); Check = valid (); If (check == "wrong") {check = "right"; Return; } LoadDataGridView (); } Private zero getdays () {double ts = GetDateDifference (); If (cmbDay.Text.ToString () == "full day") {txtLeaveApplied.Text = ts.ToString (); } And if (cmbday.Text.ToString () == "half day") {txtLeaveApplied.Text = ((float.Parse (ts.ToString ()) / 2) .string (); }} Validate the private string () {string name = cmbApplicantName.Text.ToString (); String EMP_ID = GetEmpId (name); Datatale dtvalidate = new datatile (); Dtvlidte = Likwalidtelivenfo (Mp_id, Dattimekpars (Dtpastartkvaluktoshortdtestring ()), Dattimekpars (Dtpendkvaluktoshortdtestring ())); If (dtvalidate.Rows.Count> 0) {stringbuilder date = new stringbiller (); Foreign currency (DataRow line in dtvalidate.Rows) {date.Append (line ["Leave_Date"]. ToString () + Environment.NewLine); } MessageBox.Show ("The dates already applied have been implemented" + Environment. New Line + Date, "Select valid date", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); Check = "wrong"; DgvLeaveApplication.Rows.Clear (); } Dtvalidate.Rows.Clear (); Dtvalidate.Dispose (); Return check; } Private Zero LoadDataGrid view () {double ts = GetDateDifference (); DgvLeaveApplication.Rows.Clear (); DateTimeDT = DateTime Purse (DTP start.value.short.datetime ()); For (int i = 0; i & LT; Convert.ToInt32 (ts.ToString ()); i ++) {dgvLeaveApplication.Rows.Add (dgvLeaveApplication.Rows.Count, dt.ToShortDateString (), cmbLeaveName.SelectedValue. ToString ()); Dt = dt.AddDays (1); } DgvLeaveApplication.Refresh (); }    

Check AutoPostBack property for both components.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -