using System;
using System.Data;
public partial class Masters_EmployeeFlexibleTimings : 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"].ToString() != "Select" && Request.QueryString["ID"].ToString() != "" && Request.QueryString["ID"].ToString() != null)
            {
                int LevelID = Convert.ToInt32(Request.QueryString["ID"].ToString());
                int companyId = 0;
                org_levelsEventData getOrg = new org_levelsEventData();
                getOrg.GetOrgParentLevels_FromID(LevelID);
                DataSet ds_getOrg = new DataSet();
                ds_getOrg = getOrg.GetOrgParentLevels();
                if (ds_getOrg != null)
                {
                    if (ds_getOrg.Tables[0].Rows.Count > 0)
                    {
                        companyId = Convert.ToInt32(ds_getOrg.Tables[0].Rows[0]["LevelID"].ToString());
                    }
                }
                if (Convert.ToInt32(Session["parentLevelId"]) == 0)
                {
                    Session["parentLevelId"] = LevelID;
                }
                getFlexibleData(companyId);
            }
            else
            {
                Response.Clear();
                Response.ContentType = "text/xml";
                Response.Write("Select");
                Response.End();
            }
        }
    }
    public void getFlexibleData(int OrgLevelId)
    {
        int intFlexibleCount = 0;
        intFlexibleCount = objEmployee.SelectFlexibleEmployeeDetails(OrgLevelId);
        if (intFlexibleCount > 0)
        {
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write("True");
            Response.End();
        }
        else
        {
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write("False");
            Response.End();
        }
    }
}
