示例#1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            // Get a count of the number of SIQ entries for the StudyStorageLocation.  If there's
            // any, we don't enable the Delete button.
            var siqController = new StudyIntegrityQueueController();
            var criteria      = new StudyIntegrityQueueSelectCriteria();

            criteria.StudyStorageKey.EqualTo(Study.TheStudyStorage.Key);
            int siqCount = siqController.GetReconcileQueueItemsCount(criteria);

            string reason;
            bool   seriesDelete = Study.CanScheduleSeriesDelete(out reason);

            foreach (GridViewRow row in GridView1.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    int    index  = GridView1.PageIndex * GridView1.PageSize + row.RowIndex;
                    Series series = _series[index];

                    row.Attributes["serverae"]  = _serverPartition.AeTitle;
                    row.Attributes["studyuid"]  = _study.StudyInstanceUid;
                    row.Attributes["seriesuid"] = series.SeriesInstanceUid;

                    var controller = new StudyController();
                    if (controller.CanManipulateSeries(Study.TheStudyStorage.Key))
                    {
                        if (siqCount == 0 && seriesDelete)
                        {
                            row.Attributes.Add("candelete", "true");
                        }

                        row.Attributes.Add("canmove", "true");
                    }
                }
            }
        }