private void bbtnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (viewKullanicilar.FocusedRowHandle < 0) { return; } ActiveControl = groupControl1; string userName = viewKullanicilar.GetFocusedRowCellDisplayText(gcuUserName); string roleName = glueRol.EditValue.ToString2(); List <PermEx> permList = gridKullaniciIzinleri.DataSource as List <PermEx>; bool sonuc = Yetki.InsertUpdateUserPerm(roleName, userName, permList, ""); if (sonuc) { if (glueRol.EditValue.IsNullEmpty()) { viewKullanicilar.SetFocusedRowCellValue(gcuRole, null); } else { viewKullanicilar.SetFocusedRowCellValue(gcuRole, glueRol.EditValue); } Mesaj.Bilgi(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void bbtnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (viewRoles.FocusedRowHandle < 0) { return; } ActiveControl = groupControl1; string rolName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName); List <PermEx> rolePermList = gridRoleIzinleri.DataSource as List <PermEx>; bool sonuc = Yetki.InsertUpdateRolePerm(rolName, rolePermList, ""); if (sonuc) { Mesaj.Bilgi(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void viewKullanicilar_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { if (viewKullanicilar.FocusedRowHandle < 0) { gridKullaniciIzinleri.DataSource = null; return; } string role = viewKullanicilar.GetFocusedRowCellDisplayText(gcuRole).Trim(); if (role == "") { glueRol.EditValue = null; } else { glueRol.EditValue = role; } var UserPermList = Yetki.GetUserPerms(viewKullanicilar.GetFocusedRowCellDisplayText(gcuUserName)); gridKullaniciIzinleri.DataSource = UserPermList; } catch (Exception ex) { Mesaj.Hata(ex); } }
private void btnLogin_Click(object sender, EventArgs e) { try { if (SirketAktif && lueSirket.EditValue.IsNullEmpty()) { Mesaj.Uyari("Lütfen Şirket Seçiniz."); //this.DialogResult = DialogResult.None; } else { Kullanici = Yetki.LoginKontrol(Tip, SirketKod, txtUserID.Text.ToString2(), txtPass.Text.ToString2()); if (Kullanici.IsNotNullEmpty()) { girisBasarili = true; this.DialogResult = DialogResult.OK; } else { Mesaj.Uyari("Giriş başarısız !! \nKullanıcı bilgilerinizi kontrol ediniz. "); this.DialogResult = DialogResult.None; } } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void btnRolKaydet_Click(object sender, EventArgs e) { try { bool sonuc = false; if (RoleName.IsNullEmpty()) ///YENİ KAYIT { Role role = new Role(); role.RoleName = txtRoleName.Text.ToString2(); sonuc = Yetki.AddRoles(role); } else ///GÜNCELLEME { sonuc = Yetki.UpdateRoles(RoleName, txtRoleName.Text.ToString2()); } if (sonuc) { Mesaj.Bilgi(); DialogResult = DialogResult.OK; } else { DialogResult = DialogResult.Cancel; } } catch (Exception hata) { Mesaj.Hata(hata); } }
private void Login_FormClosing(object sender, FormClosingEventArgs e) { try { } catch (Exception ex) { Mesaj.Hata(ex, "İşlem Sırasında Bir Hata Oluştu"); } }
private void Login_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { btnLogin_Click(null, null); } } catch (Exception ex) { Mesaj.Hata(ex, "İşlem Sırasında Bir Hata Oluştu"); } }
private void cmRolEkle_Click(object sender, EventArgs e) { try { formRolEkle fmRolEkle = new formRolEkle(); if (fmRolEkle.ShowDialog() == DialogResult.OK) { gridRoles.DataSource = Yetki.GetRoles(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void cmKullaniciEkle_Click(object sender, EventArgs e) { try { formKullaniciEkle fmKullaniciEkle = new formKullaniciEkle(KulKod); if (fmKullaniciEkle.ShowDialog() == DialogResult.OK) { gridKullanicilar.DataSource = Yetki.GetUsers(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
void VerileriGetir() { try { gridRoles.DataSource = Yetki.GetRoles(); string rolName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName); if (rolName.IsNotNullEmpty()) { gridRoleIzinleri.DataSource = Yetki.GetRolePerms(rolName); } } catch (Exception ex) { Mesaj.Hata(ex); } }
void VerileriGetir() { try { glueRol.Properties.DataSource = Yetki.GetRoles(); gridKullanicilar.DataSource = Yetki.GetUsers(); string userName = viewKullanicilar.GetFocusedRowCellDisplayText(gcuUserName); if (userName.IsNotNullEmpty()) { gridKullaniciIzinleri.DataSource = Yetki.GetUserPerms(userName); } } catch (Exception ex) { Mesaj.Hata(ex); } }
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); } }
private void viewRoles_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { if (viewRoles.FocusedRowHandle < 0) { gridRoleIzinleri.DataSource = null; return; } var RolPermList = Yetki.GetRolePerms(viewRoles.GetFocusedRowCellDisplayText(gcRoleName)); gridRoleIzinleri.DataSource = RolPermList; } catch (Exception ex) { Mesaj.Hata(ex); } }
private void glueRol_EditValueChanged(object sender, EventArgs e) { try { if (viewKullanicilar.FocusedRowHandle < 0) { return; } if (viewKullanicilar.GetFocusedRowCellValue(gcuAdmin).ToBool()) { return; } if (glueRol.EditValue.IsNullEmpty()) { //gridKullaniciIzinleri.DataSource = Yetki.GetRolePerms(""); gcpReading.OptionsColumn.ReadOnly = false; gcpWriting.OptionsColumn.ReadOnly = false; gcpDeleting.OptionsColumn.ReadOnly = false; viewKullaniciIzinleri.OptionsBehavior.Editable = true; } else { gridKullaniciIzinleri.DataSource = Yetki.GetRolePerms(glueRol.EditValue.ToString2()); gcpReading.OptionsColumn.ReadOnly = true; gcpWriting.OptionsColumn.ReadOnly = true; gcpDeleting.OptionsColumn.ReadOnly = true; viewKullaniciIzinleri.OptionsBehavior.Editable = false; } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void cmRolSil_Click(object sender, EventArgs e) { try { if (viewRoles.FocusedRowHandle < 0) { return; } string rolName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName); bool sonuc = Yetki.DeleteRoles(rolName); if (sonuc) { gridRoles.DataSource = Yetki.GetRoles(); Mesaj.Bilgi(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
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); } }
private void cmKullaniciSil_Click(object sender, EventArgs e) { try { if (viewKullanicilar.FocusedRowHandle < 0) { return; } string userName = viewKullanicilar.GetFocusedRowCellDisplayText(gcuUserName); bool sonuc = Yetki.DeleteUser(userName); if (sonuc) { VerileriGetir(); Mesaj.Bilgi(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void cmIzinFormSil_Click(object sender, EventArgs e) { try { if (viewRoleIzinleri.FocusedRowHandle < 0) { return; } string permName = viewRoleIzinleri.GetFocusedRowCellDisplayText(gcpPermName); bool sonuc = Yetki.DeletePerm(permName); if (sonuc) { VerileriGetir(); Mesaj.Bilgi(); } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void cmKullaniciGuncelle_Click(object sender, EventArgs e) { try { if (viewKullanicilar.FocusedRowHandle < 0) { return; } User Kul = viewKullanicilar.GetFocusedRow() as User; using (formKullaniciEkle fmKullaniciEkle = new formKullaniciEkle(KulKod) { Kullanici = Kul }) { if (fmKullaniciEkle.ShowDialog() == DialogResult.OK) { gridKullanicilar.DataSource = Yetki.GetUsers(); string userName = viewKullanicilar.GetFocusedRowCellDisplayText(gcuUserName).ToString2(); if (userName.IsNotNullEmpty()) { gridKullaniciIzinleri.DataSource = Yetki.GetUserPerms(userName); } else { gridKullaniciIzinleri.DataSource = null; } } } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void cmRolGuncelle_Click(object sender, EventArgs e) { try { if (viewRoles.FocusedRowHandle < 0) { return; } using (formRolEkle fmRolEkle = new formRolEkle { RoleName = viewRoles.GetFocusedRowCellDisplayText(gcRoleName) }) { if (fmRolEkle.ShowDialog() == DialogResult.OK) { gridRoles.DataSource = Yetki.GetRoles(); } } } catch (Exception ex) { Mesaj.Hata(ex); } }
private void bbtnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (txtKullaniciAdi.Text.IsNullEmpty()) { Mesaj.Uyari("Kullanıcı adı girmelisiniz !"); return; } if (txtParola.Text.IsNullEmpty()) { Mesaj.Uyari("Parola girmelisiniz !"); return; } string[] sirketler = txtSirketKodu.Text.Trim().Split(','); bool sonuc = false; if (Kullanici.IsNullEmpty()) { List <User> kulList = new List <User>(); for (int i = 0; i < sirketler.Length; i++) { Kullanici = new User(); Kullanici.DefaultValueSet("ID"); Kullanici.AdSoyad = txtAdiSoyadi.Text; Kullanici.Kod = txtKullaniciAdi.Text.ToString2(); Kullanici.Email = txtEmail.Text; Kullanici.Sifre = Sifreleme.Sifrele(txtParola.Text.ToString2()); Kullanici.Aktif = chkAktif.Checked; Kullanici.Admin = chkAdmin.Checked; Kullanici.Sirket = sirketler[i]; Kullanici.Tip = 1; Kullanici.Kaydeden = KulKod; Kullanici.Degistiren = KulKod; Kullanici.KayitSurum = "1.0.0"; Kullanici.DegisSurum = "1.0.0"; Kullanici.KayitTarih = DateTime.Today.ToOADate().ToInt32(); Kullanici.DegisTarih = Kullanici.KayitTarih; Kullanici.KayitSaat = DateTime.Now.TimeInt(); Kullanici.DegisSaat = Kullanici.KayitSaat; kulList.Add(Kullanici); } sonuc = Yetki.AddUser(kulList); } else { User eskiKul = new User(); eskiKul.Kod = Kullanici.Kod; eskiKul.Tip = Kullanici.Tip; eskiKul.Sirket = Kullanici.Sirket; Kullanici.Kod = txtKullaniciAdi.Text.ToString2(); Kullanici.AdSoyad = txtAdiSoyadi.Text; Kullanici.Email = txtEmail.Text; Kullanici.Sifre = Sifreleme.Sifrele(txtParola.Text.ToString2()); Kullanici.Aktif = chkAktif.Checked; Kullanici.Admin = chkAdmin.Checked; Kullanici.Sirket = sirketler[0]; Kullanici.Degistiren = KulKod; Kullanici.DegisTarih = DateTime.Today.ToOADate().ToInt32(); Kullanici.DegisSaat = DateTime.Now.TimeInt(); sonuc = Yetki.UpdateUser(eskiKul, Kullanici); } if (sonuc) { Mesaj.Bilgi(); DialogResult = DialogResult.OK; } else { DialogResult = DialogResult.Cancel; } } catch (Exception ex) { Mesaj.Hata(ex); } }