Ejemplo n.º 1
0
        private void BindGrid()
        {
            DataSet errorsDataSet = null;

            if (UserCanAdministerSite)
            {
                errorsDataSet = AppErrorController.GetAppErrorsDataSet(int.MinValue, true);
            }
            else
            {
                // Get errors for all galleries current user is a gallery admin for.
                foreach (IGallery gallery in UserController.GetGalleriesCurrentUserCanAdminister())
                {
                    if (errorsDataSet == null)
                    {
                        errorsDataSet = AppErrorController.GetAppErrorsDataSet(gallery.GalleryId, true);
                    }
                    else
                    {
                        DataSet errorsforGallery = AppErrorController.GetAppErrorsDataSet(gallery.GalleryId, false);

                        foreach (DataTable dataTable in errorsforGallery.Tables)
                        {
                            errorsDataSet.Merge(dataTable);
                        }
                    }
                }
            }

            gd.DataSource = errorsDataSet;
            gd.DataBind();
        }