Ejemplo n.º 1
0
        private void btnGoBack_Click(object sender, EventArgs e)
        {
            frmMasalar form_Masalar = new frmMasalar();

            form_Masalar.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        } // Hesap Kaydı butonu

        private void btnTables_Click(object sender, EventArgs e)
        {
            frmMasalar form_Masalar = new frmMasalar();

            form_Masalar.Show();
            this.Hide();
        } // Masalar butonu
Ejemplo n.º 3
0
        private void btnGoBack_Click(object sender, EventArgs e)
        {
            frmMasalar main = new frmMasalar();

            main.Show();
            this.Hide();
        }
Ejemplo n.º 4
0
        private void btnPay_Click(object sender, EventArgs e)
        {
            int    Day    = DateTime.Now.Day;
            int    Month  = DateTime.Now.Month;
            int    Year   = DateTime.Now.Year;
            int    Hour   = DateTime.Now.Hour;
            int    Minute = DateTime.Now.Minute;
            int    Second = DateTime.Now.Second;
            string Date   = Day + "." + Month + "." + Year + " " + Hour + ":" + Minute + ":" + Second;

            //AraToplam = Math.Round(AraToplam, 2, MidpointRounding.AwayFromZero);
            //KDVTutari = Math.Round(KDVTutari, 2, MidpointRounding.AwayFromZero);
            //IndirimTutari = Math.Round(IndirimTutari, 2, MidpointRounding.AwayFromZero);
            //ToplamTutar = Math.Round(ToplamTutar, 2, MidpointRounding.AwayFromZero);

            cmd             = new OleDbCommand();
            cmd.Connection  = con;
            cmd.CommandText = "INSERT INTO HesapHareketleri(PersonelKodu,OdemeTuruKodu,AraToplam,KdvTutari,Indirim,ToplamTutar,Tarih) VALUES(@PK,@OTK,@AT,@KDV,@DIS,@TT,@Tarih)";
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            cmd.Parameters.AddWithValue("@PK", frmLogin.PersonelKodu);
            cmd.Parameters.AddWithValue("@OTK", int.Parse(cbPayType.SelectedValue.ToString()));
            cmd.Parameters.AddWithValue("@AT", Math.Round((double)AraToplam, 2));
            cmd.Parameters.AddWithValue("@KDV", Math.Round((double)KDVTutari, 2));
            cmd.Parameters.AddWithValue("@DIS", Math.Round((double)IndirimTutari, 2));
            cmd.Parameters.AddWithValue("@TT", Math.Round((double)ToplamTutar, 2));
            cmd.Parameters.AddWithValue("@Tarih", Date);
            cmd.ExecuteNonQuery();
            if (Indirim)
            {
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "DELETE FROM IndirimKodlari WHERE Kod=@Kod";
                cmd.Parameters.AddWithValue("@Kod", IndirimKodu);
                cmd.ExecuteNonQuery();
            }
            cmd             = new OleDbCommand();
            cmd.Connection  = con;
            cmd.CommandText = "DELETE FROM Adisyon WHERE MasaKodu=@mkodu";
            cmd.Parameters.AddWithValue("@mkodu", MasaKodu);
            cmd.ExecuteNonQuery();
            cmd             = new OleDbCommand();
            cmd.Connection  = con;
            cmd.CommandText = "UPDATE Masalar SET Durum=1 WHERE MasaKodu=@mkodu";
            cmd.Parameters.AddWithValue("@mkodu", MasaKodu);
            cmd.ExecuteNonQuery();
            cmd             = new OleDbCommand();
            cmd.Connection  = con;
            cmd.CommandText = "INSERT INTO PersonelHareketleri(PersonelKodu,Islem,Tarih) VALUES(@pkodu,@islem,@tarih)";
            cmd.Parameters.AddWithValue("@pkodu", frmLogin.PersonelKodu);
            cmd.Parameters.AddWithValue("@islem", MasaNumarasi + " Numaralı masanın ödemesini gerçekleştirdi.");
            cmd.Parameters.AddWithValue("@tarih", Date);
            cmd.ExecuteNonQuery();
            MessageBox.Show("Ödeme işlemi başarıyla tamamlandı ve kayıtlara işlendi.", "Bilgi");

            frmMasalar form_Masalar = new frmMasalar();

            form_Masalar.Show();
            this.Hide();
        }
Ejemplo n.º 5
0
        private void btnSwap_Click(object sender, EventArgs e)
        {
            if (rbBos.Checked)
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "UPDATE Adisyon SET MasaKodu=@ymkodu WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@ymkodu", lbSecondTable.SelectedValue);
                cmd.Parameters.AddWithValue("@mkodu", lbFirstTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "UPDATE Masalar SET Durum=1 WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbFirstTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "UPDATE Masalar SET Durum=2 WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbSecondTable.SelectedValue);
                cmd.ExecuteNonQuery();

                MessageBox.Show("Masa " + lbFirstTable.Text + ", Masa " + lbSecondTable.Text + "'ye taşınmıştır.", "Bilgi");
                frmMasalar frm = new frmMasalar();
                frm.Show();
                this.Hide();
            }
            else if (rbDolu.Checked)
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "INSERT INTO MasaTasima SELECT * FROM Adisyon WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbFirstTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "DELETE FROM Adisyon WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbFirstTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "UPDATE Adisyon SET MasaKodu=@ymkodu WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@ymkodu", lbFirstTable.SelectedValue);
                cmd.Parameters.AddWithValue("@mkodu", lbSecondTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "UPDATE MasaTasima SET MasaKodu=@ymkodu WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@ymkodu", lbSecondTable.SelectedValue);
                cmd.Parameters.AddWithValue("@mkodu", lbFirstTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "INSERT INTO Adisyon SELECT * FROM MasaTasima WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbSecondTable.SelectedValue);
                cmd.ExecuteNonQuery();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.CommandText = "DELETE FROM MasaTasima WHERE MasaKodu=@mkodu";
                cmd.Parameters.AddWithValue("@mkodu", lbSecondTable.SelectedValue);
                cmd.ExecuteNonQuery();
                MessageBox.Show("Masa " + lbFirstTable.Text + " ile Masa " + lbSecondTable.Text + " değiştirilmiştir.", "Bilgi");
                frmMasalar frm = new frmMasalar();
                frm.Show();
                this.Hide();
            }
        }