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_AjaxRemainingNoOfBorrowLeaves : Base.BasePage
{
    LeaveApplicationEventData objLeaveApplicationEventData = new LeaveApplicationEventData();
    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");
        }
        else
        {
            int EmpId = Convert.ToInt32(Request.QueryString["EmpId"]);
            int leaveTypeId = Convert.ToInt32(Request.QueryString["leaveTypeId"]);
            DataSet dsRemainingNoOfBorrowleaves = new DataSet();
            dsRemainingNoOfBorrowleaves = objLeaveApplicationEventData.GetRemainingNumberOfBorrowLeaves(EmpId, leaveTypeId);
            dsRemainingNoOfBorrowleaves.Tables[0].TableName = "Details";
            if (dsRemainingNoOfBorrowleaves.Tables["Details"].Rows.Count > 0)
            {
                    Response.Clear();
                    Response.ContentType = "text/xml";
                    Response.Write(dsRemainingNoOfBorrowleaves.GetXml());
                    dsRemainingNoOfBorrowleaves.Dispose();
            }
            else
            {
                Response.Clear();
                Response.ContentType = "text/xml";
                Response.Write("Fail");
            }
        }
        Response.End();
    }
}
