Exemplo n.º 1
0
        private void KasiyerEkrani_Load(object sender, EventArgs e)
        {
            adisyon adisyon = new adisyon();

            lvAdisyon.GridLines = true;
            durumGuncelle();
        }
Exemplo n.º 2
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            adisyon  adisyon = new adisyon();
            ListView liste;

            if (lbUrunTuru.Text == "icecek")
            {
                liste = lvIcecek;
            }
            else if (lbUrunTuru.Text == "yiyecek")
            {
                liste = lvYiyecek;
            }
            else
            {
                liste = lvTatlilar;
            }

            ListViewItem item = liste.SelectedItems[0];

            adisyon.UrunEkle(item.SubItems[1].Text, item.SubItems[2].Text, lbUrunTuru.Text, lblMasaNo.Text, lbAdSoyad.Text);
            lvUrunler.Items.Clear();
            adisyon.UrunGoster(lblMasaNo.Text, lvUrunler);

            int gelendeger = adisyon.masaDurumuDegistir(lblMasaNo.Text, "2");

            durumGuncelle();
        }
Exemplo n.º 3
0
        private void text_changed(object sender, EventArgs e)
        {
            string masano = lbMasaNo.Text;

            lvAdisyon.Items.Clear();
            adisyon adisyon = new adisyon();

            adisyon.UrunGoster(masano, lvAdisyon);
        }
Exemplo n.º 4
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            adisyon adisyon = new adisyon();

            if (lbMasaNo.Text != "" && lbId.Text != "")
            {
                string masano = lbMasaNo.Text;
                adisyon.UrunSil(Convert.ToInt32(lbId.Text));
                lvAdisyon.Items.Clear();
                adisyon.UrunGoster(masano, lvAdisyon);
                if (lvAdisyon.Items.Count == 0)
                {
                    adisyon.masaDurumuDegistir(masano, "0");
                    durumGuncelle();
                }
            }
        }
Exemplo n.º 5
0
        /* private void btnUrunSil_Click(object sender, EventArgs e)
         * {
         *   adisyon adisyon = new adisyon();
         *   if (lblMasaNo.Text != "")
         *   {
         *       string masano = lblMasaNo.Text;
         *       ListViewItem item = lvUrunler.SelectedItems[0];
         *      lbId.Text= item.SubItems[0].Text;
         *       adisyon.UrunSil(Convert.ToInt32(lbId.Text));
         *       lvUrunler.Items.Clear();
         *       adisyon.UrunGoster(masano, lvUrunler);
         *       if (lvUrunler.Items.Count == 0)
         *       {
         *           adisyon.masaDurumuDegistir(masano, "0");
         *           durumGuncelle();
         *       }
         *   }
         * }*/

        //oda doluysa rezerve enable = false olsun. !!!!!!

        private void cbRezerve_CheckedChanged(object sender, EventArgs e)
        {
            if (cbRezerve.Checked == true)
            {
                adisyon adisyon = new adisyon();
                string  masano  = lblMasaNo.Text;
                adisyon.masaDurumuDegistir(masano, "1");
                durumGuncelle();
            }
            else
            {
                adisyon adisyon = new adisyon();
                string  masano  = lblMasaNo.Text;
                adisyon.masaDurumuDegistir(masano, "0");
                durumGuncelle();
            }
        }
Exemplo n.º 6
0
        private void btn_Click(object sender, EventArgs e)
        {
            adisyon adisyon = new adisyon();

            lblMasaNo.Visible = true;
            lblMasaNo.Text    = ((Button)sender).Text;
            int gelenDeger = adisyon.rezervemasamı(lblMasaNo.Text);

            if (gelenDeger == 1)
            {
                cbRezerve.Enabled = true;
                cbRezerve.Checked = true;
            }
            else if (gelenDeger == 2)
            {
                cbRezerve.Enabled = false;
            }
            else
            {
                cbRezerve.Checked = false;
                cbRezerve.Enabled = true;
            }
        }
Exemplo n.º 7
0
        private void text_changed(object sender, EventArgs e)
        {
            string masano = lblMasaNo.Text;

            lvUrunler.Items.Clear();
            adisyon adisyon = new adisyon();

            adisyon.UrunGoster(masano, lvUrunler);
            int gelenDeger = adisyon.rezervemasamı(lblMasaNo.Text);

            if (gelenDeger == 1)
            {
                cbRezerve.Checked = true;
            }
            else if (gelenDeger == 2)
            {
                cbRezerve.Enabled = false;
            }
            else
            {
                cbRezerve.Checked = false;
            }
        }
Exemplo n.º 8
0
        private void durumGuncelle()
        {
            adisyon adisyon = new adisyon();

            string[] masaDizisi  = new string[24];
            string[] durumDizisi = new string[24];
            adisyon.masaDurumuDoldur(masaDizisi, durumDizisi);
            for (int i = 0; i < masaDizisi.Length; i++)
            {
                Button btn = (Button)this.Controls.Find("btn" + masaDizisi[i], true)[0];
                if (durumDizisi[i] == "0")
                {
                    btn.BackColor = Color.Green;
                }
                else if (durumDizisi[i] == "1")
                {
                    btn.BackColor = Color.Yellow;
                }
                else
                {
                    btn.BackColor = Color.Red;
                }
            }
        }
Exemplo n.º 9
0
        private void btnOde_Click(object sender, EventArgs e)
        {
            if (lvAdisyon.SelectedItems.Count > 0)
            {
                ListViewItem item = lvAdisyon.SelectedItems[0];
                string       para = item.SubItems[2].Text;
                ParaMiktarGetir(para);
            }

            adisyon adisyon = new adisyon();

            if (lbMasaNo.Text != "" && lbId.Text != "")
            {
                string masano = lbMasaNo.Text;
                adisyon.UrunSil(Convert.ToInt32(lbId.Text));
                lvAdisyon.Items.Clear();
                adisyon.UrunGoster(masano, lvAdisyon);
                if (lvAdisyon.Items.Count == 0)
                {
                    adisyon.masaDurumuDegistir(masano, "0");
                    durumGuncelle();
                }
            }
        }