コード例 #1
0
        private void frmSiparis_Load(object sender, EventArgs e)
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            lblMasaNo.Text   = cGenel._ButtonValue;

            cMasalar ms = new cMasalar();

            TableId = ms.TableGetByNumber(cGenel._ButtonName);

            if (ms.TableGetByState(TableId, 2) == 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);
            btn4.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);



            // ms.MasalariDurumaGoreGetir(cbMasalar);
        }
コード例 #2
0
        private void lvSiparisler_DoubleClick(object sender, EventArgs e)
        {
            if (lvSiparisler.Items.Count > 0)
            {
                if (lvSiparisler.SelectedItems[0].SubItems[4].Text != "0")
                {
                    cSiparis saveOrder = new cSiparis();
                    saveOrder.SetDeleteOrder(Convert.ToInt32(lvSiparisler.SelectedItems[0].SubItems[4].Text));
                }

                else
                {
                    for (int i = 0; i < lvYeniEklenenler.Items.Count; i++)
                    {
                        if (lvYeniEklenenler.Items[i].SubItems[4].Text == lvSiparisler.SelectedItems[0].SubItems[5].Text)
                        {
                            lvYeniEklenenler.Items.RemoveAt(i);
                        }
                    }
                }

                lvSiparisler.Items.RemoveAt(lvSiparisler.SelectedItems[0].Index);
            }
        }
コード例 #3
0
ファイル: frmBill.cs プロジェクト: alianilKaradag/Palto_Cafe
        private void lvUrunler_DoubleClick(object sender, EventArgs e)
        {
            label30.Visible   = true;
            listView1.Visible = true;
            label6.Visible    = true;
            label7.Visible    = true;
            label8.Visible    = true;
            groupBox5.Visible = true;
            button1.Visible   = true;
            groupBox2.Visible = true;
            label17.Visible   = true;
            label18.Visible   = true;
            label19.Visible   = true;
            label20.Visible   = true;
            label21.Visible   = true;
            label22.Visible   = true;
            label23.Visible   = true;
            label24.Visible   = true;
            label25.Visible   = true;
            label27.Visible   = true;


            if (lvUrunler.Items.Count > 0)
            {
                if (lvUrunler.SelectedItems[0].SubItems[4].Text != "0")
                {
                    if (lvUrunler.SelectedItems.Count > 0 && lvUrunler.SelectedItems[0].SubItems.Count > 4)
                    {
                        cSiparis saveOrder = new cSiparis();
                        saveOrder.SetDeleteOrder(Convert.ToInt32(lvUrunler.SelectedItems[0].SubItems[4].Text));

                        int listviewsayac = listView1.Items.Count;

                        listView1.Items.Add(lvUrunler.SelectedItems[0].Text);
                        listView1.Items[listviewsayac].SubItems.Add(lvUrunler.SelectedItems[0].SubItems[1].Text);
                        listView1.Items[listviewsayac].SubItems.Add(lvUrunler.SelectedItems[0].SubItems[2].Text);
                        listView1.Items[listviewsayac].SubItems.Add(lvUrunler.SelectedItems[0].SubItems[3].Text);
                        listView1.Items[listviewsayac].SubItems.Add(lvUrunler.SelectedItems[0].SubItems[4].Text);

                        int listviewsayac2 = listView1.Items.Count;

                        hesaptandustoplam = 0;
                        for (int i = 0; i < listviewsayac2; i++)
                        {
                            hesaptandustoplam = Convert.ToDecimal(listView1.Items[i].SubItems[3].Text) + hesaptandustoplam;
                            label7.Text       = hesaptandustoplam.ToString();
                            label21.Text      = hesaptandustoplam.ToString();
                        }
                        hesaptandustoplam = 0;



                        lblToplamTutar.Text = (Convert.ToDecimal(lblToplamTutar.Text) - Convert.ToDecimal(listView1.Items[listviewsayac].SubItems[3].Text)).ToString();
                        lblOdenecek.Text    = (Convert.ToDecimal(lblOdenecek.Text) - Convert.ToDecimal(listView1.Items[listviewsayac].SubItems[3].Text)).ToString();
                        listviewsayac++;
                    }
                }
                else
                {
                    for (int i = 0; i < listView1.Items.Count; i++)
                    {
                        if (listView1.Items[i].SubItems[4].Text == lvUrunler.SelectedItems[0].SubItems[5].Text)
                        {
                            listView1.Items.RemoveAt(i);
                        }
                    }
                }

                lvUrunler.Items.RemoveAt(lvUrunler.SelectedItems[0].Index);
            }
        }
