private void BindGrid()
 {
     BLL.QuestionnaireLib oQuestionnaireLib;
     try
     {
         oQuestionnaireLib = new BLL.QuestionnaireLib();
         GVLinks.DataSource = oQuestionnaireLib.GetGlobalCodesByCategoryName("SocialNetworkingLink");
         GVLinks.DataBind();
     }
     catch (Exception ex) { lblMsg.Text = ex.Message; }
     finally { oQuestionnaireLib = null; }
 }
 /// <summary>
 /// following function is used to bind the questions.
 /// </summary>
 private void BindQuestionnaires()
 {
     BLL.QuestionnaireLib oQuestionnaireLib = new BLL.QuestionnaireLib();
     GVQuestionnaireHeading.DataSource = oQuestionnaireLib.GetGlobalCodesByCategoryName("SubQuestionnaireTypes");
     GVQuestionnaireHeading.DataBind();
     oQuestionnaireLib = null;
 }
示例#3
0
    /*Sub Header***********************************************************
    Function Name: BindGlobalCodesDropdown
    Functionality: This function is used to bind the dropdown from the globalcodes
    Input: dropdownlist and the strInitialText
    Output:
    Note:
    *********************************************************************/
    public static void BindGlobalCodesDropdown(DropDownList ddList, string strInitialText, string _strCategory)
    {
        BLL.QuestionnaireLib oQuestionnaireLib = new BLL.QuestionnaireLib();
        ddList.DataSource = oQuestionnaireLib.GetGlobalCodesByCategoryName(_strCategory);
        ddList.DataTextField = "strHeading";
        ddList.DataValueField = "IntGlobalCodesId";
        ddList.DataBind();

        ListItem lstInitialItem;
        if (strInitialText.Trim() != "")
        {
            lstInitialItem = new ListItem(strInitialText, "0");
            ddList.Items.Insert(0, lstInitialItem);
        }
        lstInitialItem = null;

        oQuestionnaireLib = null;
    }