Esempio n. 1
0
 void LoadGrid()
 {
     try {
         if (rbTarihAralikli.Checked)
         {
             sd = dtpStart.Value;
             fd = dtpFinish.Value;
         }
         _source = _mngCariHar.GenelBorcAlacakDokumu(UserInfo.Sube.Id, txtCariKodu.Text, sd, fd);
         dataGridView1.DataSource = _source;
         if (_source != null && _source.Rows.Count > 0)
         {
             double borc   = double.Parse(_source.Compute("sum(Borc)", "").ToString());
             double alacak = double.Parse(_source.Compute("sum(Alacak)", "").ToString());
             tslabCariToplamBorc.Text   = borc.ToString("F2");
             tslabCariToplamAlacak.Text = alacak.ToString("F2");
             tslabCariBakiyesi.Text     = (borc - alacak).ToString("F2");
             dataGridView1.Columns["Borc"].DefaultCellStyle.Format           = "F2";
             dataGridView1.Columns["Alacak"].DefaultCellStyle.Format         = "F2";
             dataGridView1.Columns["BorcBakiyesi"].DefaultCellStyle.Format   = "F2";
             dataGridView1.Columns["AlacakBakiyesi"].DefaultCellStyle.Format = "F2";
         }
     } catch (Exception exc) {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 2
0
 private void btnTest_Click(object sender, EventArgs e)
 {
     try {
         StringBuilder conStr = new StringBuilder();
         conStr.AppendFormat("Server={0};", txtServer.Text);
         conStr.AppendFormat("Initial Catalog={0};", txtDatabase.Text);
         conStr.AppendFormat("Password={0};", txtPassword.Text);
         conStr.AppendFormat("User ID={0}", txtUserID.Text);
         Settings set = new Settings {
             ConnectionString = conStr.ToString()
         };
         //set.Paket = (IndeksPaket)Enum.Parse(typeof(IndeksPaket), cmbPaket.Text);
         set.Paket    = IndeksPaket.Pro;
         set.DataBase = "MsSql";
         set.Kurulum  = "0";
         //Engine.SaveConnectinString(conStr.ToString());
         Engine.SaveSettings(set);
         ProcessDataBase prc  = new ProcessDataBase();
         bool            test = prc.TestConnection();
         if (test)
         {
             MessageBox.Show("Bağlandı");
         }
         else
         {
             MessageBox.Show("Bağlanamadı");
         }
     } catch (Exception exc) {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
        //double toplamIskonto() {
        //    if (_source != null && _source.Rows.Count > 0)
        //        return double.Parse(_source.Compute("sum(Iskanto)", "").ToString());
        //    else
        //        return 0;
        //}
        void LoadGrid()
        {
            try {
                DateTime?tarBas = null, tarBit = null, tesBas = null, tesBit = null;
                if ((dtTarBasTar.Value != dtTarBitTar.Value && dtTarBasTar.Value < dtTarBitTar.Value))
                {
                    tarBas = dtTarBasTar.Value;
                    tarBit = dtTarBitTar.Value;
                }
                if ((dtTesBasTar.Value != dtTesBitTar.Value && dtTesBasTar.Value < dtTesBitTar.Value))
                {
                    tesBas = dtTesBasTar.Value;
                    tesBit = dtTesBitTar.Value;
                }

                _source = _mngSipUst.SiparisRapor(UserInfo.Sube.Id, SecilenSiparisDurumlari(),
                                                  txtCariKodu.Text, tarBas, tarBit, tesBas, tesBit);
                _source.Replace("SiprasTip", "5", "MüşteriSiparişi");
                _source.Replace("SiprasTip", "6", "SatıcıSiparişi");

                dataGridView1.DataSource = _source;
                if (_source != null && _source.Rows.Count > 0)
                {
                    tslabToplamKdvTutar.Text  = toplamKdvTutar().ToString("F2");
                    tslabToplamBrutTutar.Text = toplamBrutTutar().ToString("F2");
                    tslabToplamTutar.Text     = toplamTutar().ToString("F2");
                    tslabToplamIskonto.Text   = toplamIskanto().ToString("F2");
                }
            } catch (Exception exc) {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }
        }
Esempio n. 4
0
 void SetKasaGenelGider()
 {
     try
     {
         _selectedKasaKodu = cmboxKasalar.Text;
         if (!string.IsNullOrEmpty(_selectedKasaKodu))
         {
             double gelir  = mngKasaHar.GetKasaGelirGiderBySubeKoduAndKasaKodu(UserInfo.Sube.Id, _selectedKasaKodu, KasaGelirGider.Gelir);
             double gider  = mngKasaHar.GetKasaGelirGiderBySubeKoduAndKasaKodu(UserInfo.Sube.Id, _selectedKasaKodu, KasaGelirGider.Gider);
             Kasa   kasa   = mngKasa.GetById(_selectedKasaKodu, false);
             double devir  = kasa.SonDevirTutar.GetValueOrDefault(0);
             double bakiye = (gelir + devir) - gider;
             txtDevir.Text       = devir.ToString("F2");
             txtToplamGelir.Text = gelir.ToString("F2");
             txtToplamGider.Text = gider.ToString("F2");
             txtDevreden.Text    = bakiye.ToString("F2");
             tslabTopGelir.Text  = gelir.ToString("F2");
             tslabTopGider.Text  = gider.ToString("F2");
             tsLabBakiye.Text    = bakiye.ToString("F2");
             this.Text           = string.Format("KasaKodu:{0};Tarih:{1}", cmboxKasalar.Text, dateIslemTarih.Value.ToString("d"));
         }
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 5
0
        void Kaydet()
        {
            Sube sube = new Sube();

            //AssignSubeValue(sube);
            try
            {
                sube = managerSube.GetById(txtSubeKodu.Text, false);
                if (sube == null)
                {
                    sube = new Sube();
                }
                AssignSubeValue(sube);
                sube.Id = txtSubeKodu.Text;
                BeginTransaction();
                managerSube.SaveOrUpdate(sube);

                LoadAllSube();
                YeniKayit();
            }
            catch (Exception)
            {
            } finally {
                try {
                    CommitTransaction();
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
            }
        }
Esempio n. 6
0
        public frmCekDurum(int cekId, CekTip cekTip, CekDurum cekDurum) : base()
        {
            InitializeComponent();
            g_mngCek   = _mngFac.GetCekManager();
            g_cekId    = cekId;
            g_cekTip   = cekTip;
            g_cekDurum = cekDurum;
            SetData();

            txtBankaHesap.DataSource = () =>
            {
                try {
                    return(_mngBanka.GetBankaHesapNoBySubeKodu(UserInfo.Sube.Id, txtBankaHesap.Text));
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtCari.DataSource = () =>
            {
                try {
                    return(_mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCari.Text).ToStringList(15, txtCari.Ayirac));
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            LoadKasa(cmbKasa);
            InitializeScreenValues();
            SetControlLocation();
        }
Esempio n. 7
0
        void OzelKalemSil()
        {
            DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (re == DialogResult.Yes)
            {
                try {
                    if (_selectedOzelKasaHar != null)
                    {
                        KasaHareket kasahar = mngKasaHar.GetById(_selectedOzelKasaHar.Value, true);
                        mngKasaHar.BeginTransaction();
                        mngKasaHar.Delete(kasahar);

                        DataGridViewRow dr = dataGridViewOzel.SelectedRows[0];
                        dataGridViewOzel.Rows.Remove(dr);;
                        OzelYeniKayit();
                        SetKasaGenelGider();
                    }
                } catch (Exception) {
                } finally {
                    try {
                        mngKasaHar.CommitTransaction();
                    } catch (Exception exc) {
                        MessageBox.Show(exc.Message);
                        LogWrite.Write(exc);
                    }
                }
            }
        }
Esempio n. 8
0
        void KalemSil()
        {
            try
            {
                DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                if (re == DialogResult.Yes)
                {
                    if (_selectedSipKalId != null)
                    {
                        SiparisKalem sh = mngSipKal.GetById(_selectedSipKalId.Value, false);
                        BeginTransaction();
                        mngSipKal.Delete(sh);

                        HesaplaToplamlari();
                        _selectedSipKalId = null;
                        LoadSiparisToGrid();
                        YeniKalem();
                    }
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            } finally {
                try {
                    CommitTransaction();
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
            }
        }
Esempio n. 9
0
        void HesaplaToplamlari()
        {
            try
            {
                if (_currentStok == null)
                {
                    _currentStok = mngStk.GetById(txtStokKodu.Text, false);
                }
                //HesaplaToplam hes = new HesaplaToplam(_ftirsip)
                //{
                //  Fiyat = txtFyt.Text.ParseNullable<double>(x => double.Parse(x)),
                //  KdvDahil = chkKdvDahilmi.Checked,
                //  Miktar = txtMiktar.Text.ParseStruct<double>(x => double.Parse(x)),
                //  Stok = _currentStok
                //};
                //hes.IskontoOranlari.Add(txtIsk1.Text.ParseNullable<double>(x => double.Parse(x)));
                //hes.IskontoOranlari.Add(txtIsk2.Text.ParseNullable<double>(x => double.Parse(x)));
                //hes.IskontoOranlari.Add(txtIsk3.Text.ParseNullable<double>(x => double.Parse(x)));
                //hes.IskontoOranlari.Add(txtIsk4.Text.ParseNullable<double>(x => double.Parse(x)));
                //hes.IskontoOranlari.Add(txtIsk5.Text.ParseNullable<double>(x => double.Parse(x)));

                //txtBrutToplam.Text = (hes.BrutHesapla()).ToString("F2");
                //txtIskToplam.Text = (hes.SatirIskantosuToplam()).ToString("F2");
                //txtAraToplam.Text = (hes.AraToplam()).ToString("F2");
                //txtKdvToplam.Text = (hes.KdvHesapla()).ToString("F2");
                //txtGenelToplam.Text = (hes.GenelToplam()).ToString("F2");
            }
            catch (Exception exc)
            {
                LogWrite.Write(exc);
                MessageBox.Show(exc.Message);
            }
        }
 void MiktarArtir()
 {
     try
     {
         if (string.IsNullOrEmpty(txtMiktar.Text))
         {
             txtMiktar.Text = "1";
             //txtBarkod.Focus();
             HesaplaTutarFiyat();
         }
         else
         {
             double d = txtMiktar.Text.ParseStruct <double>(x => double.Parse(x));
             d += 1;
             txtMiktar.Text = d.ToString();
             HesaplaTutarFiyat();
             //txtBarkod.Focus();
         }
     }
     catch (Exception exc)
     {
         LogWrite.Write(exc);
         MessageBox.Show(exc.Message);
     }
 }
 private void txtSatisFiyat_KeyDown(object sender, KeyEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSatisFiyat.Text) && (e.KeyCode == Keys.Tab || e.KeyCode == Keys.Enter))
     {
         try {
             if (_currentStok == null)
             {
                 _currentStok = mngStk.GetBySubeAndBarkod1(UserInfo.Sube.Id, txtBarkod.Text);
             }
             if (_currentStok == null)
             {
                 _currentStok = mngStk.GetById(txtBarkod.Text, false);
             }
             if (_currentStok != null)
             {
                 //txtStokKodu.Text = _currentStok.Id;
                 //txtSatisFiyat.Text = _currentStok.SatisFiyat1.GetValueOrDefault().ToString();
                 KalemKaydet();
                 //YeniKalem();
             }
         } catch (Exception exc) {
             MessageBox.Show(exc.Message);
             LogWrite.Write(exc);
         }
     }
 }
 private void txtBarkod_KeyDown(object sender, KeyEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtBarkod.Text) && (e.KeyCode == Keys.Tab || e.KeyCode == Keys.Enter))
     {
         try
         {
             //if (_currentStok == null)
             _currentStok = mngStk.GetBySubeAndBarkod1(UserInfo.Sube.Id, txtBarkod.Text);
             if (_currentStok == null)
             {
                 _currentStok = mngStk.GetById(txtBarkod.Text, false);
             }
             if (_currentStok != null)
             {
                 //txtStokKodu.Text = _currentStok.Id;
                 if (string.IsNullOrEmpty(txtSatisFiyat.Text.Trim()) || txtSatisFiyat.Text.Trim() == "0")
                 {
                     txtSatisFiyat.Text = _currentStok.SatisFiyat1.GetValueOrDefault().ToString();
                 }
                 txtSatisFiyat.Focus();
                 labSecilenUrun.Text = string.Format("{0} {1}", _currentStok.Id, _currentStok.StokAdi);
                 // KalemKaydet();
                 //YeniKalem();
             }
         }
         catch (Exception exc)
         {
             MessageBox.Show(exc.Message);
             LogWrite.Write(exc);
         }
     }
 }
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView1.CurrentRow != null)
                {
                    //txtStokKodu.Text = _selectedStokKodu = dataGridView1.CurrentRow.Cells["clStokKodu"].Value.ToStringOrEmpty();
                    _currentStok       = null;
                    txtMiktar.Text     = dataGridView1.CurrentRow.Cells["clMiktar"].Value.ToStringOrEmpty();
                    txtSatisFiyat.Text = dataGridView1.CurrentRow.Cells["clFiyat"].Value.ToStringOrEmpty();

                    txtBarkod.Text     = dataGridView1.CurrentRow.Cells["clBarkod"].Value.ToStringOrEmpty();
                    _selectedStokHarId = dataGridView1.CurrentRow.Cells["clId"].Value.ToString().ParseNullable <int>(x => int.Parse(x));
                    txtTutar.Text      = double.Parse(dataGridView1.CurrentRow.Cells["clTutar"].Value.ToStringOrEmpty()).ToString("F2");
                    //txtMiktar.Focus() ;

                    //txtStokMiktar.Text = mngSth.GetStokMiktar(txtStokKodu.Text).ToString();
                    if (string.IsNullOrEmpty(txtBarkod.Text))
                    {
                        txtBarkod.Text = dataGridView1.CurrentRow.Cells[clStokKodu.Name].Value.ToStringOrEmpty();
                    }
                    txtBarkod.Focus();
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmRaporDialog frm = new frmRaporDialog(true, true, true, false);

            frm.ShowDialog();
            try {
                ReportTo?dest = frm.GetReportDestination();
                if (dest.HasValue)
                {
                    if (dest.Value != ReportTo.CrytalReport)
                    {
                        // Create the report and turn our query into a ReportSource
                        var report = new Report(_data.ToReportSource());
                        // Customize the Text Fields
                        report.TextFields.Title  = "Gün gün Kasa Raporu";
                        report.TextFields.Header = string.Format(@"
    Kasa  :{0}
    Rapor Tarihi: {1}
    Tarih Aralığı:{2}
",
                                                                 cmboxKasalar.Text, DateTime.Now, GetTarihAraligi());


                        // Render hints allow you to pass additional hints to the reports as they are being rendered
                        report.DataFields["Gelir"].ShowTotals  = true;
                        report.DataFields["Gider"].ShowTotals  = true;
                        report.DataFields["Bakiye"].ShowTotals = true;
                        // Customize the data fields
                        report.RenderHints["HtmlStyle"]              = "th { font-size: 14px !important;font-weight:bold !important}";
                        report.DataFields["Gelir"].DataFormatString  = "{0:F2}";
                        report.DataFields["Gider"].DataFormatString  = "{0:F2}";
                        report.DataFields["Bakiye"].DataFormatString = "{0:F2}";
                        report.DataFields["Tarih"].DataFormatString  = "{0:d}";
                        string        fileName = "gunGunKasaRaporu.xls";
                        IReportWriter writer   = new ExcelReportWriter();
                        if (dest.Value == ReportTo.Html)
                        {
                            writer   = new HtmlReportWriter();
                            fileName = "gunGunKasaRaporu.html";
                        }
                        else if (dest.Value == ReportTo.Csv)
                        {
                            writer   = new DelimitedTextReportWriter();
                            fileName = "gunGunKasaRaporu.txt";
                        }
                        string     file = Path.Combine(Engine.DokumanPath(), fileName);
                        FileStream fs   = new FileStream(file, FileMode.Create);

                        writer.WriteReport(report, fs);
                        fs.Close();
                        Process prc = new Process();
                        prc.StartInfo.FileName = file;
                        prc.Start();
                    }
                }
            } catch (Exception exc) {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }
        }
Esempio n. 15
0
        void ConstructDataBase()
        {
            try
            {
                string       pathScript = Path.Combine(Application.StartupPath, @"script/scripts.txt");
                StreamReader sr         = new StreamReader(pathScript);
                string       sqlScripts = sr.ReadToEnd();
                sr.Close();

                string database = _database;
                sqlScripts = sqlScripts.Replace("#DataBaseName#", database);
                string pathMdf = dataBasePath;
                string pathLdf = pathMdf;
                pathMdf    = Path.Combine(dataBasePath, database + ".mdf");
                pathLdf    = Path.Combine(dataBasePath, database + "_log.ldf");
                sqlScripts = sqlScripts.Replace("#PathMdf#", pathMdf);
                sqlScripts = sqlScripts.Replace("#PathLdf#", pathLdf);
                sqlScripts = sqlScripts.Replace("HAN_log", database + "_log");
                ProcessDataBase pData = new ProcessDataBase();
                pData.ExecuteNonQueries(sqlScripts, textBox1);
                btnKapat.Enabled = true;
                Settings set = Engine.FindSettings();
                set.Kurulum = "1";
                Engine.SaveSettings(set);
            }
            catch (Exception exc)
            {
                LogWrite.Write(exc);
                MessageBox.Show(exc.Message);
            }
        }
Esempio n. 16
0
 private void txtStokKodu_KeyUp(object sender, KeyEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtStokKodu.Text) && e.KeyCode == Keys.Tab)
     {
         try
         {
             //if(_currentStok==null)
             _currentStok = mngStk.GetById(txtStokKodu.Text, false);
             if (_currentStok != null)
             {
                 txtStokIsmi.Text = _currentStok.StokAdi;
                 txtBarkod.Text   = _currentStok.Barkod1;
                 txtKdv.Text      = _currentStok.KdvOrani.FromNullableToString();
                 if (_selectedSipKalId == null || _selectedStokKodu != txtStokKodu.Text)
                 {
                     SetFiyat();
                 }
                 cmbBirim.Focus();
             }
             else
             {
                 frmStok frm = new frmStok(this, _ftirsip);
                 txtStokKodu.CloseAutoComplete();
                 frm.txtStokIsmi.Focus();
                 frm.WindowState = FormWindowState.Maximized;
                 frm.ShowDialog();
             }
         }
         catch (Exception exc)
         {
             MessageBox.Show(exc.Message);
             LogWrite.Write(exc);
         }
     }
 }
Esempio n. 17
0
 void LoadCategory()
 {
     try {
         if (StokCariCategory.Stok == _stokCari)
         {
             List <StokCategory> liste = _mngStkCat.GetListRootCategories();
             foreach (var item in liste)
             {
                 TreeNode tn = new TreeNode();
                 tn.Text = string.Format("{0}-{1}", item.Id, item.CategoryName);
                 RecursiveAddNode(item.ChildCategories, tn);
                 treeView1.Nodes.Add(tn);
             }
         }
         else
         {
             List <CariCategory> liste = _mngCariCat.GetListRootCategories();
             foreach (var item in liste)
             {
                 TreeNode tn = new TreeNode();
                 tn.Text = string.Format("{0}-{1}", item.Id, item.CategoryName);
                 RecursiveAddNode(item.ChildCategories, tn);
                 treeView1.Nodes.Add(tn);
             }
         }
     } catch (Exception exc) {
         LogWrite.Write(exc);
         MessageBox.Show(exc.Message);
     }
 }
Esempio n. 18
0
        void SiparisSil()
        {
            bool isBegin = false;

            try {
                if (_currentSipUst != null)
                {
                    DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    if (re == DialogResult.Yes)
                    {
                        isBegin = true;
                        mngSipKal.TopluKalemSil(_currentSipUst.FatirsNo, _ftirsip);
                        BeginTransaction();
                        mngSipUst.Delete(_currentSipUst);

                        //mngSipUst.CommitTransaction();
                    }
                }
            } catch (Exception) {
            } finally {
                try {
                    if (isBegin)
                    {
                        mngSipUst.Delete(_currentSipUst);
                        CommitTransaction();
                        InitializeForm();
                        GetLastArtiSipNo();
                    }
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
            }
        }
Esempio n. 19
0
 public frmKasaKayitlari()
 {
     InitializeComponent();
     mng        = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
     mngKasa    = mng.GetKasaManager();
     mngKasaHar = mng.GetKasaHarManager();
     mngCari    = mng.GetCariManager();
     mngCariHar = mng.GetCariHareketManager();
     LoadKasa();
     TapGelirGider();
     txtCariKod.DataSource = () =>
     {
         try {
             return(mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCariKod.Text).ToStringList(15, txtCariKod.Ayirac));
         } catch (Exception exc) {
             MessageBox.Show(exc.Message);
             LogWrite.Write(exc);
         }
         return(null);
     };
     txtCariKod.DataSource = () =>
     {
         try
         {
             return(mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCariKod.Text).ToStringList(15, txtCariKod.Ayirac));
         }
         catch (Exception exc)
         {
             MessageBox.Show(exc.Message);
             LogWrite.Write(exc);
         }
         return(null);
     };
 }
Esempio n. 20
0
 void grd_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try {
         if (filterDataGridView1.grd.CurrentRow != null)
         {
             DataGridViewRow currentRow = filterDataGridView1.grd.CurrentRow;
             txtStokKodu.Text = _selectedStokKodu = currentRow.Cells["clStokKodu"].Value.ToStringOrEmpty();
             _currentStok     = mngStk.GetById(_selectedStokKodu, false);
             DoldurStokBirimleri(_currentStok, cmbBirim);
             txtStokIsmi.Text  = currentRow.Cells["clStokAdi"].Value.ToStringOrEmpty();
             txtMiktar.Text    = currentRow.Cells["clMiktar"].Value.ToStringOrEmpty();
             cmbBirim.Text     = currentRow.Cells[clHareketBirim.Name].Value.ToStringOrEmpty();
             txtFyt.Text       = currentRow.Cells["clFiyat"].Value.ToStringOrEmpty();
             txtIsk1.Text      = currentRow.Cells["clIsk1"].Value.ToStringOrEmpty();
             txtIsk2.Text      = currentRow.Cells["clIsk2"].Value.ToStringOrEmpty();
             txtIsk3.Text      = currentRow.Cells["clIsk3"].Value.ToStringOrEmpty();
             txtIsk4.Text      = currentRow.Cells["clIsk4"].Value.ToStringOrEmpty();
             txtIsk5.Text      = currentRow.Cells["clIsk5"].Value.ToStringOrEmpty();
             txtBarkod.Text    = currentRow.Cells["clBarkod"].Value.ToStringOrEmpty();
             _selectedSipKalId = currentRow.Cells["clId"].Value.ToString().ParseNullable <int>(x => int.Parse(x));
             txtTutar.Text     = currentRow.Cells["clTutar"].Value.ToStringOrEmpty();
             txtBarkod.Focus();
             txtStokMiktar.Text = mngSth.GetStokMiktar(txtStokKodu.Text).ToString();
             txtKdv.Text        = currentRow.Cells[clKdvOrani.Name].Value.ToStringOrEmpty();
         }
     } catch (Exception exc) {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 21
0
 private void dataGridViewCari_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try {
         DataGridViewRow dr = dataGridViewCari.CurrentRow;
         if (dr != null)
         {
             txtCariKod.Text           = dr.Cells["clCariKod"].Value.ToStringOrEmpty();
             txtCariIsim.Text          = dr.Cells["clCariIsim"].Value.ToStringOrEmpty();
             txtHesapBakiyesi.Text     = dr.Cells["clHesapBakiyesi"].Value.ToStringOrEmpty();
             txtCariTel.Text           = dr.Cells["clTel"].Value.ToStringOrEmpty();
             txtCariAdres.Text         = dr.Cells["clAdres"].Value.ToStringOrEmpty();
             txtCariVergiNumarasi.Text = dr.Cells["clVergiNumarasi"].Value.ToStringOrEmpty();
             txtCariVergiDairesi.Text  = dr.Cells["clVergiDairesi"].Value.ToStringOrEmpty();
             txtCariGrup1.Text         = dr.Cells["clGrup1"].Value.ToStringOrEmpty();
             txtCariGrup2.Text         = dr.Cells["clGrup2"].Value.ToStringOrEmpty();
             txtCariFisNo.Text         = dr.Cells["clFisNo"].Value.ToStringOrEmpty();
             txtCariTutar.Text         = dr.Cells["clTutar"].Value.ToStringOrEmpty();
             txtCariKasaAciklama.Text  = dr.Cells["clKasaAciklama"].Value.ToStringOrEmpty();
             _selectedCahar            = dr.Cells["clCariHarId"].Value.ToString().ParseNullable <int>(x => int.Parse(x));
             _selectedKasaHar          = dr.Cells["clKasaHarId"].Value.ToString().ParseNullable <int>(x => int.Parse(x));
             txtCariKod.Focus();
         }
     } catch (Exception exc) {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 22
0
 public frmIrsFatura(string IrsNo, FTIRSIP ftirsip)
 {
     _irsNo     = IrsNo;
     _ftirsip   = ftirsip;
     mng        = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
     mngFatUst  = mng.GetFatirsUstManager();
     mngCari    = mng.GetCariManager();
     mngSth     = mng.GetStokHareketManager();
     mngKasa    = mng.GetKasaManager();
     mngKasaHar = mng.GetKasaHarManager();
     mngCariHrk = mng.GetCariHareketManager();
     InitializeComponent();
     try
     {
         _fatIrsUst = mngFatUst.GetByBelgeNoBelgeTipAndSubeKodu(_irsNo, _ftirsip, UserInfo.Sube.Id);
         if (_fatIrsUst.FatTipi == FatTipi.KapaliFat || _fatIrsUst.FatTipi == FatTipi.MuhtelifFat)
         {
             LoadKasa();
             cmboxKasalar.Enabled = true;
         }
         txtFatNo.Text = mngFatUst.GetLastArtiOneFatIrsNoBySubeKoduAndFtirsip(UserInfo.Sube.Id, DetermineFtirsip(ftirsip));
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 23
0
        void KayitSil()
        {
            DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (re == DialogResult.Yes)
            {
                try {
                    Sube sube = managerSube.GetById(txtSubeKodu.Text, true);
                    if (!UserInfo.Kullanici.Adminmi.Value)
                    {
                        MessageBox.Show("Sadece admin kullanıcı şube silebilir");
                        return;
                    }
                    if (sube != null && UserInfo.Sube.Id == sube.Id)
                    {
                        MessageBox.Show("Bulunduğunuz şubeyi silemezsiniz");
                        return;
                    }
                    managerSube.BeginTransaction();
                    managerSube.Delete(sube);
                    LoadAllSube();
                    btnYeni_Click(this, EventArgs.Empty);
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                } finally {
                    try {
                        managerSube.CommitChanges();
                    } catch (Exception exc) {
                        LogWrite.Write(exc);
                        MessageBox.Show(exc.Message);
                    }
                }
            }
        }
Esempio n. 24
0
        void LoadGrid()
        {
            try {
                KasaHareketDurumlari helper = GetKasaHareketDurumlari(checkedListBoxHareketTipleri);

                int yil = int.Parse(maskedTextBoxYil.Text);
                _source = _mngKasaHar.AyAyGelirGiderRaporu(helper, cmboxKasalar.Text, UserInfo.Sube.Id, yil);
                _source.Replace("Ay", "1", "Ocak"); _source.Replace("Ay", "2", "Şubat");
                _source.Replace("Ay", "3", "Mart"); _source.Replace("Ay", "4", "Nisan");
                _source.Replace("Ay", "5", "Mayıs"); _source.Replace("Ay", "6", "Haziran");
                _source.Replace("Ay", "7", "Temmuz"); _source.Replace("Ay", "8", "Ağustos");
                _source.Replace("Ay", "9", "Eylül");
                _source.Replace("Ay", "01", "Ocak"); _source.Replace("Ay", "02", "Şubat");
                _source.Replace("Ay", "03", "Mart"); _source.Replace("Ay", "04", "Nisan");
                _source.Replace("Ay", "05", "Mayıs"); _source.Replace("Ay", "06", "Haziran");
                _source.Replace("Ay", "07", "Temmuz"); _source.Replace("Ay", "08", "Ağustos");
                _source.Replace("Ay", "09", "Eylül");
                _source.Replace("Ay", "10", "Ekim");
                _source.Replace("Ay", "11", "Kasım"); _source.Replace("Ay", "12", "Aralık");
                dataGridView1.DataSource = _source;
                if (_source != null && _source.Rows.Count > 0)
                {
                    tslabToplamGelir.Text  = ToplamGelir().ToString("F2");
                    tslabToplamGider.Text  = ToplamGider().ToString("F2");
                    tslabToplamBakiye.Text = ToplamBakiye().ToString("F2");
                    dataGridView1.Columns["Bakiye"].DefaultCellStyle.Format = "F2";
                }
            } catch (Exception exc) {
                LogWrite.Write(exc);
                MessageBox.Show(exc.Message);
            }
        }
Esempio n. 25
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     try
     {
         //Server=FATIH;Initial Catalog=HAN2009;Password=sapass;User ID=sa
         StringBuilder conStr = new StringBuilder();
         conStr.AppendFormat("Server={0};", txtServer.Text);
         conStr.AppendFormat("Initial Catalog={0};", txtDatabase.Text);
         conStr.AppendFormat("Password={0};", txtPassword.Text);
         conStr.AppendFormat("User ID={0}", txtUserID.Text);
         Settings set = new Settings {
             ConnectionString = conStr.ToString()
         };
         //Engine.SaveConnectinString(conStr.ToString());
         //set.Paket = (IndeksPaket)Enum.Parse(typeof(IndeksPaket), cmbPaket.Text);
         set.Paket    = IndeksPaket.Pro;
         set.Kurulum  = "0";
         set.DataBase = "MsSql";
         Engine.SaveSettings(set);
         frmKurStp2 frm = new frmKurStp2(_frmLogin, this, txtDatabase.Text);
         this.Hide();
         frm.ShowDialog();
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 26
0
        void Sil()
        {
            DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (re == DialogResult.Yes)
            {
                try {
                    if (_selectedDizayn != null)
                    {
                        Dizayn d = mngDizayn.GetById(_selectedDizayn.Value, false);
                        mngDizayn.BeginTransaction();
                        mngDizayn.Delete(d);

                        YeniKalem();
                    }
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                } finally {
                    try {
                        mngDizayn.CommitTransaction();
                    } catch (Exception exc) {
                        MessageBox.Show(exc.Message);
                        LogWrite.Write(exc);
                    }
                }
            }
        }
Esempio n. 27
0
        private void btnRaporla_Click(object sender, EventArgs e)
        {
            try
            {
                HesapHareketTuru?turu = null;
                turu        = HareketTipiniBelirle(turu);
                hareketList = mngHesap.GetHesapNoWithDate(UserInfo.Sube.Id, txtHesapNo.Text, dateTimeStart.Value.JustDate(), dateTimeFinish.Value.JustDate(), turu);
                dataGridView1.Columns[clTutar.Name].DefaultCellStyle.Format = "F2";
                dataGridView1.AutoGenerateColumns = false;

                hareketList.Replace("HareketTuru", "1", "ParaYatirma(+)");
                hareketList.Replace("HareketTuru", "2", "ParaCekme(-)");
                hareketList.Replace("HareketTuru", "3", "GelenHavale(+)");
                hareketList.Replace("HareketTuru", "4", "GidenHavale(-)");
                hareketList.Replace("HareketTuru", "5", "KrediKarti");
                hareketList.Replace("HareketTuru", "6", "ÇekÖdeme");
                hareketList.Replace("HareketTuru", "7", "ÇekTahsil");
                hareketList.Replace("HareketTuru", "8", "SenetTahsil");
                if (hareketList.Count > 0)
                {
                    btnPrint.Visible      = true;
                    tslabToplamTutar.Text = hareketList.Sum(x => x.Tutar).ToString("F2");
                }
                else
                {
                    btnPrint.Visible = false;
                }
                dataGridView1.DataSource = hareketList;
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
                LogWrite.Write(exc);
            }
        }
Esempio n. 28
0
        void Kaydet()
        {
            try
            {
                Dizayn dizayn = null;
                if (_selectedDizayn != null)
                {
                    dizayn = mngDizayn.GetById(_selectedDizayn.Value, false);
                }
                else
                {
                    dizayn = new Dizayn();
                }
                dizayn.DizaynAdi  = txtDizaynAdi.Text;
                dizayn.DizaynTipi = cmboxDizaynTipi.SelectedIndex == 0 ? DizaynTipi.SatisFatura : DizaynTipi.SatisIrsaliye;
                dizayn.Sube       = UserInfo.Sube;
                mngDizayn.BeginTransaction();
                mngDizayn.SaveOrUpdate(dizayn);

                LoadGrid();
                YeniKalem();
            }
            catch (Exception)
            { } finally {
                try {
                    mngDizayn.CommitTransaction();
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
            }
        }
Esempio n. 29
0
 void LoadGrid()
 {
     try {
         if (rbTarihAralikli.Checked)
         {
             sd = dtpStart.Value;
             fd = dtpFinish.Value;
         }
         //_source = mngStokHar.StokMaliyetRaporu(UserInfo.Sube.Id,_alisGirisKod, txtStokKodu.Text,sd,
         //fd);
         _source = mngStokHar.StokMalMaliyetRaporu(UserInfo.Sube.Id, txtStokKodu.Text, txtStokGrup.Text, sd, fd);
         dataGridView1.DataSource = _source;
         if (_source != null && _source.Rows.Count > 0)
         {
             tslabEldekiMalMiktar.Text       = eldekiMalMiktar().ToString("F2");
             tslabToplamAlisMiktar.Text      = toplamAlisMiktar().ToString("F2");
             tslabToplamAlisTutar.Text       = toplamAlisTutar().ToString("F2");
             tslabToplamSatisMiktar.Text     = toplamSatisMiktar().ToString("F2");
             tslabToplamSatisTutar.Text      = toplamSatisTutar().ToString("F2");
             tslabTopKalanMalinMaliyeti.Text = toplamKalanMalinMaliyeti().ToString("F2");
         }
     } catch (Exception exc) {
         MessageBox.Show(exc.Message);
         LogWrite.Write(exc);
     }
 }
Esempio n. 30
0
        void KayitSil()
        {
            DialogResult re = MessageBox.Show("Kayıt Silinsin mi?", "Dikkat", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (re == DialogResult.Yes)
            {
                try {
                    ListViewItem item     = listView1.SelectedItems[0];
                    string       cariKodu = item.SubItems[0].Text;
                    if (string.IsNullOrEmpty(cariKodu))
                    {
                        MessageBox.Show("cari seçiniz");
                        return;
                    }
                    Cari cari = mngCari.GetById(cariKodu, true);
                    mngCari.BeginTransaction();
                    mngCari.Delete(cari);
                } catch (Exception) {
                } finally {
                    try {
                        mngCari.CommitTransaction();
                        LoadCari();
                    } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); }
                }
            }
        }