using System;
public partial class Masters_LeavePolicy_RemoteDelete : Base.BasePage
{
    cls_Common objCommon = new cls_Common();
    EmployeeEventData objEmployee = new EmployeeEventData();
    YearClosureEventdata objYearClosureEventdata = new YearClosureEventdata();
    int intEmpId, mappedCount = 0;
    string gstrDateFormat;
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking
        base.Page_Load(sender, e);
        if (Request.QueryString["EmpID"] == null || Request.QueryString["LeavePolicyFromDate"] == null || Request.QueryString["LeavePolicyToDate"] == null || Request.QueryString["EmpID"].ToString() == string.Empty || Request.QueryString["LeavePolicyFromDate"].ToString() == string.Empty || Request.QueryString["LeavePolicyToDate"].ToString() == string.Empty)
        {
            mappedCount = 0;
        }
        else
        {
            intEmpId = Convert.ToInt32(Request.QueryString["EmpID"].ToString());
            string leavePolicyFromDate = Request.QueryString["LeavePolicyFromDate"].ToString();
            string leavePolicyToDate = Request.QueryString["LeavePolicyToDate"].ToString();
            //Convert date time to MM/dd/YYYY format
            gstrDateFormat = Convert.ToString(Session["MDateFormat"]);
            leavePolicyFromDate = objCommon.DateConvertion(gstrDateFormat, leavePolicyFromDate);
            leavePolicyToDate = objCommon.DateConvertion(gstrDateFormat, leavePolicyToDate);
            Response.Clear();
            mappedCount = objEmployee.CheckLeaveAndPermissionIsExistsWhileDeleteEmpLeavePolicy(intEmpId, leavePolicyFromDate, leavePolicyToDate);
        }
        Response.Clear();
        Response.Write(mappedCount);
        Response.End();
    }
}
