Exemplo n.º 1
0
        public void FisiKes_Button_Clicked(object Sender, EventArgs e)
        {
            this.button1.Enabled = false;
            this.button2.Enabled = false;
            this.button3.Enabled = false;

            string info    = "Ödemeniz " + checkSum + " TL.";
            string success = "Fiş No: " + this.fisNo + ", Masa: "
                             + tableNumber + ", Ödeme: " + checkSum + "TL, Tarih: " + DateTime.Now;

            string failure = "Fiş No: " + this.fisNo + ", Masa: "
                             + tableNumber + ", Ödeme: " + checkSum + "TL YAPILMAMIŞTIR, Tarih: " + DateTime.Now;

            var exist = TableContainer.GetInstance().Where(x => x.MasaNo == this.tableNumber && x.MasaAktif == true).FirstOrDefault();

            //var control1 = TableContainer.GetInstance();
            //Listeden çıkarılma
            if (exist != null)
            {
                TableContainer.GetInstance().Remove(exist);
            }

            //var control2 = TableContainer.GetInstance();
            this.Close();
            OdemeOnay onay = new OdemeOnay(info, success, failure, this, parent, checkSum);

            onay.Show();
        }
Exemplo n.º 2
0
        public void Fis_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.WindowsShutDown)
            {
            }
            else if (e.CloseReason == CloseReason.UserClosing)
            {
                //Varolan fişi ekle
                List <ListViewItem> urunler = new List <ListViewItem>();
                foreach (ListViewItem itm in listView1.Items)
                {
                    urunler.Add(itm);
                }

                TableHistory Hist = new TableHistory(this.tableNumber, this.checkSum, this.fisNo, urunler);
                TableContainer.GetInstance().Add(Hist);
            }
        }
Exemplo n.º 3
0
        public Fis(string TableNumber, Form Parent)
        {
            InitializeComponent();

            this.parent      = Parent;
            this.tableNumber = Convert.ToInt32(Regex.Replace(TableNumber, "[^0-9]", ""));

            #region FisInit
            comboBox1.Items.Add("Küçük Çay");
            comboBox1.Items.Add("Büyük Çay");
            comboBox1.Items.Add("Türk Kahvesi");
            comboBox1.Items.Add("Küçük Nescafe");
            comboBox1.Items.Add("Fincan Nescafe");
            comboBox1.Items.Add("Soda");
            comboBox1.Items.Add("Kola");
            comboBox1.Items.Add("Fanta");
            comboBox1.Items.Add("Sprite");
            comboBox1.Items.Add("Gazoz");
            comboBox1.Items.Add("Limonlu Soda");
            comboBox1.Items.Add("Ayran");
            comboBox1.Items.Add("Kaşarlı Tost");
            comboBox1.Items.Add("Karışık Tost");

            comboBox2.Items.Add(1);
            comboBox2.Items.Add(2);
            comboBox2.Items.Add(3);
            comboBox2.Items.Add(4);
            comboBox2.Items.Add(5);
            comboBox2.Items.Add(6);
            comboBox2.Items.Add(7);
            comboBox2.Items.Add(8);

            comboBox3.Items.Add("Çeyrek");
            comboBox3.Items.Add("Yarım");
            comboBox3.Items.Add("Tam");
            #endregion

            #region ButtonAndTextBoxInit

            this.textBox1.Text     = this.tableNumber.ToString();
            this.textBox1.ReadOnly = true;
            this.textBox3.ReadOnly = true;
            comboBox2.Enabled      = false;
            comboBox3.Hide();

            this.button1.Enabled = false;  //Ekle butonu
            this.button2.Enabled = false;  //Sil butonu


            this.button1.Click += new System.EventHandler(Ekle_Button_Click);
            this.button2.Click += new System.EventHandler(Sil_Button_Click);
            this.button3.Click += new System.EventHandler(FisiKes_Button_Clicked);

            this.comboBox1.SelectedIndexChanged += new System.EventHandler(ComboBox1_SelectedIndexChanged);
            this.comboBox2.SelectedIndexChanged += new System.EventHandler(ComboBox2_SelectedIndexChanged);
            this.comboBox3.SelectedIndexChanged += new System.EventHandler(ComboBox3_SelectedIndexChanged);
            this.FormClosing += Fis_FormClosing;

            listView1.View             = View.Details;
            listView1.Columns[1].Width = 150; // Ürün adı sütunu
            #endregion


            var exist = TableContainer.GetInstance().Where(x => x.MasaNo == this.tableNumber && x.MasaAktif == true).FirstOrDefault();
            //Masa Dolu
            if (exist != null)
            {
                this.fisNo = exist.FisNo;

                foreach (ListViewItem itm in exist.Urunler)
                {
                    listView1.Items.Add(itm);
                }

                this.checkSum = exist.Bakiye;
                textBox2.Text = checkSum.ToString();
            }
            else
            {
                fisNo = Numerator.GetInstance().FisNo();
                Numerator.GetInstance().ResetNumerator(); //sıra Numeratörünü başa döndür.
            }

            this.textBox3.Text = fisNo.ToString();
        }