Пример #1
0
        protected void UserTypeList_IndexChanged(object sender, EventArgs e)
        {
            VisibleButtonSaveTemplate(false);

            if (Frame.UserTypeList.SelectedValue == "")
            {
                Frame.UserList.Items.Clear();
                Frame.UserList.Items.Add(new ListItem {
                    Text = "Не выбрано", Value = ""
                });
                SetCss(Frame.UserList, "default_border");

                if (Frame.UserTypeList.SelectedValue == "" && Frame.UserList.SelectedValue == "")
                {
                    Frame.EntityList.SelectedIndex = 0;
                    MView.ActiveViewIndex          = 0;
                    SetCss(Frame.UserTypeList, "default_border");
                    SetCss(Frame.EntityList, "default_border");
                }
                GVPermission.DataSource = null;
                GVPermission.DataBind();
                return;
            }
            if (Frame.EntityList.SelectedValue != "")
            {
                return;
            }

            Frame.UserList.Items.Clear();
            DataSourceUserDDL(Frame.UserTypeList.SelectedValue);

            var query = string.Format(@"select iif(t.alias is NULL,'Шаблон',t.alias) typeAlias, p.* from Permission.UserTypePermission({0},NULL)p 
                                        left join model.BTables b on b.name=p.entity 
                                        left join model.AppTypes t on t.object_id=b.appTypeID 
                                        where  p.objID is NULL
                                        order by p.entityAlias", Frame.UserTypeList.SelectedValue);

            FillGridView(query);

            MView.ActiveViewIndex = 0;
            SetCss(Frame.UserTypeList, "green_border");
        }
Пример #2
0
 private void FillGridView(string query)
 {
     GVPermission.DataSource = QueryToDB(query);
     GVPermission.DataBind();
 }