示例#1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            int       oID;
            string    str;
            string    str1;
            string    str2;
            SysGrants sysGrant = new SysGrants();

            for (int i = 0; i < this._layers.Count; i++)
            {
                LayerClass item = this._layers[i];
                string     str3 = this.dataGridView1.Rows[i].Cells[1].Value.ToString();
                if (str3 == "无")
                {
                    item.Privilege = 0;
                }
                else if (str3 == "可见")
                {
                    item.Privilege = 1;
                }
                else if (str3 == "可编辑")
                {
                    item.Privilege = 2;
                }
                if (item.Privilege == 0)
                {
                    if (item.Change)
                    {
                        SysGrants sysGrant1 = sysGrant;
                        string    str4      = this._id.ToString();
                        str = (this._type == 0 ? "Roles" : "Staff");
                        oID = item.OID;
                        sysGrant1.DeleteGrant(str4, str, oID.ToString(), item.DataType);
                    }
                }
                else if (!item.Exist)
                {
                    SysGrants sysGrant2 = sysGrant;
                    string    str5      = this._id.ToString();
                    str2 = (this._type == 0 ? "Roles" : "Staff");
                    string str6     = item.OID.ToString();
                    string dataType = item.DataType;
                    oID = item.Privilege;
                    sysGrant2.AddGrant(str5, str2, "admin", str6, dataType, oID.ToString());
                }
                else if (item.Change)
                {
                    SysGrants sysGrant3 = sysGrant;
                    string    str7      = this._id.ToString();
                    str1 = (this._type == 0 ? "Roles" : "Staff");
                    string str8      = item.OID.ToString();
                    string dataType1 = item.DataType;
                    oID = item.Privilege;
                    sysGrant3.UpdateGrant(str7, str1, str8, dataType1, oID.ToString());
                }
            }
        }
示例#2
0
 private void btnDeleteMenu_Click(object sender, EventArgs e)
 {
     if (this.lvFunctions.SelectedItems.Count > 0)
     {
         ORGRole   tag      = this.lvRoles.SelectedItems[0].Tag as ORGRole;
         SysGrants sysGrant = new SysGrants();
         for (int i = this.lvFunctions.SelectedItems.Count - 1; i >= 0; i--)
         {
             ListViewItem item     = this.lvFunctions.SelectedItems[i];
             MenuInfo     menuInfo = item.Tag as MenuInfo;
             sysGrant.DeleteGrant(tag.RoleID, "Roles", menuInfo.MenuID, "gisPluge");
             this.lvFunctions.Items.Remove(item);
         }
     }
 }
示例#3
0
 private void btnDeleteLayers_Click(object sender, EventArgs e)
 {
     if (this.lvLayers.SelectedItems.Count > 0)
     {
         SysGrants sysGrant = new SysGrants();
         for (int i = this.lvLayers.SelectedItems.Count - 1; i >= 0; i--)
         {
             ListViewItem item   = this.lvLayers.SelectedItems[i];
             LayerClass   tag    = item.Tag as LayerClass;
             string       roleID = (this.lvRoles.SelectedItems[0].Tag as ORGRole).RoleID;
             int          oID    = tag.OID;
             sysGrant.DeleteGrant(roleID, "Roles", oID.ToString(), tag.DataType);
             this.lvLayers.Items.Remove(item);
         }
     }
 }
示例#4
0
 private void btnDeleteMenu_Click(object sender, EventArgs e)
 {
     if (this.lvFunctions.SelectedItems.Count > 0)
     {
         Staff     tag      = this.lvStaff.SelectedItems[0].Tag as Staff;
         SysGrants sysGrant = new SysGrants();
         for (int i = this.lvFunctions.SelectedItems.Count - 1; i >= 0; i--)
         {
             ListViewItem item = this.lvFunctions.SelectedItems[i];
             if (item.Group == this.lvFunctions.Groups[0])
             {
                 MenuInfo menuInfo = item.Tag as MenuInfo;
                 sysGrant.DeleteGrant(tag.StaffID, "Staff", menuInfo.MenuID, "gisPluge");
             }
             this.lvFunctions.Items.Remove(item);
         }
     }
 }
示例#5
0
 private void btnDeleteLayers_Click(object sender, EventArgs e)
 {
     if (this.lvLayers.SelectedItems.Count > 0)
     {
         SysGrants sysGrant = new SysGrants();
         for (int i = this.lvLayers.SelectedItems.Count - 1; i >= 0; i--)
         {
             ListViewItem item = this.lvLayers.SelectedItems[i];
             if (item.Group == this.lvLayers.Groups[0])
             {
                 LayerClass tag     = item.Tag as LayerClass;
                 string     staffID = (this.lvStaff.SelectedItems[0].Tag as Staff).StaffID;
                 int        oID     = tag.OID;
                 sysGrant.DeleteGrant(staffID, "Staff", oID.ToString(), tag.DataType);
                 this.lvLayers.Items.Remove(item);
             }
         }
     }
 }