コード例 #1
0
ファイル: FrmCariKayit.cs プロジェクト: WindowsProje/Proje1
 private void cmbAraGrup_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbAraGrup.SelectedItem != null)
     {
         GrupManager gm = new GrupManager();
         try
         {
             GrupListeDTO temp = (GrupListeDTO)cmbAraGrup.SelectedItem;
             cmbAltGrup.DataSource = gm.GrupListe(new GrupFiltreDTO()
             {
                 AktifMi     = true,
                 DilID       = Properties.Settings.Default.DilID,
                 KullaniciID = Properties.Settings.Default.KullaniciID,
                 SilindiMi   = false,
                 SirketID    = Properties.Settings.Default.SirketID,
                 AlanTipi    = "Cari",
                 UstGrupID   = temp.GrupID.ToString()
             });
             cmbAltGrup.DisplayMember = "GrupAd";
             cmbAltGrup.ValueMember   = "GrupID";
         }
         catch (MyNotImplementedException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyDbEntityValidationException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyArgumentNullException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyArgumentException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyInvalidOperationException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyNullReferenceException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyAggregateException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (MyFormatException error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (NullDataOnDatabaseCustomException)
         {
             throw new NullDataOnDatabaseCustomException();
         }
         catch (NotModifiedDataOnDatabaseCustomException)
         {
             throw new NotModifiedDataOnDatabaseCustomException();
         }
         catch (Exception error)
         {
             MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         finally
         {
             gm = null;
         }
     }
 }
コード例 #2
0
ファイル: FrmCariKayit.cs プロジェクト: WindowsProje/Proje1
        private void Loading()
        {
            SehirManager sm = new SehirManager();
            GrupManager  gm = new GrupManager();

            try
            {
                cmbIl.DataSource = sm.SehirListe(new SehirFiltreDTO()
                {
                    AktifMi     = true,
                    DilID       = Properties.Settings.Default.DilID,
                    KullaniciID = Properties.Settings.Default.KullaniciID,
                    SilindiMi   = false,
                    SirketID    = Properties.Settings.Default.SirketID,
                    UlkeID      = "1"
                });
                cmbIl.DisplayMember = "SehirAd";
                cmbIl.ValueMember   = "SehirID";

                cmbGrup.DataSource = gm.GrupListe(new GrupFiltreDTO()
                {
                    AktifMi     = true,
                    DilID       = Properties.Settings.Default.DilID,
                    KullaniciID = Properties.Settings.Default.KullaniciID,
                    SilindiMi   = false,
                    SirketID    = Properties.Settings.Default.SirketID,
                    UstGrupID   = "0",
                    AlanTipi    = "Cari"
                });
                cmbGrup.DisplayMember = "GrupAd";
                cmbGrup.ValueMember   = "GrupID";
            }
            catch (MyNotImplementedException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyDbEntityValidationException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyArgumentNullException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyArgumentException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyInvalidOperationException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyNullReferenceException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyAggregateException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (MyFormatException error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (NullDataOnDatabaseCustomException)
            {
                throw new NullDataOnDatabaseCustomException();
            }
            catch (NotModifiedDataOnDatabaseCustomException)
            {
                throw new NotModifiedDataOnDatabaseCustomException();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                sm = null;
                gm = null;
            }
        }