private void btnKaydet_Click(object sender, EventArgs e) { if (!Genel.Yetkilerim.Contains(30)) { Genel.Yetki_Uyari(30); return; } try { this.Cursor = Cursors.WaitCursor; int temp_KullaniciID = Convert.ToInt32(lookUpKullanicilar.EditValue); Isler.Yetki.Sil_KullaniciYetki(temp_KullaniciID); Isler.Yetki.Ekle_KullaniciYetki(dt_Yetkiler, temp_KullaniciID); XtraMessageBox.Show("Yetkiler Başarılı Bir Şekilde Kullanıcıya Atanmıştır.", "İşlem Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Cursor = Cursors.Default; } catch (Exception hata) { XtraMessageBox.Show("Yetkiler Kullanıcıya Atanırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmBase_Load(object sender, EventArgs e) { foreach (Control item in this.Controls) { Genel.Ekle_Sitil(item); } }
public Kaydet(Genel _oyuncu, Oyun _oyunFormu, AnaMenu _anaMenu) { InitializeComponent(); oyuncu = _oyuncu; anaMenu = _anaMenu; oyunFormu = _oyunFormu; }
public static bool Varmi_Yetki(int YetkiID, bool Uyari = true) { bool Sonuc = false; if (Genel.Yetkilerim != null && Genel.Yetkilerim.Contains(YetkiID)) { Sonuc = true; } if (!Sonuc) { using (VeriErisim veri = new VeriErisim()) { veri.SqlCumlesi = "Select Count(*) From yetki_kullanici Where YetkiID=@YetkiID And KullaniciID=@KullaniciID"; veri.Ekle_Param("@KullaniciID", Genel.AktifKullanici.KullaniciID, MySqlDbType.Int32); veri.Ekle_Param("@YetkiID", YetkiID, MySqlDbType.Int32); if (Convert.ToInt32(veri.ExecuteScalar()) > 0) { Sonuc = true; } } } if (!Sonuc && Uyari) { Genel.Yetki_Uyari(YetkiID); } return(Sonuc); }
private void tsYeni_Click(object sender, EventArgs e) { tsKaydet.Enabled = true; tsDegistir.Enabled = false; tsSil.Enabled = false; Genel.Temizle(tpOgrenciKayit); }
private void tsYeni_Click(object sender, EventArgs e) { tsKaydet.Enabled = true; tsDegistir.Enabled = false; tsSil.Enabled = false; Genel.Temizle(tpOgrenciKayit); //???TabPage control'lerinde aratılacak. txtAdi.Focus(); }
public Genel GetSingle() { var geneldata = _genelDal.GetFirstSingle(); if (geneldata == null) { geneldata = new Genel(); _genelDal.AddWithSave(geneldata); } return(geneldata); }
void Sil() { if (cari == null) { return; } if (!Genel.Yetkilerim.Contains(12)) { Genel.Yetki_Uyari(12); return; } try { if (Isler.Cari.Ver_AdetCariHareket(cari.CariID) > 0) { XtraMessageBox.Show("Seçili Cari Hesap Hareket Görmüş; Silinemez.", "Geçersiz İşlem", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (XtraMessageBox.Show("Seçili Cari Hesabı Silmek İstediğinize Emin Misiniz?\n" + "Cari Hesap No: " + cari.CariID.ToString() + "\nÜnvanı : " + cari.Unvan, "Cari Hesap Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(cari); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Cari Hesap Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } } } catch (Exception hata) { XtraMessageBox.Show("Cari Hesap Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Sil() { if (GridViewStokDepo.GetFocusedDataRow() == null) { return; } if (!Genel.Yetkilerim.Contains(21)) { Genel.Yetki_Uyari(21); return; } try { if (Isler.Stok.Ver_AdetDepoHareket(depo.DepoID) > 0) { XtraMessageBox.Show("Bu Depo Üzerinden Stok Giriş/Çıkış İşlemleri Yapılmış.\nBu Yüzden Depo Silinemez.", "Geçersiz İşlem", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } string temp_depoad = GridViewStokDepo.GetFocusedDataRow()["DepoAd"].ToString(); string temp_depoid = GridViewStokDepo.GetFocusedDataRow()["DepoID"].ToString(); if (XtraMessageBox.Show("Seçili Depoyu Silmek İstediğinize Emin Misiniz?\n" + "Depo No : " + temp_depoid + "\nDepo Adı : " + temp_depoad, "Depo Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(depo); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Depo Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); Ara(); } } catch (Exception hata) { XtraMessageBox.Show("Depo Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Sil() { if (kart == null) { return; } if (!Genel.Yetkilerim.Contains(4)) { Genel.Yetki_Uyari(4); return; } try { if (Isler.Stok.Ver_AdetStokHareket(kart.KartID) > 0) { XtraMessageBox.Show("Bu Stok Kartı Hareket Görmüş, Silinemez.", "Geçersiz İşlem", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (XtraMessageBox.Show("Seçili Stok Kartını Silmek İstediğinize Emin Misiniz?\n" + "Kalem Adı : " + kart.KalemAdi + "\nKalem No : " + kart.KartID, "Stok Kartı Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(kart); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Stok Kartı Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } } } catch (Exception hata) { XtraMessageBox.Show("Stok Kartı Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Sil() { if (GridViewSirketler.GetFocusedDataRow() == null) { return; } if (!Genel.Yetkilerim.Contains(19)) { Genel.Yetki_Uyari(19); return; } try { //Burada şirket işlem bilgisi kontrol edilecek. //Eğer şirket üzerinden herhangi bir işlem yapılmış ise silme yapılmayacak. string temp_SirketID = GridViewSirketler.GetFocusedDataRow()["SirketID"].ToString(); string temp_KisaAd = GridViewSirketler.GetFocusedDataRow()["KisaAd"].ToString(); if (XtraMessageBox.Show("Seçili Şirketi Silmek İstediğinize Emin Misiniz?\n" + "Şirket No : " + temp_SirketID + "\nKısa Adı : " + temp_KisaAd, "Şirket Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(Sirket); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Şirket Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); Ara(); } } catch (Exception hata) { XtraMessageBox.Show("Şirket Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Sil() { if (isc == null) { return; } if (!Genel.Yetkilerim.Contains(28)) { Genel.Yetki_Uyari(28); return; } try { //Burada fatura kontrol edilecek //Eğer bu işçilik ile fatura kesilmiş ise silme işlemi yapılamayacak. if (XtraMessageBox.Show("Seçili İşçiliği Silmek İstediğinize Emin Misiniz?\n" + "İşçilik Adı : " + isc.IscilikAd + "\nİşçilik No : " + isc.IscilikID.ToString(), "İşçilik Kartı Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(isc); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "İşçilik Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } } } catch (Exception hata) { XtraMessageBox.Show("İşçilik Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Sil() { if (ks == null) { return; } if (!Genel.Yetkilerim.Contains(50)) { Genel.Yetki_Uyari(50); return; } try { //Burada kasa hareketi kontrol edilecek //Eğer kasa hareket varsa silme işlemi yapılamayacak. if (XtraMessageBox.Show("Seçili Kasayı Silmek İstediğinize Emin Misiniz?\n" + "Kasa No: " + ks.KasaID.ToString() + "\nKasa Adı : " + ks.KasaAd, "Kasa Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(ks); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Kasa Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } } } catch (Exception hata) { XtraMessageBox.Show("Kasa Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tsKaydet_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtAdi.Text) && !string.IsNullOrEmpty(txtSoyadi.Text) && !string.IsNullOrEmpty(txtTaksitTutari.Text)) { if (os.OgrenciKontrolByTCKNo(txtTCKNo.Text)) { MessageBox.Show("Bu tcye ait öğrenci var"); txtTCKNo.Focus(); } else { Ogrenci o = new Ogrenci(); o.TCKNo = txtTCKNo.Text; o.Adi = txtAdi.Text; o.Soyadi = txtSoyadi.Text; o.SinifId = sinifid; o.Telefon = txtTelefon.Text; o.Adres = txtAdres.Text; o.TaksitSayisi = Convert.ToByte(txtTaksitSayisi.Text); o.TaksitTutari = Convert.ToDouble(txtTaksitTutari.Text); if (os.OgrenciEkle(o)) { Listele(os.OgrenciListesi(), dgvOgrenciler); MessageBox.Show("Ogrenci başarıyla eklendi"); Genel.Temizle(tpOgrenciKayit); tsKaydet.Enabled = false; } } tsKaydet.Enabled = false; } else { MessageBox.Show("Eksik bilgi girişi.", "Dikkat eksik bilgi!!"); } txtAdi.Focus(); }
void Sil() { if (GridViewKullanici.GetFocusedDataRow() == null) { return; } if (!Genel.Yetkilerim.Contains(7)) { Genel.Yetki_Uyari(7); return; } try { //Burada kullanıcı işlem bilgisi kontrol edilecek. //Eğer kullanıcı üzerinden herhangi bir işlem yapılmış ise silme yapılmayacak. string temp_kullanicidi = GridViewKullanici.GetFocusedDataRow()["KullaniciAd"].ToString(); if (XtraMessageBox.Show("Seçili Kullanıcıyı Silmek İstediğinize Emin Misiniz?\n" + "Kullanıcı Adı : " + temp_kullanicidi, "Kullanıcı Sil Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { dbModel.DeleteObject(kull); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Kullanıcı Başarılı Bir Şekilde Silinmiştir", null, ResOtoSis.mark_blue); Ara(true); } } catch (Exception hata) { XtraMessageBox.Show("Kullanıcı Silme İşlemi Sırasında Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Kaydet() { try { #region Kontroller if (spinMiktar.Value == 0) { XtraMessageBox.Show("Lütfen Tahsis Miktarını 0'dan Büyük Bir Değer Giriniz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); spinMiktar.Focus(); spinMiktar.Select(); return; } if (ucStokKartDemo1.Secili_KartID <= 0) { XtraMessageBox.Show("Lütfen Stok Tahsis Yapılacak Stok Kalemini Seçiniz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); ucStokKartDemo1.Focus(); ucStokKartDemo1.Select(); return; } int temp_DepoID = Convert.ToInt32(lookUpDepolar.EditValue); if (radioGroup1.SelectedIndex == 1 && !Genel.Varmi_Stokta(ucStokKartDemo1.Secili_KartID, temp_DepoID, spinMiktar.Value)) { return; } if (string.IsNullOrEmpty(memoAciklama.Text.Trim())) { XtraMessageBox.Show("Stok Tahsisi Eklerken Açıklama Girilmesi Zorunludur.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); memoAciklama.Focus(); memoAciklama.Select(); return; } if (XtraMessageBox.Show("Stok Tahsis Eklemek İstediğinize Emin Misiniz?", "Kayıt Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } #endregion #region Aktarma - Kayıt if (hareket != null && hareket.EntityState != EntityState.Detached) { dbModel.Detach(hareket); } hareket = null; hareket = new stok_hareket(); if (radioGroup1.SelectedIndex == 0) { hareket.Giris = true; } else { hareket.Giris = false; } hareket.Aciklama = memoAciklama.Text; hareket.StokKartID = ucStokKartDemo1.Secili_KartID; hareket.StokHareketTipi = ((int)Enumlar.StokHareketTipleri.StokTahsisi).ToString(); hareket.Miktar = spinMiktar.Value; hareket.DepoID = temp_DepoID; hareket.ParcaNo = ucStokKartDemo1.sk.ParcaNo; hareket.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; hareket.KayitZaman = DateTime.Now; dbModel.AddTostok_hareket(hareket); dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Stok Tahsisi Başarılı Bir Şekilde Eklenmiştir.", null, ResOtoSis.mark_blue); #endregion if (XtraMessageBox.Show("Başka Stok Tahsis İşlemi Yapmak İstiyor Musunuz?", "Başka İşlem Yapılacak Mı?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { this.Close(); } else { ucStokKartDemo1.Temizle_Kart(); Temizle_StokTahsis(); } } catch (Exception hata) { XtraMessageBox.Show("Stok Tahsisi Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Kaydet() { if (_YeniKayit && !Genel.Yetkilerim.Contains(48)) { Genel.Yetki_Uyari(48); return; } else if (!_YeniKayit && !Genel.Yetkilerim.Contains(49)) { Genel.Yetki_Uyari(49); return; } try { #region < Kontroller > if (string.IsNullOrEmpty(txtKasaAd.Text.Trim())) { XtraMessageBox.Show("Kasa Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); tabKasa.SelectedTabPageIndex = 0; txtKasaAd.Focus(); txtKasaAd.Select(); return; } if (_YeniKayit && Isler.Kasa.Varmi_KasaAd(txtKasaAd.Text)) { XtraMessageBox.Show("Bu Kasa Adı Daha Önce Tanımlanmış.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKasaAd.Focus(); txtKasaAd.Select(); return; } else if (!_YeniKayit && txtKasaAd.Text != ks.KasaAd && Isler.Kasa.Varmi_KasaAd(txtKasaAd.Text, ks.KasaAd)) { XtraMessageBox.Show("Bu Kasa Adı Daha Önce Tanımlanmış.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKasaAd.Focus(); txtKasaAd.Select(); return; } #endregion if (_YeniKayit) { if (ks != null && ks.EntityState != EntityState.Detached) { dbModel.Detach(ks); } ks = null; ks = new kasa(); ks.SirketID = Genel.AktifSirket.SirketID; } #region Aktarma ks.KasaAd = txtKasaAd.Text; ks.Durum = chkDurum.Checked; ks.Aciklama = memoAciklama.Text; #endregion #region Kayıt if (_YeniKayit) { ks.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; ks.KayitZaman = DateTime.Now; dbModel.AddTokasas(ks); } else { ks.DuzenKullaniciID = Genel.AktifKullanici.DuzenKullaniciID; ks.DuzenZaman = DateTime.Now; } dbModel.SaveChanges(); _Secili_KasaID = ks.KasaID; txtKasaID.Text = ks.KasaID.ToString(); _YeniKayit = false; Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Kasa Başarılı Bir Şekilde Kaydedilmiştir.", null, ResOtoSis.mark_blue); if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.Kaydedildi, null); } if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } pageKasaHareketleri.PageEnabled = true; #endregion } catch (Exception hata) { XtraMessageBox.Show("Kasa Kayıdı Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Kaydet() { if (YeniKayit && !Genel.Yetkilerim.Contains(26)) { Genel.Yetki_Uyari(26); return; } else if (!YeniKayit && !Genel.Yetkilerim.Contains(27)) { Genel.Yetki_Uyari(27); return; } try { #region Kontroller if (string.IsNullOrEmpty(txtIscilikAdi.Text.Trim())) { XtraMessageBox.Show("İşçilik Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIscilikAdi.Focus(); txtIscilikAdi.Select(); return; } if (lookUpIscilikTip.EditValue.ToString() == "-1") { XtraMessageBox.Show("Lütfen İşçilik Tipini Seçiniz.", "Değer Seçilmemiş", MessageBoxButtons.OK, MessageBoxIcon.Warning); lookUpIscilikTip.Focus(); lookUpIscilikTip.Select(); return; } if (YeniKayit && Isler.Iscilik.Varmi_Iscilik(Genel.AktifSirket.SirketID, txtIscilikAdi.Text)) { XtraMessageBox.Show("Bu İşçilik Adı Daha Önce Kullanılmış\nLütfen Farklı Bir İşçilik Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIscilikAdi.Focus(); txtIscilikAdi.Select(); return; } else if (!YeniKayit && txtIscilikAdi.Text != isc.IscilikAd && Isler.Iscilik.Varmi_Iscilik(Genel.AktifSirket.SirketID, txtIscilikAdi.Text, isc.IscilikAd)) { XtraMessageBox.Show("Bu İşçilik Adı Daha Önce Kullanılmış\nLütfen Farklı Bir İşçilik Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtIscilikAdi.Focus(); txtIscilikAdi.Select(); return; } if (spinKacSaat.Value == 0) { XtraMessageBox.Show("Saat Değeri 0'dan Büyük Olmalıdır.", "Geçersiz Saat Değeri", MessageBoxButtons.OK, MessageBoxIcon.Warning); spinKacSaat.Focus(); spinKacSaat.Select(); return; } #endregion if (YeniKayit) { if (isc != null && isc.EntityState != EntityState.Detached) { dbModel.Detach(isc); isc = null; } isc = new iscilik(); isc.SirketID = Genel.AktifSirket.SirketID; } #region Aktarma isc.IscilikAd = txtIscilikAdi.Text; isc.KacSaat = spinKacSaat.Value; isc.IscilikTip = lookUpIscilikTip.EditValue.ToString(); isc.Durum = chkDurum.Checked; #endregion #region Kayıt if (YeniKayit) { isc.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; isc.KayitZaman = DateTime.Now; dbModel.AddToisciliks(isc); } else { isc.DuzenKullaniciID = Genel.AktifKullanici.KullaniciID; isc.DuzenZaman = DateTime.Now; } dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "İşçilik Başarılı Bir Şekilde Kaydedilmiştir.", null, ResOtoSis.mark_blue); _Secili_Iscilik = isc.IscilikID; if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.Kaydedildi, null); } if (DetayOlay != null) { this.Invoke(DetayOlay, Enumlar.DetayOlaylari.AramaGerekli, null); } Yeni(); #endregion } catch (Exception hata) { XtraMessageBox.Show("İşçilik Kayıdı Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Kaydet() { if (YeniKayit && !Genel.Yetkilerim.Contains(22)) { Genel.Yetki_Uyari(22); return; } else if (!YeniKayit && !Genel.Yetkilerim.Contains(23)) { Genel.Yetki_Uyari(23); return; } try { #region Kontroller if (string.IsNullOrEmpty(txtDepoAd.Text.Trim())) { XtraMessageBox.Show("Depo Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtDepoAd.Focus(); txtDepoAd.Select(); return; } if (YeniKayit && Isler.Stok.Varmi_DepoAdi(txtDepoAd.Text)) { XtraMessageBox.Show("Bu Depo Adı Daha Önce Kullanılmış\nLütfen Farklı Bir Depo Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtDepoAd.Focus(); txtDepoAd.Select(); return; } else if (!YeniKayit && txtDepoAd.Text != depo.DepoAd && Isler.Stok.Varmi_DepoAdi(txtDepoAd.Text, depo.DepoAd)) { XtraMessageBox.Show("Bu Depo Adı Daha Önce Kullanılmış\nLütfen Farklı Bir Depo Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtDepoAd.Focus(); txtDepoAd.Select(); return; } #endregion if (YeniKayit) { if (XtraMessageBox.Show("Depo Aşağıdaki Şirket Üzerine Açılak:\n\n" + "Şirket No : " + Genel.AktifSirket.SirketID.ToString() + "\nŞirket Adı : " + Genel.AktifSirket.KisaAd, "Depo Ekleme Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } if (depo != null && depo.EntityState != EntityState.Detached) { dbModel.Detach(depo); } depo = null; depo = new stok_depo(); depo.SirketID = Genel.AktifSirket.SirketID; } #region Aktarma depo.Aciklama = memoAciklama.Text; depo.DepoAd = txtDepoAd.Text; depo.Kilitli = chkKilitli.Checked; depo.Lokasyon = memoLokasyon.Text; #endregion #region Kayıt if (YeniKayit) { depo.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; depo.KayitZaman = DateTime.Now; dbModel.AddTostok_depo(depo); } else { depo.DuzenKullaniciID = Genel.AktifKullanici.KullaniciID; depo.DuzenZaman = DateTime.Now; } dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Depo Başarılı Bir Şekilde Kaydedilmiştir.", null, ResOtoSis.mark_blue); Ara(); #endregion } catch (Exception hata) { XtraMessageBox.Show("Depo Kayıdı Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void GuncelleKaydet(Genel genelData) { _genelDal.UpdateWithSave(genelData); }
void Kaydet() { if (YeniKayit && !Genel.Yetkilerim.Contains(17)) { Genel.Yetki_Uyari(17); return; } else if (!YeniKayit && !Genel.Yetkilerim.Contains(18)) { Genel.Yetki_Uyari(18); return; } try { #region Kontroller if (string.IsNullOrEmpty(txtKisaAd.Text)) { XtraMessageBox.Show("Şirket Kısa Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtKisaAd.Focus(); txtKisaAd.Select(); return; } if (string.IsNullOrEmpty(txtUnvan.Text)) { XtraMessageBox.Show("Şirket Kısa Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtUnvan.Focus(); txtUnvan.Select(); return; } if (YeniKayit && Isler.Sirket.Varmi_KisaAd(txtKisaAd.Text)) { XtraMessageBox.Show("Bu Şirket Kısa Adı Daha Önce Kullanılmış.\nLütfen Farklı Bir Kısa Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtKisaAd.Focus(); txtKisaAd.Select(); return; } else if (!YeniKayit && txtKisaAd.Text != Sirket.KisaAd && Isler.Sirket.Varmi_KisaAd(txtKisaAd.Text, Sirket.KisaAd)) { XtraMessageBox.Show("Bu Şirket Kısa Adı Daha Önce Kullanılmış.\nLütfen Farklı Bir Kısa Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtKisaAd.Focus(); txtKisaAd.Select(); return; } if (YeniKayit && Isler.Sirket.Varmi_Unvan(txtUnvan.Text)) { XtraMessageBox.Show("Bu Şirket Ünvanı Daha Önce Kullanılmış.\nLütfen Farklı Bir Ünvan Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtUnvan.Focus(); txtUnvan.Select(); return; } else if (!YeniKayit && txtUnvan.Text != Sirket.Unvan && Isler.Sirket.Varmi_Unvan(txtUnvan.Text, Sirket.Unvan)) { XtraMessageBox.Show("Bu Şirket Ünvanı Daha Önce Kullanılmış.\nLütfen Farklı Bir Ünvanı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); xtraTabControl1.SelectedTabPageIndex = 0; txtUnvan.Focus(); txtUnvan.Select(); return; } #endregion if (YeniKayit) { if (Sirket != null && Sirket.EntityState != EntityState.Detached) { dbModel.Detach(Sirket); } Sirket = null; Sirket = new sirket(); } #region Aktarma Sirket.Durum = chkDurum.Checked; Sirket.KisaAd = txtKisaAd.Text; Sirket.Unvan = txtUnvan.Text; Sirket.Aciklama = memoAciklama.Text; Sirket.Tel1 = txtTel1.Text; Sirket.Tel2 = txtTel2.Text; Sirket.Fax = txtFax.Text; Sirket.Web = txtWeb.Text; Sirket.Eposta = txtEposta.Text; if (lookUpAdresIl.EditValue.ToString() == "-1") { Sirket.AdresIl = null; } else { Sirket.AdresIl = Convert.ToInt32(lookUpAdresIl.EditValue); } if (lookUpAdresIlce.EditValue.ToString() == "-1") { Sirket.AdresIlce = null; } else { Sirket.AdresIlce = Convert.ToInt32(lookUpAdresIlce.EditValue); } Sirket.AdresAcik = memoAcikAdres.Text; Sirket.VergiDairesi = txtVergiDairesi.Text; #endregion #region Kayıt if (YeniKayit) { Sirket.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; Sirket.KayitZaman = DateTime.Now; dbModel.AddTosirkets(Sirket); } else { Sirket.DuzenKullaniciID = Genel.AktifKullanici.KullaniciID; Sirket.DuzenZaman = DateTime.Now; } dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Şirket Başarılı Bir Şekilde Kaydedilmiştir.", null, ResOtoSis.mark_blue); Secili_SirketID = Sirket.SirketID; Ara(); #endregion } catch (Exception hata) { XtraMessageBox.Show("Şirket Kayıdı Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void Kaydet() { if (YeniKayit && !Genel.Yetkilerim.Contains(6)) { Genel.Yetki_Uyari(8); return; } else if (!YeniKayit && !Genel.Yetkilerim.Contains(8)) { Genel.Yetki_Uyari(8); return; } try { #region Kontroller if (string.IsNullOrEmpty(txtKullaniciAdi.Text)) { XtraMessageBox.Show("Kullanici Adı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKullaniciAdi.Focus(); txtKullaniciAdi.Select(); return; } if (string.IsNullOrEmpty(txtAdi.Text.Trim())) { XtraMessageBox.Show("Ad Alanı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtAdi.Focus(); txtAdi.Select(); return; } if (string.IsNullOrEmpty(txtSoyadi.Text.Trim())) { XtraMessageBox.Show("Soyad Alanı Boş Bırakılamaz.", "Eksik Alan", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtSoyadi.Focus(); txtSoyadi.Select(); return; } if (YeniKayit && Isler.Kullanici.Varmi_KullaniciAdi(txtKullaniciAdi.Text)) { XtraMessageBox.Show("Bu Kullanıcı Adı Daha Önce Kullanılmış\nLütfen Farklı Bir Kulklanıcı Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKullaniciAdi.Focus(); txtKullaniciAdi.Select(); return; } else if (!YeniKayit && txtKullaniciAdi.Text != kull.KullaniciAd && Isler.Kullanici.Varmi_KullaniciAdi(txtKullaniciAdi.Text, kull.KullaniciAd)) { XtraMessageBox.Show("Bu Kullanıcı Adı Daha Önce Kullanılmış\nLütfen Farklı Bir Kulklanıcı Adı Yazınız.", "Aynı Değer", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKullaniciAdi.Focus(); txtKullaniciAdi.Select(); return; } #endregion if (YeniKayit) { if (kull != null && dbModel.ObjectStateManager.TryGetObjectStateEntry(kull, out stateEntry)) { dbModel.Detach(kull); } kull = null; kull = new kullanici(); kull.KullaniciSifre = "134121112107126247087199030032204013221122235069"; kull.SirketID = 1; } kull.KullaniciAd = Araclar.Sifreleme.EncryptToString(txtKullaniciAdi.Text); kull.Ad = Araclar.Sifreleme.EncryptToString(txtAdi.Text); kull.Soyad = Araclar.Sifreleme.EncryptToString(txtSoyadi.Text); kull.Durum = chkDurum.Checked; if (YeniKayit) { kull.KayitKullaniciID = Genel.AktifKullanici.KullaniciID; kull.KayitZaman = DateTime.Now; dbModel.AddTokullanicis(kull); XtraMessageBox.Show("Kullanıcı Başarılı Bir Şekilde Kaydedilmiştir.\n\nKullanıcın ilk şifresi '1' dir.", "İşlem Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { kull.DuzenKullaniciID = Genel.AktifKullanici.KullaniciID; kull.DuzenZaman = DateTime.Now; } dbModel.SaveChanges(); Genel.AlertMesaj.Show(Genel.AnaEkran, "İşlem Başarılı", "Kullanıcı Başarılı Bir Şekilde Kaydedilmiştir.", null, ResOtoSis.mark_blue); Ara(true); } catch (Exception hata) { XtraMessageBox.Show("Kullanci Kayıdı Yapılırken Bir Hata Oluştu.\n\nHata:\n" + hata.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }