Ejemplo n.º 1
0
        private void frmSiparis_Load(object sender, EventArgs e)
        {
            lblMasaNo.Text = cGenel._ButtonValue;
            cMasalar ms = new cMasalar();

            tableId = ms.TableGetByNumber(cGenel._ButtonValue);
            if (ms.TableGetByState(tableId, 2) == true || ms.TableGetByState(tableId, 4) == true)
            {
                cAdisyon Ad = new cAdisyon();
                AdditionId = Ad.getByAddition(tableId);
                cSiparis orders = new cSiparis();
                orders.getByOrder(lvSiparisler, AdditionId);
            }


            btn1.Click  += new EventHandler(islem);
            btn2.Click  += new EventHandler(islem);
            btn3.Click  += new EventHandler(islem);
            btnn4.Click += new EventHandler(islem);
            btn5.Click  += new EventHandler(islem);
            btn6.Click  += new EventHandler(islem);
            btn7.Click  += new EventHandler(islem);
            btn8.Click  += new EventHandler(islem);
            btn9.Click  += new EventHandler(islem);
            btn0.Click  += new EventHandler(islem);
        }
Ejemplo n.º 2
0
        private void btnSiparis_Click(object sender, EventArgs e)
        {
            cMasalar   masa        = new cMasalar();
            frmMasalar ms          = new frmMasalar();
            cAdisyon   newAddition = new cAdisyon();
            cSiparis   saveOrder   = new cSiparis();

            bool sonuc = false;

            if (masa.TableGetByState(tableId, 1) == true)
            {
                newAddition.ServisTurNo = 1;
                newAddition.PersonelId1 = 1;
                newAddition.MasaId      = tableId;
                newAddition.Tarih       = DateTime.Now;
                sonuc = newAddition.setByAdditionel(newAddition);
                masa.setChangeTableState(cGenel._ButtonName, 2);

                if (lvSiparisler.Items.Count > 0)
                {
                    for (int i = 0; i < lvSiparisler.Items.Count; i++)
                    {
                        saveOrder.MasaId    = tableId;
                        saveOrder.UrunId    = Convert.ToInt32(lvSiparisler.Items[i].SubItems[2].Text);
                        saveOrder.AdisyonID = newAddition.getByAddition(tableId);
                        saveOrder.Adet      = Convert.ToInt32(lvSiparisler.Items[i].SubItems[1].Text);
                        saveOrder.setSaveOrder(saveOrder);
                    }
                    this.Close();
                    ms.Show();
                }
            }
            else if (masa.TableGetByState(tableId, 2) == true)
            {
                if (lvYeniEklenenler.Items.Count > 0)
                {
                    for (int i = 0; i < lvYeniEklenenler.Items.Count; i++)
                    {
                        saveOrder.MasaId = tableId;
                        saveOrder.UrunId = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[1].Text);
                        saveOrder.UrunId = newAddition.getByAddition(tableId);
                        saveOrder.UrunId = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[2].Text);
                        saveOrder.setSaveOrder(saveOrder);
                    }
                }
                if (silinenler.Count > 0)
                {
                    foreach (string item in silinenler)
                    {
                        saveOrder.setDeleteOrder(Convert.ToInt32(item));
                    }
                }
                this.Close();
                ms.Show();
            }
        }