private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (this.Owner is frmBankaHareket)
         {
             frmBankaHareket frm = (frmBankaHareket)this.Owner;
             frm.txtHesapNo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToStringOrEmpty().Trim();
         }
         else if (this.Owner is frmBankaHareketRapor)
         {
             frmBankaHareketRapor frm = (frmBankaHareketRapor)this.Owner;
             frm.txtHesapNo.Text    = dataGridView1.CurrentRow.Cells[clHesapNo.Name].Value.ToStringOrEmpty().Trim();
             frm.txtHesapSahip.Text = dataGridView1.CurrentRow.Cells[clHesapSahibi.Name].Value.ToStringOrEmpty();
             frm.txtBankaAdi.Text   = dataGridView1.CurrentRow.Cells[clBankaAdi.Name].Value.ToStringOrEmpty();
             frm.txtSubeAdi.Text    = dataGridView1.CurrentRow.Cells[clSubeAdi.Name].Value.ToStringOrEmpty();
             frm.txtParaBirimi.Text = dataGridView1.CurrentRow.Cells[clParaBirimi.Name].Value.ToStringOrEmpty();
         }
         else if (this.Owner is frmFatura)
         {
             frmFatura frm = (frmFatura)this.Owner;
             frm.txtBankaHesapNo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToStringOrEmpty().Trim();
         }
         else if (this.Owner is frmDirektSatisKrediKarti)
         {
             frmDirektSatisKrediKarti frm = (frmDirektSatisKrediKarti)this.Owner;
             frm.txtBankaHesapNo.Text = dataGridView1.CurrentRow.Cells[0].Value.ToStringOrEmpty().Trim();
         }
         else if (this.Owner is frmCekDurum)
         {
             frmCekDurum frm = (frmCekDurum)this.Owner;
             frm.txtBankaHesap.Text = dataGridView1.CurrentRow.Cells[clHesapNo.Name].Value.ToStringOrEmpty().Trim();
         }
         else if (this.Owner is frmYeniCek)
         {
             frmYeniCek      frm = (frmYeniCek)this.Owner;
             DataGridViewRow dr  = dataGridView1.CurrentRow;
             frm.txtHesapNo.Text = dr.Cells[clHesapNo.Name].Value.ToStringOrEmpty();
             frm.txtBanka.Text   = dr.Cells[clBankaAdi.Name].Value.ToStringOrEmpty();
             frm.txtSube.Text    = dr.Cells[clSubeAdi.Name].Value.ToStringOrEmpty();
         }
         else if (this.Owner is frmSenetDurum)
         {
             frmSenetDurum frm = (frmSenetDurum)this.Owner;
             frm.txtBankaHesap.Text = dataGridView1.CurrentRow.Cells[clHesapNo.Name].Value.ToStringOrEmpty().Trim();
         }
         this.Close();
     }
     catch (Exception exc)
     {
         LogWrite.Write(exc);
         MessageBox.Show(exc.Message);
     }
 }
Пример #2
0
 void Kaydet()
 {
     if (string.IsNullOrEmpty(txtHesapNo.Text))
     {
         MessageBox.Show("hesap numarası giriniz");
         txtHesapNo.Focus();
         return;
     }
     try
     {
         BankaHesap hesap = null;
         if (selectedBankaHesapId != null)
         {
             hesap = mngBankaHesap.GetById(selectedBankaHesapId.Value, false);
         }
         if (hesap == null)
         {
             hesap = new BankaHesap();
             BankaHesap bh = mngBankaHesap.GetByHesapNo(UserInfo.Sube.Id, txtHesapNo.Text.Trim());
             if (bh != null)
             {
                 MessageBox.Show(txtHesapNo.Text + " nolu hesap var");
                 return;
             }
         }
         hesap.BankaAdi    = cmbBankaListe.Text.Trim();
         hesap.HesapNo     = txtHesapNo.Text.Trim();
         hesap.HesapSahibi = txtHesapSahip.Text.Trim();
         hesap.ParaBirimi  = cmbParaBirimi.Text.Trim();
         hesap.Sube        = UserInfo.Sube;
         hesap.SubeAdi     = txtSubeAdi.Text.Trim();
         mngBankaHesap.BeginTransaction();
         mngBankaHesap.SaveOrUpdate(hesap);
         mngBankaHesap.CommitTransaction();
         if (this.Owner is frmDirektSatisKrediKarti)
         {
             frmDirektSatisKrediKarti frm = (frmDirektSatisKrediKarti)this.Owner;
             frm.txtBankaHesapNo.Text = hesap.HesapNo;
             this.Close();
         }
         YeniKayit();
         LoadGrid();
     }
     catch (Exception exc)
     {
         LogWrite.Write(exc);
         MessageBox.Show(exc.Message);
     }
 }
Пример #3
0
        void KrediKartiSatis()
        {
            if (dataGridView1.Rows.Count > 0 && (!string.IsNullOrEmpty(dataGridView1.Rows[0].Cells[clFiyat.Name].Value.ToStringOrEmpty())))
            {
                bool isBegin = false;
                try {
                    frmDirektSatisKrediKarti frm = new frmDirektSatisKrediKarti();
                    frm.Owner = this;
                    frm.ShowDialog();
                    if (SatisYap)
                    {
                        FatIrsUst _currentFatUst = new FatIrsUst();
                        _currentFatUst.FatirsNo    = _fisNo;
                        _currentFatUst.FatTipi     = FatTipi.KrediKarti;
                        _currentFatUst.Ftirsip     = FTIRSIP.DirektSatis;
                        _currentFatUst.KdvDahilmi  = true;
                        _currentFatUst.Sube        = UserInfo.Sube;
                        _currentFatUst.Tarih       = DateTime.Today;
                        _currentFatUst.BrutTutar   = genelToplamlar.BrutHesapla();
                        _currentFatUst.GenelToplam = genelToplamlar.GenelToplam();
                        _currentFatUst.KdvTutar    = genelToplamlar.ToplamaKdvHesapla();
                        _currentFatUst.SatirIsk    = genelToplamlar.SatirIskantosuToplam();

                        _currentFatUst.HesapNo = HesapNo;

                        _currentFatUst.Irsaliyeli = false;
                        //mngFatUst.BeginTransaction();
                        isBegin = true;
                        BeginTransaction();
                        mngFatUst.Save(_currentFatUst);
                        // mngFatUst.CommitTransaction();
                        HesapHareket hesapHar = new HesapHareket();
                        hesapHar.Aciklama    = _fisNo + " no ile direkt satış kredi kartı ile";
                        hesapHar.BankaHesap  = mngBanka.GetByHesapNo(UserInfo.Sube.Id, HesapNo);
                        hesapHar.FisNo       = _fisNo;
                        hesapHar.HareketTuru = HesapHareketTuru.KrediKarti;
                        hesapHar.Sube        = UserInfo.Sube;
                        hesapHar.Tarih       = DateTime.Today;
                        hesapHar.Tutar       = genelToplamlar.GenelToplam();
                        mngHesapHar.Save(hesapHar);
                        if (chbFaturaBas.Checked)
                        {
                            Dizayn      diz   = (Dizayn)cmbDizayn.SelectedItem;
                            PrintFatIrs print = new PrintFatIrs(mng, _currentFatUst, diz, listeStok, genelToplamlar);
                            print.Print();
                        }
                        InitializeForm();
                    }
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                } finally {
                    try {
                        if (isBegin)
                        {
                            CommitTransaction();
                        }
                    } catch (Exception exc) {
                        MessageBox.Show(exc.Message);
                        LogWrite.Write(exc);
                    }
                }
            }
        }