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;
/****************************************************************************************************************************
* Project Name    : TimeCheck                    Started Date  : 14-Aug-2007
* Module          : Shift Exchange               Last Modified : 15-Aug-2007
* Programmer      : Arun vinoth.T
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Transactions_EmpName_ShiftExchange : Base.BasePage
{
    string EmpId, EmpCode, EmpName, data;
    ManualEntryEventData obj = new ManualEntryEventData();
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking and reset date format
        base.Page_Load(sender, e);  
        if (Request.QueryString["EmpId"] != null && Request.QueryString["EmpId"] != "")
        {
            EmpCode = Convert.ToString(Request.QueryString["EmpId"]);
            GetEmployeeName(EmpCode);
        }
        else
        {
            Response.Clear();
            Response.End();
        }
    }
    private void GetEmployeeName(string EmpCode)
    {
        DataSet ds_EmpName = new DataSet();
        ds_EmpName = obj.SelectEmpName(Convert.ToInt32(Session["EmpAutoId"]), EmpCode, Convert.ToString(Session["UserGroupName"]), Convert.ToString(Session["GradeLevel"]), "", Convert.ToInt32(Session["parentLevelId"]),"");
        if (ds_EmpName != null)
        {
            if (ds_EmpName.Tables[0].Rows.Count > 0)
            {
                EmpId = Convert.ToString(ds_EmpName.Tables[0].Rows[0]["Employee_Id"]);
                EmpName = Convert.ToString(ds_EmpName.Tables[0].Rows[0]["Employee Name"]);
                data = EmpId + ",~," + EmpName;
                Response.Clear();
                Response.Write(data);
                Response.End();
            }
            else
            {
                Response.Clear();
                Response.Write("Invalid EmployeeCode");
                Response.End();
            }
            ds_EmpName.Dispose();
        }
    }
}
