using System;
using System.Data;
using System.Globalization;
using System.Resources;
using System.Text;
using System.Threading;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Xml;

public partial class Help_Help : Base.BasePage
{
    #region "Variable Declaration"
    ResourceManager rm;
    CultureInfo ci;
    EmailConfiguration objEmailConfiguration = new EmailConfiguration();
    GetReports objGetReports = new GetReports();
    Cls_CheckUser objCheckUser = new Cls_CheckUser();
    cls_Common objcommon = new cls_Common();
    //cls_Master_Title objTitle = new cls_Master_Title();
    string strSetAlert;
    DataSet ds_Checkuser = new DataSet();
    //LeaveEventData objLeave = new LeaveEventData();
    int auEmpId;
    string strScript = string.Empty;
    string source_Language;
    string strFileNameandPath = string.Empty;
    int intPreviewShown = 0;
    #endregion
    protected override void Page_Load(object sender, EventArgs e)
    {
        // session checking
        base.Page_Load(sender, e);
        //get the culture info to set the language       
        if (!Page.IsPostBack)
        {
            //base.CheckPages(249);
            objcommon.menu("Menu_help", "249");
        }
        source_Language = Convert.ToString(Session["Session_ActiveLanguage"]);
        rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
        ci = Thread.CurrentThread.CurrentCulture;
        site.SiteMapProvider = Convert.ToString(Session["SiteMapProvider"]);
        // LoadStrings Function fills the Label from the Resource File    
        LoadHelpContentDynamically();
    }
    public void LoadHelpContentDynamically()
    {
        DataSet ds = new DataSet();
        ds = objcommon.GetHelpContent();
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            #region Header
            HtmlGenericControl divPanel = new HtmlGenericControl("div");
            divPanel.Attributes.Add("class", "panel panel-default");
            divPanel.Attributes.Add("id", (i + 1).ToString());

            HtmlGenericControl divPanelheading = new HtmlGenericControl("div");
            divPanelheading.Attributes.Add("class", "panel-heading1");
            divPanelheading.Attributes.Add("id", (i + 1).ToString());


            HtmlGenericControl h4 = new HtmlGenericControl("h4");
            h4.Attributes.Add("class", "panel-title");
            h4.Attributes.Add("id", (i + 1).ToString());
            h4.Style.Add("text-align", "left !important");
            h4.Style.Add("padding-left", "10px !important");
            divPanelheading.Controls.Add(h4);

            HtmlGenericControl anchor = new HtmlGenericControl("a");
            anchor.Attributes.Add("data-toggle", "collapse");
            anchor.Attributes.Add("data-parent", "#accordion");
            anchor.Attributes.Add("id", (i + 1).ToString());
            anchor.Attributes.Add("href", "#Data" + (i + 1).ToString());
            h4.Controls.Add(anchor);

            Label lblheader = new Label();
            lblheader.Text = (i + 1).ToString() + "." + ds.Tables[0].Rows[i][0].ToString();
            anchor.Controls.Add(lblheader);
            divPanel.Controls.Add(divPanelheading);
            #endregion

            #region ContentDiv
            HtmlGenericControl divContentMain = new HtmlGenericControl("div");
            divContentMain.Attributes.Add("class", "panel-collapse collapse");
            divContentMain.Attributes.Add("id", "Data" + (i + 1).ToString());

            HtmlGenericControl divbody = new HtmlGenericControl("div");
            divbody.Attributes.Add("class", "panel-body");
            divbody.Attributes.Add("id", (i + 1).ToString());


            HtmlGenericControl paragraph = new HtmlGenericControl("p");
            paragraph.Attributes.Add("id", (i + 1).ToString());
            paragraph.Style.Add("text-align", "left !important");
            paragraph.Style.Add("padding", "0px 10px !important");
            paragraph.InnerHtml = ds.Tables[0].Rows[i][1].ToString();
            divbody.Controls.Add(paragraph);

            divContentMain.Controls.Add(divbody);
            divPanel.Controls.Add(divContentMain);
            accordion.Controls.Add(divPanel);
            #endregion
        }
    }
}