コード例 #4
0
        private void btnSiparis_Click(object sender, EventArgs e)
        {
            /*
             * 1-masa boş
             * 2-masa dolu
             */

            cMasalar Masa        = new cMasalar();
            cAdisyon NewAddition = new cAdisyon();
            cSiparis SaveOrder   = new cSiparis();

            frmMasalar ms = new frmMasalar();

            bool sonuc = false;


            if (Masa.TableGetByState(TableId, 1) == true)
            {
                NewAddition.PERSONELID = 1;
                NewAddition.MASAID     = TableId;
                NewAddition.TARIH      = DateTime.Now;
                sonuc = NewAddition.SetByAdditionNew(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.Adet      = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[2].Text);
                        SaveOrder.AdisyonId = NewAddition.GetByAddition(TableId);
                        SaveOrder.UrunId    = Convert.ToInt32(lvYeniEklenenler.Items[i].SubItems[1].Text);
                        SaveOrder.SetSaveOrder(SaveOrder);
                    }
                }

                if (silinenler.Count > 0)
                {
                    foreach (string item in silinenler)
                    {
                        SaveOrder.SetDeleteOrder(Convert.ToInt32(item));
                    }
                }

                this.Close();
                ms.Show();
            }
        }
コード例 #5
0
ファイル: frmBill.cs プロジェクト: alianilKaradag/Palto_Cafe
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (listView1.Items.Count > 0)
            {
                if (listView1.SelectedItems[0].SubItems[4].Text != "0")
                {
                    if (listView1.SelectedItems.Count > 0 && listView1.SelectedItems[0].SubItems.Count > 4)
                    {
                        cSiparis saveOrder = new cSiparis();
                        saveOrder.SetDeleteOrder(Convert.ToInt32(listView1.SelectedItems[0].SubItems[4].Text));

                        int lvurunsayac   = lvUrunler.Items.Count;
                        int listviewsayac = listView1.Items.Count;

                        lvUrunler.Items.Add(listView1.SelectedItems[0].Text);
                        lvUrunler.Items[lvurunsayac].SubItems.Add(listView1.SelectedItems[0].SubItems[1].Text);
                        lvUrunler.Items[lvurunsayac].SubItems.Add(listView1.SelectedItems[0].SubItems[2].Text);
                        lvUrunler.Items[lvurunsayac].SubItems.Add(listView1.SelectedItems[0].SubItems[3].Text);
                        lvUrunler.Items[lvurunsayac].SubItems.Add(listView1.SelectedItems[0].SubItems[4].Text);

                        int lvurunsayac2 = lvUrunler.Items.Count;


                        toplamtutar   = 0;
                        odenecektutar = 0;

                        for (int i = 0; i < lvurunsayac2; i++)
                        {
                            toplamtutar   = Convert.ToDecimal(lvUrunler.Items[i].SubItems[3].Text) + toplamtutar;
                            odenecektutar = Convert.ToDecimal(lvUrunler.Items[i].SubItems[3].Text) + odenecektutar;

                            lblToplamTutar.Text = toplamtutar.ToString();
                            lblOdenecek.Text    = odenecektutar.ToString();
                        }
                        toplamtutar   = 0;
                        odenecektutar = 0;

                        //hesaptandustoplam = Convert.ToDecimal(listView1.Items[sayac].SubItems[3].Text) + hesaptandustoplam;
                        //label7.Text = hesaptandustoplam.ToString();

                        lvurunsayac++;
                    }
                }
                else
                {
                    for (int i = 0; i < listView1.Items.Count; i++)
                    {
                        if (lvUrunler.Items[i].SubItems[4].Text == listView1.SelectedItems[0].SubItems[5].Text)
                        {
                            lvUrunler.Items.RemoveAt(i);
                        }
                    }
                }
                hesaptandustoplam = 0;
                listView1.Items.RemoveAt(listView1.SelectedItems[0].Index);
                int listviewsayac2 = listView1.Items.Count;
                for (int i = 0; i < listviewsayac2; i++)
                {
                    hesaptandustoplam = Convert.ToDecimal(listView1.Items[i].SubItems[3].Text) + hesaptandustoplam;
                    label7.Text       = hesaptandustoplam.ToString();
                    label21.Text      = hesaptandustoplam.ToString();
                }
                hesaptandustoplam = 0;
            }
        }