using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Transactions_AjaxRemainingNoOfEncashmentDays : Base.BasePage
{
    LeaveApplicationEventData objLeaveApplicationEventData = new LeaveApplicationEventData();
    //Cls_Connect cl = new Cls_Connect();
    DataSet ds_RemainigNoLeaves = new DataSet();
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking and reset date format
        base.Page_Load(sender, e);  
        if (Request.QueryString["EmpId"].ToString() == "" || Request.QueryString["leaveTypeId"].ToString() == "" || Request.QueryString["leaveTypeId"].ToString() == "-Select-")
        {
            Response.Write("Fail");
            Response.End();
        }
        else
        {
            int EmpId = Convert.ToInt32(Request.QueryString["EmpId"]);
            int leaveTypeId = Convert.ToInt32(Request.QueryString["leaveTypeId"]);
            ds_RemainigNoLeaves = objLeaveApplicationEventData.GetRemainingNumberOfLeave(Convert.ToString(EmpId), leaveTypeId);
            if (ds_RemainigNoLeaves.Tables[0].Rows.Count > 0)
            {
                Response.Clear();
                Response.ContentType = "text/xml";
                Response.Write(ds_RemainigNoLeaves.GetXml());
                ds_RemainigNoLeaves.Dispose();
            }
           else
            {
                Response.Clear();
                Response.ContentType = "text/xml";
                Response.Write("Fail");
            }
        }
        Response.End();
    }
}
