using System;
using System.Data;
/****************************************************************************************************************************
* Project Name    : TimeCheck                                        Created On  : 12-Aug-2007
* Module          : Employee Master                                  Modified On : 20-Aug-2007
* Created By      : Arun Vinoth.T 
* Modified By     : 
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Masters_AuthorityRemote : Base.BasePage
{
    EmployeeEventData objEmployee = new EmployeeEventData();
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking and reset date format
        base.Page_Load(sender, e);
        if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null && Request.QueryString["ID"] != "" && Request.QueryString["emp"] != null && Request.QueryString["emp"] != "" && Request.QueryString["ID"] != "Select" && Request.QueryString["emp"] != "Select")
            {
                int ID = Convert.ToInt32(Request.QueryString["ID"]);
                int Emp = Convert.ToInt32(Request.QueryString["emp"]);
                if (Emp == 1)
                {
                    Session["Designation"] = ID;
                    //Added by manikandan.R
                    // on 05-10-2013
                    Session["Reporting"] = null;
                    Session["LeaveSanc"] = null;
                    getData(ID);
                }
                if (Emp == 2)
                {
                    Session["Reporting"] = ID;
                }
                if (Emp == 3)
                {
                    Session["LeaveSanc"] = ID;
                }
            }
        }
    }
    private void getData(int TitleID)
    {
        DataSet ds_Person = new DataSet();
        ds_Person = objEmployee.SelectReportingPerson(TitleID);
        if (ds_Person.Tables[0].Rows.Count > 0)
        {
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(ds_Person.GetXml());
            Response.End();
            ds_Person.Dispose();
        }
    }
}
