using System;
using System.Data;
/****************************************************************************************************************************
* Project Name    : TimeCheck                                               Created On  : 17-Mar-2008
* Module          : Entrance Master                                         Modified On : 17-Mar-2008
* Created By      : Kumuthini.L
* Modified By     : 
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Masters_EntranceServer : Base.BasePage
{
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking and reset date format
        base.Page_Load(sender, e);
        Response.Clear();
        if ((Request.QueryString["newvalue"] != null) && (Request.QueryString["ddlno"] != null) && (Request.QueryString["type"] != null))
        {
            string strType = Request.QueryString["type"].ToString();
            if (strType == "In")
            {
                UpdateEntranceInDetails(Convert.ToInt32(Request.QueryString["ddlno"].ToString()), Convert.ToInt32(Request.QueryString["newvalue"].ToString()));
            }
            else if (strType == "Out")
            {
                UpdateEntranceOutDetails(Convert.ToInt32(Request.QueryString["ddlno"].ToString()), Convert.ToInt32(Request.QueryString["newvalue"].ToString()));
            }
            else
            {
                // Nothing
            }
        }
        Response.End();
    }
    private void UpdateEntranceInDetails(int ddlno, int newvalue)
    {
        DataSet ds_Entrance = new DataSet();
        ds_Entrance = (DataSet)Session["ds_InTerminals"];
        foreach (DataRow Drow in ds_Entrance.Tables[0].Rows)
        {
            Drow["Reader_Id"] = newvalue;
        }
        Session["ds_InTerminals"] = ds_Entrance;
    }
    private void UpdateEntranceOutDetails(int ddlno, int newvalue)
    {
        DataSet ds_Entrance = new DataSet();
        ds_Entrance = (DataSet)Session["ds_OutTerminals"];
        foreach (DataRow Drow in ds_Entrance.Tables[0].Rows)
        {
            Drow["Reader_Id"] = newvalue;
        }
        Session["ds_OutTerminals"] = ds_Entrance;
    }
}
