Beispiel #1
0
        private void btn_ftr_dzn_Click(object sender, EventArgs e)
        {
            if (txt_ftr_tutar.Text.Contains('.') & txt_ftr_tutar.Text.Contains(','))
            {
                DialogResult uyarı = new DialogResult();
                uyarı = MessageBox.Show("Aynı anda hem virgül hem nokta giremezsiniz!", "FATURA SİLME", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

                if (uyarı == DialogResult.OK)
                {
                }
                else
                {
                }
            }
            else
            {
                txt_ftr_tutar.Text = hf.Comma2Dot(txt_ftr_tutar.Text);
                txt_avans.Text     = hf.Comma2Dot(txt_avans.Text);

                DateTime dt = Convert.ToDateTime(txt_ftr_tarih.Text);

                string    dateToday = dt.ToString("d");
                DayOfWeek day       = Convert.ToDateTime(txt_ftr_tarih.Text).DayOfWeek;
                string    dayToday  = day.ToString();

                if ((day == DayOfWeek.Saturday) || (day == DayOfWeek.Sunday))
                {
                    MessageBox.Show("Lütfen hafta içi olacak bir tarih giriniz! ");
                }
                else
                {
                    fatura_euro = Convert.ToDecimal(hf.EuroCalculation(txt_ftr_tarih.Text, txt_ftr_tutar.Text, cmb_birim.Text, Convert.ToString(fatura_euro)));

                    if (fatura_euro == Convert.ToDecimal(0000))
                    {
                        MessageBox.Show("Lütfen İnternete Bağlanınız");
                    }
                    else
                    {
                        vade      = Convert.ToString(txt_ftr_vade.Text);
                        baslangic = Convert.ToDateTime(txt_ftr_tarih.Text);
                        bitis     = baslangic.AddDays(int.Parse(vade));

                        if (cb_durum.Checked)
                        {
                            db = new DBConnect();
                            db.UpdateFaturalar(Convert.ToInt32(lbl_id.Text), Convert.ToString(txt_fatura_no.Text), Convert.ToString(cmb_projeNo.Text), Convert.ToString(cmb_firma.Text), Convert.ToInt32(txt_ftr_vade.Text), bitis, Convert.ToString(rcb_acıklama.Text), Convert.ToDateTime(txt_ftr_tarih.Text), ck_alarm.Checked, Convert.ToDecimal(txt_ftr_tutar.Text), Convert.ToString(cmb_birim.Text), Convert.ToInt32(txt_avans.Text), fatura_euro, Convert.ToString(lbl_tip.Text), Convert.ToString(cmb_ftr_tip.Text), Convert.ToString("ÖDENDİ"));
                            this.Close();
                        }
                        else
                        {
                            db = new DBConnect();
                            db.UpdateFaturalar(Convert.ToInt32(lbl_id.Text), Convert.ToString(txt_fatura_no.Text), Convert.ToString(cmb_projeNo.Text), Convert.ToString(cmb_firma.Text), Convert.ToInt32(txt_ftr_vade.Text), bitis, Convert.ToString(rcb_acıklama.Text), Convert.ToDateTime(txt_ftr_tarih.Text), ck_alarm.Checked, Convert.ToDecimal(txt_ftr_tutar.Text), Convert.ToString(cmb_birim.Text), Convert.ToInt32(txt_avans.Text), fatura_euro, Convert.ToString(lbl_tip.Text), Convert.ToString(cmb_ftr_tip.Text), Convert.ToString("ÖDENMEDİ"));
                            this.Close();
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void btn_stf_kayit_Click(object sender, EventArgs e)
        {
            if (txt_mlz_brmFiyat.Text.Contains('.') & txt_mlz_brmFiyat.Text.Contains(','))
            {
                DialogResult uyarı = new DialogResult();
                uyarı = MessageBox.Show("Aynı anda hem virgül hem nokta giremezsiniz!", "FATURA SİLME", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);

                if (uyarı == DialogResult.OK)
                {
                }
                else
                {
                }
            }

            else
            {
                txt_mlz_brmFiyat.Text = hf.Comma2Dot(txt_mlz_brmFiyat.Text);

                DateTime  dt        = Convert.ToDateTime(date_teslim.Text);
                string    dateToday = dt.ToString("d");
                DayOfWeek day       = Convert.ToDateTime(date_teslim.Text).DayOfWeek;


                if ((day == DayOfWeek.Saturday) || (day == DayOfWeek.Sunday))
                {
                    MessageBox.Show("Lütfen hafta içi olacak bir tarih giriniz! ");
                }
                else
                {
                    siparis_euro = hf.EuroCalculation(date_teslim.Text, txt_mlz_brmFiyat.Text, cmb_paraBirimi.Text, siparis_euro);

                    db = new DBConnect();
                    db.InsertSE(Convert.ToString(cmb_prjno.Text), Convert.ToString(txt_siparisNo.Text), Convert.ToString(txt_tedarikci.Text), Convert.ToString(txt_talepKisi.Text), Convert.ToDateTime(date_teslim.Text), Convert.ToInt32(txt_vade.Text), Convert.ToDateTime(date_temin.Text), Convert.ToDecimal(txt_mlz_brmFiyat.Text), Convert.ToString(cmb_paraBirimi.Text), Convert.ToDecimal(siparis_euro), Convert.ToString(rcb_aciklama.Text));

                    this.Close();
                }
            }
        }
Beispiel #3
0
        private void cmb_projeler_SelectedIndexChanged(object sender, EventArgs e)
        {
            index = 0;
            Array.Clear(monthG, 0, 12);
            Array.Clear(month_sumG, 0, 12);
            Array.Clear(monthK, 0, 12);
            Array.Clear(month_sumK, 0, 12);

            myConnection.Open();
            try
            {
                komut     = "SELECT sum(fatura_euro) FROM db_faturalar WHERE fatura_proje_no ='" + cmb_projeler.Text + "' AND fatura_tipi='G'";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    TOPLAM = Convert.ToDecimal(myReader.GetString(0));
                    lbl_top_maliyet.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                }
                myReader.Close();
            }
            catch
            {
                lbl_top_maliyet.Text = "0";
                myReader.Close();
            }

            try
            {
                komut     = "SELECT sum(fatura_euro) FROM db_faturalar WHERE fatura_durum='ÖDENDİ' AND fatura_proje_no ='" + cmb_projeler.Text + "' AND fatura_tipi='G'";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    TOPLAM            = Convert.ToDecimal(myReader.GetString(0));
                    lbl_odenmisG.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                }
                myReader.Close();
            }
            catch
            {
                lbl_odenmisG.Text = "0";
                myReader.Close();
            }

            try
            {
                komut     = "SELECT proje_butce,proje_birim,proje_baslangic FROM db_projeler WHERE proje_no='" + cmb_projeler.Text + "'";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    lbl_prjEuro.Text = hf.EuroCalculation(Convert.ToString(myReader.GetString(2)), Convert.ToString(myReader.GetString(0)), Convert.ToString(myReader.GetString(1)), lbl_prjEuro.Text);
                    lbl_prjEuro.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(lbl_prjEuro.Text));
                }
                myReader.Close();
            }
            catch
            {
                lbl_prjEuro.Text = "0";
                myReader.Close();
            }

            try
            {
                komut     = "SELECT sum(fatura_euro) FROM db_faturalar WHERE fatura_durum='ÖDENDİ' AND fatura_proje_no ='" + cmb_projeler.Text + "' AND fatura_tipi='K'";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    TOPLAM            = Convert.ToDecimal(myReader.GetString(0));
                    lbl_odenmisK.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                }
                myReader.Close();
            }
            catch
            {
                lbl_odenmisK.Text = "0";
                myReader.Close();
            }

            try
            {
                komut     = "SELECT proje_butce,proje_birim FROM db_projeler WHERE proje_no='" + cmb_projeler.Text + "'";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    TOPLAM = Convert.ToDecimal(myReader.GetString(0));
                    BIRIM  = Convert.ToString(myReader.GetString(1));

                    if (BIRIM == "USD")
                    {
                        lbl_prj_butce.Text = string.Format(new CultureInfo("en-SG"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                    }
                    else if (BIRIM == "EUR")
                    {
                        lbl_prj_butce.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                    }
                    else if (BIRIM == "TRY")
                    {
                        lbl_prj_butce.Text = string.Format("{0:C2}", Convert.ToDecimal(TOPLAM));
                    }
                    else if (BIRIM == "GBP")
                    {
                        lbl_prj_butce.Text = string.Format(new CultureInfo("en-GB"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                    }
                    else
                    {
                        lbl_prj_butce.Text = string.Format(new CultureInfo("en-CH"), "{0:C2}", Convert.ToDecimal(TOPLAM));
                    }
                }
                //lbl_prjEuro.Text = hf.EuroDonusum(BIRIM, Convert.ToString(TOPLAM));
                //lbl_prjEuro.Text = string.Format(new CultureInfo("de-DE"), "{0:C2}", Convert.ToDecimal(lbl_prjEuro.Text));

                myReader.Close();
            }
            catch
            {
                lbl_prj_butce.Text = "0";
                //lbl_prjEuro.Text = "0";
                myReader.Close();
            }

            try
            {
                komut     = "SELECT DATE_FORMAT(fatura_vade_tarih,'%m-%Y') AS Month, SUM(fatura_euro) FROM db_faturalar WHERE fatura_durum='ÖDENMEDİ' and fatura_tipi='G' and fatura_proje_no ='" + cmb_projeler.Text + "' GROUP BY DATE_FORMAT(fatura_vade_tarih, '%m-%Y')";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (Convert.ToDateTime(myReader.GetString(0)).Year == DateTime.Now.Year)
                    {
                        monthG[index]     = Convert.ToDateTime(myReader.GetString(0));
                        month_sumG[index] = (float)Convert.ToDouble(myReader.GetString(1));
                        index++;
                    }
                }
                myReader.Close();
            }
            catch
            {
                //MessageBox.Show(Convert.ToString(DateTime.Now.AddMonths(1)));
                myReader.Close();
            }

            try
            {
                index     = 0;
                komut     = "SELECT DATE_FORMAT(fatura_vade_tarih,'%m-%Y') AS Month, SUM(fatura_euro) FROM db_faturalar WHERE fatura_durum='ÖDENMEDİ' and fatura_tipi='K' and fatura_proje_no ='" + cmb_projeler.Text + "' GROUP BY DATE_FORMAT(fatura_vade_tarih, '%m-%Y')";
                da        = new MySqlDataAdapter(komut, connection);
                myCommand = new MySqlCommand(komut, myConnection);
                myReader  = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    if (Convert.ToDateTime(myReader.GetString(0)).Year == DateTime.Now.Year)
                    {
                        monthK[index]     = Convert.ToDateTime(myReader.GetString(0));
                        month_sumK[index] = (float)Convert.ToDouble(myReader.GetString(1));
                        index++;
                    }
                }
                myReader.Close();
            }
            catch
            {
                //MessageBox.Show(Convert.ToString(DateTime.Now.AddMonths(1)));
                myReader.Close();
            }

            myConnection.Close();

            FillDGW();
            DGWToplam();
            DrawChart1();
            DrawChart2();
            DrawChart3();
            DrawChart4();
        }