using System;
using System.Globalization;
using System.Resources;
using System.Text;
using System.Threading;
/****************************************************************************************************************************
* Project Name    : TimeCheck                                        Created On  : 12-Aug-2007
* Module          : Employee Master                                  Modified On : 
* Created By      : Arun Vinoth.T
* Modified By     : 
* Current Storage : \\Angler56\Projects\Inprogress\SCREEN1206\code\Time_AttendanceApp
* BackUp          :
****************************************************************************************************************************/
public partial class Masters_Employee_Children : Base.BasePage
{
    int Children_No;
    ResourceManager rm;
    CultureInfo ci;
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking and reset date format
        base.Page_Load(sender, e);
        string source_Language;
        source_Language = Convert.ToString(Session["Session_ActiveLanguage"]);
        rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
        ci = Thread.CurrentThread.CurrentCulture;
        if (!IsPostBack)
        {
            if (Request.QueryString["No"] != null && Request.QueryString["No"] != "")
            {
                Children_No = Convert.ToInt16(Request.QueryString["No"].ToString());
                GenerateContols();
            }
            else
            {
                Response.Clear();
                //Response.Write("Fail");
                Response.End();
            }
        }
    }
    //Function generate controls
    private void GenerateContols()
    {
        Response.Clear();
        string id1 = "";
        string id2 = "";
        StringBuilder sb_Children = new StringBuilder();
        sb_Children.Append("<div id=\"tbl_children\" style='color:#5D5D5D'>");
        for (int i = 1; i <= Children_No; i++)
        {
            id1 = "txt_ChName" + i;
            id2 = "txt_ChildDOB" + i;
            sb_Children.Append("<div class='row form-group'>");
            sb_Children.Append("<div class='col-md-2'>");
            //sb_Children.Append("Child " + i + " Name</td> <td class='td'><INPUT type='Text' class='textbox_4' ID='" + id1 + "' onkeypress=\"return character_only(event,this)\" onchange=\"javascript:return assign_hidden('1');\">");
            sb_Children.Append(rm.GetString("Caption_Child", ci) + i + rm.GetString("OrgLevels_CompDetails_Name", ci) + "</div> <div class='col-md-3'><INPUT type='Text' class='form-control' ID='" + id1 + "' onkeypress=\"return character_only(event,this)\" onchange=\"javascript:return assign_hidden('1');\">");
            sb_Children.Append("</div><div class='col-md-1'></div>");
            sb_Children.Append("<div class='col-md-2'>");
            //sb_Children.Append("Child " + i + " DOB </td> <td class='td'> <INPUT type='Text' class='textbox_4' runat ='Server'  ID='" + id2 + "' onkeypress=\"return key_press_nokey(event)\" onpaste=\"return false\"  onchange=\"javascript:return assign_hidden(this);\">");
            sb_Children.Append(rm.GetString("Caption_Child", ci) + i + rm.GetString("Caption_DOB", ci) + "</div> <div class='col-md-3'> <INPUT type='Text' class='form-control' runat ='Server'  ID='" + id2 + "' onmouseover=\"javascript:return DynamicDatePicker('" + Convert.ToString(Session["IDateFormat"]) + "','" + id2 + "');\" onkeypress=\"return key_press_nokey(event)\" onpaste=\"return false\"  onblur=\"javascript:return assign_hidden(this);\">");
            sb_Children.Append("</div><div class='col-md-1'></div>");
            //sb_Children.Append("<td class='td' align='right'>");
            //sb_Children.Append("<input type=\"image\" src=\"../Images/dateicon.gif\" id=\"buttxt_childdob" + i + "\" onclick=\"Calendar.setup({inputField     :    '" + id2 + "',ifFormat       :    '" + Convert.ToString(Session["IDateFormat"]) + "',showsTime      :    false, button         :    'buttxt_childdob" + i + "',  singleClick    :    true,   step           :    1 });return false\"/>");
            //sb_Children.Append("</td>");
            sb_Children.Append("</div>");
        }
        sb_Children.Append("</div>");
        Response.Write(sb_Children);
        Response.End();
    }
}
