If cbxClose.Checked = True Then btnSave.Attributes.Add("onclick", "return confirm('Do you want to close Activity? Closed Activity cannot be reopened.')") End If
Protected Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click If txtSubject.Text <> "" Then 'Subject compulsary If txtTargetDate.Text <> "" Then Try Dim varTargetDate As Date = DateTime.ParseExact((txtTargetDate.Text), "dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture) If ddlPerson.Text <> "" Then If varmode = 1 Then 'ADD MODE If varTargetDate >= Date.Today Then Call fnAddActivity(varTargetDate) Call subPageRefresh() Else fnMessage(Me, "Please enter today or later date.") txtTargetDate.Focus() End If ElseIf varmode = 2 Then If cbxReAllocate.Checked = True Or cbxClose.Checked = True Then Call fnUpdateActivity() Call subBacktoManage() Else Call subBacktoManage() End If End If 'mode selection Else fnMessage(Me, "Please select the Person") ddlPerson.Focus() End If Catch ex As Exception fnMessage(Me, ex.Message) 'Primarily to chk the correct format of date End Try Else fnMessage(Me, "Please enter the Target Date") txtTargetDate.Focus() End If Else fnMessage(Me, "Please enter the Subject.") txtSubject.Focus() End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)