Пример #1
0
        private void cmIzinFormGuncelle_Click(object sender, EventArgs e)
        {
            try
            {
                if (viewRoleIzinleri.FocusedRowHandle < 0)
                {
                    return;
                }

                PermEx rPermEx = viewRoleIzinleri.GetFocusedRow() as PermEx;
                short  type    = 0;
                if (rPermEx.Tip == "Kontrol")
                {
                    type = 1;
                }
                else if (rPermEx.Tip == "None")
                {
                    type = -1;
                }

                using (formIzinEkle fmIzinEkle = new formIzinEkle {
                    Izin = new Perm {
                        PermName = rPermEx.PermName, Group = rPermEx.Group, Type = type
                    }
                })
                {
                    if (fmIzinEkle.ShowDialog() == DialogResult.OK)
                    {
                        string rolName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName).ToString2();
                        if (rolName.IsNotNullEmpty())
                        {
                            gridRoleIzinleri.DataSource = Yetki.GetRolePerms(rolName);
                        }
                        else
                        {
                            gridRoleIzinleri.DataSource = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Mesaj.Hata(ex);
            }
        }
Пример #2
0
 private void cmIzinFormEkle_Click(object sender, EventArgs e)
 {
     try
     {
         formIzinEkle fmIzinEkle = new formIzinEkle();
         if (fmIzinEkle.ShowDialog() == DialogResult.OK)
         {
             string rolName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName).ToString2();
             if (rolName.IsNotNullEmpty())
             {
                 gridRoleIzinleri.DataSource = Yetki.GetRolePerms(rolName);
             }
             else
             {
                 gridRoleIzinleri.DataSource = null;
             }
         }
     }
     catch (Exception ex)
     {
         Mesaj.Hata(ex);
     }
 }