show / hide menu

Adding Rules

Validate Vacation date

The employee should apply for leave and get that approved before taking the vacation leave. So when a employee is applying for a vacation, the date of leave should not be less than the current date. The company also has a restriction that the employee should not take any company restricted date in the vacation.

Logical Flow:
When the user selects a date in the “Vacation Days Requested” grid, we need to check if the date selected is less than or equal to current date.
If it is less than current date,

  • Then display a message “Date should be greater than current date, please select another date”.
  • The grid column “Status” should be set to 0, so that the red label is displayed as a indication of invalid date.
  • The insert row option for the grid should be disabled.

if its a date greater than current date,

  • Then we have to pass the date to the textbox “txtDate”
  • When the date is passed to the textbox “txtDate” then that will execute the DataSource “Select Restricted Date“.

If this command return a ID from the list, then the selected date is a restricted date.

  • Then we need to display a message “Select date is restricted date, please select another date” and set the grid column “Status” to 0, which will display the red label in the current row.

if there is no ID returned then its a proper date and the user can proceed.

  • The insert row option for the grid should be enabled.
  • Set the grid column “Status” to 1, which will display the green label in the current row.

Validate Sick Leave date

The employee can apply for the sick leave after he has taken the leave. So when a employee is applying for a sick leave, he can apply leave for the previous days and a date greater than the current date.

Logical Flow:

When the user selects a date in the “Sick Leave Days Requested” grid, then we have to pass the date to the textbox “txtDate”

  • When the date is passed to the textbox “txtDate” then that will execute the DataSource “Select Restricted Date“.

If this command return a ID from the list, then the selected date is a restricted date.

  • Then we need to display a message “Select date is restricted date, please select another date” and set the grid column “Status” to 0, which will display the red label in the current row.

if there is no ID returned then its a proper date and the user can proceed.

  • The insert row option for the grid should be enabled.
  • Set the grid column “Status” to 1, which will display the green label in the current row.


Validate Personal Leave Date

The employee should apply for leave and get that approved before taking the vacation leave. So when a employee is applying for a vacation, the date of leave should not be less than the current date. The company also has a restriction that the employee should not take any company restricted date in the vacation.

Logical Flow:
    When the user selects a date in the “Personal Leave Days Requested” grid, we need to check if the date selected is less than or equal to current date.

If it is less than current date,

  • Then display a message “Date should be greater than current date, please select another date”.
  • The grid column “Status” should be set to 0, so that the red label is displayed as a indication of invalid date.
  • The insert row option for the grid should be disabled.

if its a date greater than current date,

  • Then we have to pass the date to the textbox “txtDate”
  • When the date is passed to the textbox “txtDate” then that will execute the DataSource “Select Restricted Date“.

If this command return a ID from the list, then the selected date is a restricted date.

  • Then we need to display a message “Select date is restricted date, please select another date” and set the grid column “Status” to 0, which will display the red label in the current row.

if there is no ID returned then its a proper date and the user can proceed.

  • The insert row option for the grid should be enabled.
  • Set the grid column “Status” to 1, which will display the green label in the current row.