Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class frmMain : Form
- {
- public frmMain()
- {
- InitializeComponent();
- }
- public double pret = 0;
- public short aux = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- pnlComanda.Visible = false;
- pnlMain.Visible = true;
- pnlMeniu.Visible = false;
- pnlMeniu.Location = pnlMain.Location;
- pnlMeniu.Size = pnlMain.Size;
- pnlComanda.Location = pnlMain.Location;
- pnlComanda.Size = pnlMain.Size;
- lbBack.Visible = false;
- lstpreturi.Visible = false;
- pnlDespre.Size = pnlMain.Size;
- pnlDespre.Location = pnlMain.Location;
- }
- private void lbBack_Click(object sender, EventArgs e)
- {
- pnlComanda.Visible = false;
- pnlMeniu.Visible = false;
- pnlMain.Visible = true;
- pnlDespre.Visible = false;
- }
- private void btnComanda_Click(object sender, EventArgs e)
- {
- pnlComanda.Visible = true;
- pnlMain.Visible = false;
- lbBack.Visible = true;
- pictureBox1.Visible = false;
- }
- private void btnMeniu_Click(object sender, EventArgs e)
- {
- pnlComanda.Visible = false;
- pnlMain.Visible = false;
- pnlMeniu.Visible = true;
- lbBack.Visible = true;
- }
- private void btnConfirm_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Comanda ta a fost plasată cu succes!", "Confirmare");
- }
- private void btnReset_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Comanda ta a fost restată.", "Restare");
- foreach (Control ceva in gBstuff.Controls)
- {
- if ((ceva as CheckBox)!=null)
- {
- (ceva as CheckBox).Checked = false;
- }
- }
- foreach (Control ceva in gbMarime.Controls)
- {
- if ((ceva as RadioButton)!=null)
- {
- (ceva as RadioButton).Checked = false;
- }
- }
- comboBox1.Text = "";
- pictureBox1.Visible = false;
- lbpretfinal.Text = " ";
- rBmic.Enabled = true;
- rbMedie.Enabled = true;
- rbMare.Enabled = true;
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- pictureBox1.Image = new Bitmap("img/" + comboBox1.Text + ".jpg");
- pictureBox1.Visible = true;
- lbpretfinal.Text = lstpreturi.Items[comboBox1.SelectedIndex].ToString();
- pret = double.Parse(lbpretfinal.Text);
- foreach (Control ceva in gBstuff.Controls)
- {
- if ((ceva as CheckBox) != null)
- {
- (ceva as CheckBox).Checked = false;
- }
- }
- foreach (Control ceva in gbMarime.Controls)
- {
- if ((ceva as RadioButton) != null)
- {
- (ceva as RadioButton).Checked = false;
- }
- }
- rbMedie.Enabled = false;
- }
- private void btnDespre_Click(object sender, EventArgs e)
- {
- pnlComanda.Visible = false;
- pnlMain.Visible = false;
- pnlMeniu.Visible = false;
- lbBack.Visible = true;
- pnlDespre.Visible = true;
- }
- private void rBmic_Click(object sender, EventArgs e)
- {
- if (rBmic.Checked == true)
- {
- pret -= (double.Parse(lbpretfinal.Text) * (1 / 3.0));
- aux++;
- }
- else if (rBmic.Checked == false)
- {
- pret += (double.Parse(lbpretfinal.Text) * (1 / 3.0));
- }
- if (aux > 0)
- {
- rBmic.Enabled = false;
- }
- if (rbMare.Enabled==false)
- {
- rbMare.Enabled = true;
- }
- if (rbMedie.Enabled == false)
- {
- rbMedie.Enabled = true;
- }
- pret = double.Parse(String.Format("{0:0.00}", pret));
- lbpretfinal.Text = pret.ToString();
- }
- private double aux2 = 0;
- private void rbMedie_Click(object sender, EventArgs e)
- {
- if (rbMedie.Checked == true)
- {
- lbpretfinal.ResetText();
- aux2++;
- }
- if (aux2>0)
- {
- rbMedie.Enabled = false;
- }
- if (rbMare.Enabled == false)
- {
- rbMare.Enabled = true;
- }
- if (rBmic.Enabled == false)
- {
- rBmic.Enabled = true;
- }
- pret = double.Parse(String.Format("{0:0.00}", pret));
- lbpretfinal.Text = pret.ToString();
- }
- private double aux3 = 0;
- private void rbMare_Click(object sender, EventArgs e)
- {
- if (rbMare.Checked == true)
- {
- pret += (double.Parse(lbpretfinal.Text) * (2 / 3.0));
- aux3++;
- }
- else
- {
- if (rbMare.Checked==false)
- {
- pret -= double.Parse(lbpretfinal.Text);
- }
- }
- if (aux3 > 0)
- {
- rbMare.Enabled = false;
- }
- if (rbMedie.Enabled == false)
- {
- rbMedie.Enabled = true;
- }
- if (rBmic.Enabled == false)
- {
- rBmic.Enabled = true;
- }
- pret = double.Parse(String.Format("{0:0.00}", pret));
- lbpretfinal.Text = pret.ToString();
- }
- private void chbPorumb_Click(object sender, EventArgs e)
- {
- if (chbPorumb.Checked==true)
- {
- pret += 2;
- }
- else
- {
- pret -= 2;
- }
- lbpretfinal.Text = pret.ToString();
- }
- private void chbCiuperci_Click(object sender, EventArgs e)
- {
- if (chbCiuperci.Checked==true)
- {
- pret += 2.5;
- }
- else
- {
- pret -= 2.5;
- }
- lbpretfinal.Text = pret.ToString();
- }
- private void chbMozza_Click(object sender, EventArgs e)
- {
- if (chbMozza.Checked==true)
- {
- pret += 3;
- }
- else
- {
- pret -= 3;
- }
- lbpretfinal.Text = pret.ToString();
- }
- private void chbKetchup_Click(object sender, EventArgs e)
- {
- if (chbKetchup.Checked==true)
- {
- pret += 2;
- }
- else
- {
- pret -= 2;
- }
- lbpretfinal.Text = pret.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement