예제 #1
0
        public override void RefreshData()
        {
            //lvPerms.MultiSelect = !Modal;

            this.Text = "Dataviews - " + this.AdminProxy.Connection.ServerName + (Toolkit.IsProcessElevated() ? " - Administrator " : "");
            var tags = rememberSelectedTags(lvDataviews);

            // this form has multiple uses, as does the underlying ListPermissions method.
            // it can:
            // List all permissions (0,[0])
            // List permission info for a single permission (37,[0])
            // List permissions that are NOT in a list (0, [2,3,4,5,6])

            var specificCategory = this.CategoryName != null;

            var ds = AdminProxy.ListDataViews(-1, CategoryName, specificCategory, null, false);

            initHooksForMdiParent(ds.Tables["list_dataviews"], "dataview_name", "dataview_name", (specificCategory ? null : "category_code"));
            lvDataviews.Items.Clear();
            foreach (DataRow dr in ds.Tables["list_dataviews"].Rows)
            {
                var lvi = new ListViewItem(dr["dataview_name"].ToString(), 0);
                lvi.Tag = dr["dataview_name"].ToString();
                lvi.SubItems.Add(dr["title"].ToString());
                lvi.SubItems.Add(dr["category_name"].ToString());
                lvi.SubItems.Add(dr["database_area"].ToString());
                lvi.SubItems.Add((Toolkit.ToDateTime(dr["last_touched_date"], DateTime.MinValue)).ToLocalTime().ToString());
                lvi.SubItems.Add(dr["description"].ToString());
                lvDataviews.Items.Add(lvi);
            }

            selectRememberedTags(lvDataviews, tags);

            MainFormUpdateStatus(getDisplayMember("RefreshData{refreshed}", "Refreshed Dataviews"), false);
        }