Example #1
0
        /// <summary>
        /// Gets the list of page owners.
        /// Modified By: Praveena  
        /// Date:03/09/2010
        /// Reason: For module Add additional attributes to change page owner table
        /// </summary>
        /// <param name="username">User Name.</param>
        void GetOwnerPageDetails(string username, string pageName, string terminatedStatus, System.Text.StringBuilder chapterNames)
        {
            try
            {
                DataTable dtResulttable = null;
                DataTable dtTabletoBind = null;
                PageOwnerGridViewPanelID.Visible = true;
                lblNoDetails.Visible = false;
                string strCamlQuery = @"<Where><Eq><FieldRef Name='Book_ID' />
                 <Value Type='Number'>" + strSelectedID + "</Value></Eq></Where>";
                objWellBook = new WellBookBLL();
                dtResulttable = objWellBook.GetPagesForOwner(strParentSiteURL, DWBCHAPTERLIST, strCamlQuery, username, pageName, terminatedStatus, chapterNames);
                if (dtResulttable != null && dtResulttable.Rows.Count > 0)
                {
                    dtTabletoBind = dtResulttable.DefaultView.ToTable("BindTable", true, "ChapterName", CONNECTIONTYPECOLUMN, PAGENAMECOLUMN, DISCIPLINECOLUMN, OWNERCOLUMN,
                         EMPTYCOLUMN, SIGNOFFSTATUSCOLUMN, DWBIDCOLUMN);
                    pageOwnerGridview.DataSource = dtTabletoBind;
                    pageOwnerGridview.DataBind();
                    if (dtTabletoBind.Rows.Count == 0)
                    {
                        lblNoDetails.Visible = true;
                        PageSelectionVisible = false;
                        cboNewOwner.Visible = false;
                        btnCancel.Visible = false;
                        btnSaveAndChangeMore.Visible = false;
                        btnSave.Visible = false;
                        lblNewOwner.Visible = false;
                    }
                    else
                    {
                        lblNoDetails.Visible = false;
                        PageSelectionVisible = true;
                        cboNewOwner.Visible = true;
                        btnCancel.Visible = true;
                        btnSaveAndChangeMore.Visible = true;
                        btnSave.Visible = true;
                        lblNewOwner.Visible = true;

                    }
                }
                GetTeamUsers();
                if (dtResulttable != null)
                {
                    dtResulttable.Dispose();
                }
                if (dtTabletoBind != null)
                {
                    dtTabletoBind.Dispose();
                }
                /// Calling Javascript method DWBFixCheckBoxAlignment(gridID) to set the CheckBox column alignment as "center"
                this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "FixGridWidth", "DWBFixCheckBoxAlignment('" + pageOwnerGridview.ClientID + "');", true);
            }
            catch (Exception ex)
            {

                CommonUtility.HandleException(strParentSiteURL, ex);

            }
        }