using System;
using System.Data;
using System.Text;
/****************************************************************************************************************************
* Project Name    : TimeCheck                                              Created On  : 12-Aug-2007
* Module          : Shift Pattern                                          Modified On : 10-May-2007
* Created By      : Janakaraj.P
* Modified By     : 
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Masters_RemoteDaily : System.Web.UI.Page
{
    ShiftPatternEventData objShiftPattern = new ShiftPatternEventData();
    DataSet ds_Shift = new DataSet();
    string patterntype;
    protected void Page_Load(object sender, EventArgs e)
    {
        ds_Shift = filldataset();
        CreateDailyPattern();
        patterntype = Convert.ToString(Request.QueryString["patterntype"]);
        if (patterntype == "Daily")
            insertDailyPattern();
        if (patterntype == "Weekly")
            insertWeeklyPattern();
        if (patterntype == "Fortnightly")
            insertFortnightPattern();
        if (patterntype == "Fortnightly")
            insertMothlyPattern();
    }
    public void CreateDailyPattern()
    {
        int Daycount = Convert.ToInt16(Request.QueryString["Daily"]);
        //Store number of days in session variable
        Session["NumberofDays"] = Daycount;
        StringBuilder strDaily = new StringBuilder();
        strDaily.Append("<table>");
        for (int i = 1; i < Daycount + 1; i++)
        {
            string id = "ddl_DPattern" + i;
            strDaily.Append("<tr>");
            strDaily.Append("<td class='td' width='30%'>Day " + i + " </td> ");
            //strDaily.Append("&nbsp;&nbsp;");
            strDaily.Append("<td width='50%'> <select id='" + id + "' name='" + id + "' class='dlist1'>");
            for (int j = 0; j < ds_Shift.Tables[0].Rows.Count; j++)
            {
                strDaily.Append("<option value=" + Convert.ToInt16(ds_Shift.Tables[0].Rows[j]["Shift_Id"]) + ">" + Convert.ToString(ds_Shift.Tables[0].Rows[j]["Shift_Name"]) + "</option> ");
            }
            strDaily.Append("</select></td>");
            strDaily.Append("</tr>");
        }
        strDaily.Append("</table>");
        Response.Clear();
        Response.Write(strDaily);
        Response.End();
    }
    public DataSet filldataset()
    {
        DataSet ds;
        string strusergroup = string.Empty;
        ds = objShiftPattern.SelectShift(Convert.ToString(Session["UserGroupName"]), Convert.ToString(Session["LevelRights"]), 0);
        return ds;
    }
    private void insertDailyPattern()
    {
    }
    private void insertWeeklyPattern()
    {
    }
    private void insertFortnightPattern()
    {
    }
    private void insertMothlyPattern()
    {
    }
}