Ejemplo n.º 1
0
 /// <summary>
 /// Binds the data to controls.
 /// </summary>
 /// <param name="cboList">The cbo list.</param>
 /// <param name="listname">The listname.</param>
 /// <param name="pageType">Type of the page.</param>
 /// <param name="strCAMLQuery">The STR CAML query.</param>
 protected void BindDataToControls(DropDownList cboList, string listname, string pageType, string strCAMLQuery)
 {
     switch (pageType)
     {
         case WELLBOOK:
             objWellBookBLL = new WellBookBLL();
             cboList.Items.Clear();
             cboList.DataSource = objWellBookBLL.GetListItems(strParentSiteURL, listname, strCAMLQuery);
             cboList.DataTextField = "value";
             cboList.DataValueField = "key";
             cboList.DataBind();
             break;
         case CHAPTER:
             objChapterBLL = new ChapterBLL();
             cboList.Items.Clear();
             cboList.DataSource = objChapterBLL.GetListItems(strParentSiteURL, listname, strCAMLQuery);
             cboList.DataTextField = "value";
             cboList.DataValueField = "key";
             cboList.DataBind();
             break;
         case CHANGEPAGEOWNER:
             objWellBookBLL = new WellBookBLL();
             cboList.Items.Clear();
             cboList.DataSource = objWellBookBLL.GetPageOwnerList(strParentSiteURL, listname, strCAMLQuery);
             cboList.DataTextField = "value";
             cboList.DataValueField = "key";
             cboList.DataBind();
             break;
         default:
             break;
     }
 }