Advertisement
demoraesr89

Pizza Store

Jul 24th, 2019
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 13.55 KB | None | 0 0
  1.  
  2.  
  3. using System;
  4.  
  5. using System.Collections.Generic;
  6.  
  7. using System.ComponentModel;
  8.  
  9. using System.Data;
  10.  
  11. using System.Drawing;
  12.  
  13. using System.Linq;
  14.  
  15. using System.Text;
  16.  
  17. using System.Threading.Tasks;
  18.  
  19. using System.Windows.Forms;
  20.  
  21.  
  22.  
  23. namespace PizzaStore
  24.  
  25. {
  26.  
  27.     public partial class PizzaStart : Form
  28.  
  29.     {
  30.  
  31.         public PizzaStart()
  32.  
  33.         {
  34.  
  35.             InitializeComponent();
  36.  
  37.               }
  38.  
  39.  
  40.  
  41.         public static string sendname = "";  //this is the public statics that will transfer over
  42.  
  43.         public static string sendphone = "";
  44.  
  45.  
  46.  
  47.         private void Order_Click(object sender, EventArgs e)
  48.  
  49.         {
  50.  
  51.  
  52.  
  53.             if (Nametext.Text == "" || Phone.Text == "")
  54.  
  55.             {
  56.  
  57.                 MessageBox.Show("Please Enter a Customer");
  58.  
  59.             }
  60.  
  61.  
  62.  
  63.             else
  64.  
  65.             {
  66.  
  67.                 sendname = Nametext.Text;
  68.  
  69.                 sendphone = Phone.Text;
  70.  
  71.                 Pizzamenu pm = new Pizzamenu();
  72.  
  73.                 this.Hide();
  74.  
  75.                 pm.ShowDialog();
  76.  
  77.             }
  78.  
  79.         }
  80.  
  81.     }
  82.  
  83. }
  84.  
  85. Forum 2:
  86.  
  87.  
  88.  
  89. using System;
  90.  
  91. using System.Collections.Generic;
  92.  
  93. using System.ComponentModel;
  94.  
  95. using System.Data;
  96.  
  97. using System.Drawing;
  98.  
  99. using System.Linq;
  100.  
  101. using System.Text;
  102.  
  103. using System.Threading.Tasks;
  104.  
  105. using System.Windows.Forms;
  106.  
  107.  
  108.  
  109. namespace PizzaStore
  110.  
  111. {
  112.  
  113.     public partial class Pizzamenu : Form
  114.  
  115.     {
  116.  
  117.         public Pizzamenu()
  118.  
  119.         {
  120.  
  121.             InitializeComponent();
  122.  
  123.              
  124.  
  125.         }
  126.  
  127.  
  128.  
  129.         private double sm=5.99, med=7.99, l=12.99, price=0; //declared the privates so we can get a mulitplies of each item
  130.  
  131.         private double meat = 2.99, greens = 2.99;
  132.  
  133.         private double extrac = 2.00, peppi = 1.50, bananap = 2.00, jalepeno = 2.00;
  134.  
  135.  
  136.  
  137.  
  138.  
  139.         private void PizzaAdd_Click(object sender, EventArgs e)
  140.  
  141.         {
  142.  
  143.             if(!Small.Checked && !Medium.Checked && !Large.Checked)
  144.  
  145.             {
  146.  
  147.                 MessageBox.Show("Please Choose Size");
  148.  
  149.             }
  150.  
  151.  
  152.  
  153.             if (Small.Checked)
  154.  
  155.             {
  156.  
  157.  
  158.  
  159.                 ListViewItem fm = new ListViewItem("***Small Pizza");
  160.  
  161.                 fm.SubItems.Add("5.99");
  162.  
  163.                 this.listView1.Items.Add(fm);
  164.  
  165.                  
  166.  
  167.                 price += sm;                    //this will sum it up
  168.  
  169.                  
  170.  
  171.                 label3.Text = price.ToString();
  172.  
  173.  
  174.  
  175.                 if (Small.Checked == Meat.Checked)
  176.  
  177.                 {
  178.  
  179.  
  180.  
  181.                     ListViewItem fm1 = new ListViewItem("MeatLovers");
  182.  
  183.                     fm1.SubItems.Add("2.99");
  184.  
  185.                     this.listView1.Items.Add(fm1);
  186.  
  187.                  
  188.  
  189.                     price += meat;
  190.  
  191.                     label3.Text = price.ToString();
  192.  
  193.                 }
  194.  
  195.  
  196.  
  197.                 if (Small.Checked == veggie.Checked)
  198.  
  199.                 {
  200.  
  201.                     ListViewItem fm2 = new ListViewItem("Garden Fresh");
  202.  
  203.                     fm2.SubItems.Add("2.99");
  204.  
  205.                     this.listView1.Items.Add(fm2);
  206.  
  207.                    
  208.  
  209.                     price += greens;
  210.  
  211.                     label3.Text = price.ToString();
  212.  
  213.                 }
  214.  
  215.                 if (Small.Checked == Cheese.Checked)
  216.  
  217.                 {
  218.  
  219.                     ListViewItem fm3 = new ListViewItem("Cheese Only");
  220.  
  221.                     fm3.SubItems.Add("0.00");
  222.  
  223.                     this.listView1.Items.Add(fm3);
  224.  
  225.                    
  226.  
  227.                     price += 0;
  228.  
  229.  
  230.  
  231.                     label3.Text = price.ToString();
  232.  
  233.                 }
  234.  
  235.             }
  236.  
  237.  
  238.  
  239.             if (Medium.Checked)
  240.  
  241.             {
  242.  
  243.                 ListViewItem fm = new ListViewItem("***Medium Pizza");
  244.  
  245.                 fm.SubItems.Add("7.99");
  246.  
  247.                 this.listView1.Items.Add(fm);
  248.  
  249.  
  250.  
  251.                 price += med;
  252.  
  253.                 label3.Text = price.ToString();
  254.  
  255.  
  256.  
  257.                 if (Medium.Checked == Meat.Checked)
  258.  
  259.                 {
  260.  
  261.                     ListViewItem fm1 = new ListViewItem("Meat Lovers");
  262.  
  263.                     fm1.SubItems.Add("2.99");
  264.  
  265.                     this.listView1.Items.Add(fm1);
  266.  
  267.  
  268.  
  269.                     price += meat;
  270.  
  271.                     label3.Text = price.ToString();
  272.  
  273.                 }
  274.  
  275.  
  276.  
  277.                 if (Medium.Checked == veggie.Checked)
  278.  
  279.                 {
  280.  
  281.                     ListViewItem fm2 = new ListViewItem("Garden Fresh");
  282.  
  283.                     fm2.SubItems.Add("2.99");
  284.  
  285.                     this.listView1.Items.Add(fm2);
  286.  
  287.  
  288.  
  289.                     price += greens;
  290.  
  291.                     label3.Text = price.ToString();
  292.  
  293.  
  294.  
  295.                 }
  296.  
  297.                 if (Medium.Checked == Cheese.Checked)
  298.  
  299.                 {
  300.  
  301.                     ListViewItem fm3 = new ListViewItem("Cheese Only");
  302.  
  303.                     fm3.SubItems.Add("0.00");
  304.  
  305.                     this.listView1.Items.Add(fm3);
  306.  
  307.  
  308.  
  309.                     price += 0;
  310.  
  311.                     label3.Text = price.ToString();
  312.  
  313.                 }
  314.  
  315.             }
  316.  
  317.             if (Large.Checked)
  318.  
  319.             {  
  320.  
  321.                 ListViewItem fm = new ListViewItem("***Large Pizza");
  322.  
  323.                 fm.SubItems.Add("12.99");
  324.  
  325.                 this.listView1.Items.Add(fm);
  326.  
  327.  
  328.  
  329.                 price += l ;
  330.  
  331.                 label3.Text = price.ToString();
  332.  
  333.  
  334.  
  335.                 if (Large.Checked == Meat.Checked)
  336.  
  337.                 {
  338.  
  339.                     ListViewItem fm1 = new ListViewItem("Meat Lovers");
  340.  
  341.                     fm1.SubItems.Add("2.99");
  342.  
  343.                     this.listView1.Items.Add(fm1);
  344.  
  345.  
  346.  
  347.                     price += meat;
  348.  
  349.                     label3.Text = price.ToString();
  350.  
  351.                 }
  352.  
  353.  
  354.  
  355.                 if (Large.Checked == veggie.Checked)
  356.  
  357.                 {
  358.  
  359.                     ListViewItem fm2 = new ListViewItem("Garden Fresh");
  360.  
  361.                     fm2.SubItems.Add("2.99");
  362.  
  363.                     this.listView1.Items.Add(fm2);
  364.  
  365.  
  366.  
  367.                     price += greens;
  368.  
  369.                     label3.Text = price.ToString();
  370.  
  371.                 }
  372.  
  373.                 if (Large.Checked == Cheese.Checked)
  374.  
  375.                 {
  376.  
  377.                     ListViewItem fm3 = new ListViewItem("Cheese Only");
  378.  
  379.                     fm3.SubItems.Add("0.00");
  380.  
  381.                     this.listView1.Items.Add(fm3);
  382.  
  383.  
  384.  
  385.                     price += 0;
  386.  
  387.                     label3.Text = price.ToString();
  388.  
  389.                 }
  390.  
  391.             }
  392.  
  393.  
  394.  
  395.  
  396.  
  397.             if (XC.Checked)
  398.  
  399.             {
  400.  
  401.                 ListViewItem fm1 = new ListViewItem("+Extra Cheese"); //only if the option is choosen
  402.  
  403.                 fm1.SubItems.Add("2.00");
  404.  
  405.                 this.listView1.Items.Add(fm1);
  406.  
  407.  
  408.  
  409.                 price += extrac;
  410.  
  411.                 label3.Text = price.ToString();
  412.  
  413.             }
  414.  
  415.             if (pepperoni.Checked)
  416.  
  417.             {
  418.  
  419.                 ListViewItem fm1 = new ListViewItem("+Pepperoni");
  420.  
  421.                 fm1.SubItems.Add("1.50");
  422.  
  423.                 this.listView1.Items.Add(fm1);
  424.  
  425.  
  426.  
  427.                 price += peppi;
  428.  
  429.                 label3.Text = price.ToString();
  430.  
  431.             }
  432.  
  433.             if (BananaP.Checked)
  434.  
  435.             {
  436.  
  437.                 ListViewItem fm1 = new ListViewItem("+Banana Peppers");
  438.  
  439.                 fm1.SubItems.Add("2.00");
  440.  
  441.                 this.listView1.Items.Add(fm1);
  442.  
  443.  
  444.  
  445.                 price += bananap;
  446.  
  447.                 label3.Text = price.ToString();
  448.  
  449.             }
  450.  
  451.             if (jalapeno.Checked)
  452.  
  453.             {
  454.  
  455.                 ListViewItem fm1 = new ListViewItem("+ Jalapeno");
  456.  
  457.                 fm1.SubItems.Add("2.00");
  458.  
  459.                 this.listView1.Items.Add(fm1);
  460.  
  461.  
  462.  
  463.                 price += jalepeno;
  464.  
  465.                 label3.Text = price.ToString();
  466.  
  467.             }
  468.  
  469.  
  470.  
  471.         }
  472.  
  473.              
  474.  
  475.  
  476.  
  477.  
  478.  
  479.         private void Pizzamenu_Load(object sender, EventArgs e)
  480.  
  481.         {
  482.  
  483.             label1.Text = PizzaStart.sendname;
  484.  
  485.             label2.Text = PizzaStart.sendphone;
  486.  
  487.         }
  488.  
  489.  
  490.  
  491.         private double cookies = 5.99, brownies = 5.99, cinnaminroll = 5.99;
  492.  
  493.  
  494.  
  495.         private void DessertAdd_Click(object sender, EventArgs e)
  496.  
  497.         {
  498.  
  499.             if (cookie.Checked)
  500.  
  501.             {
  502.  
  503.                 ListViewItem fm = new ListViewItem("Cookie Pie");
  504.  
  505.                 fm.SubItems.Add("5.99");
  506.  
  507.                 this.listView1.Items.Add(fm);
  508.  
  509.  
  510.  
  511.                 price += cookies;
  512.  
  513.                 label3.Text = price.ToString();
  514.  
  515.             }
  516.  
  517.             if (brownie.Checked)
  518.  
  519.             {
  520.  
  521.                 ListViewItem fm = new ListViewItem("Brownie Cake");
  522.  
  523.                 fm.SubItems.Add("5.99");
  524.  
  525.                 this.listView1.Items.Add(fm);
  526.  
  527.  
  528.  
  529.                 price += brownies;
  530.  
  531.                 label3.Text = price.ToString();
  532.  
  533.             }
  534.  
  535.             if (cinnamin.Checked)
  536.  
  537.             {
  538.  
  539.                 ListViewItem fm = new ListViewItem("Cinnamin Pull Apart Knots");
  540.  
  541.                 fm.SubItems.Add("5.99");
  542.  
  543.                 this.listView1.Items.Add(fm);
  544.  
  545.  
  546.  
  547.                 price += cinnaminroll;
  548.  
  549.                 label3.Text = price.ToString();
  550.  
  551.             }
  552.  
  553.         }
  554.  
  555.  
  556.  
  557.         private double soda = 1.99;
  558.  
  559.         private void DrinkAdd_Click(object sender, EventArgs e)
  560.  
  561.         {
  562.  
  563.             if (coke.Checked)
  564.  
  565.             {
  566.  
  567.                 ListViewItem fm = new ListViewItem("Coke");
  568.  
  569.                 fm.SubItems.Add("1.99");
  570.  
  571.                 this.listView1.Items.Add(fm);
  572.  
  573.  
  574.  
  575.                 price += soda;
  576.  
  577.                 label3.Text = price.ToString();
  578.  
  579.             }
  580.  
  581.             if (sprite.Checked)
  582.  
  583.             {
  584.  
  585.                 ListViewItem fm = new ListViewItem("Sprite");
  586.  
  587.                 fm.SubItems.Add("1.99");
  588.  
  589.                 this.listView1.Items.Add(fm);
  590.  
  591.  
  592.  
  593.                 price += soda;
  594.  
  595.                 label3.Text = price.ToString();
  596.  
  597.             }
  598.  
  599.         }
  600.  
  601.  
  602.  
  603.         private void Remove_Click(object sender, EventArgs e)
  604.  
  605.         {
  606.  
  607.  
  608.  
  609.             foreach (ListViewItem EachItem in listView1.SelectedItems)
  610.  
  611.             {
  612.  
  613.                 listView1.Items.Remove(EachItem);
  614.  
  615.             }
  616.  
  617.  
  618.  
  619.         }
  620.  
  621.  
  622.  
  623.         private void Clear_Click(object sender, EventArgs e)
  624.  
  625.         {
  626.  
  627.             Pizzamenu pm = new Pizzamenu();
  628.  
  629.             pm.Show();
  630.  
  631.             this.Dispose(false);
  632.  
  633.         }
  634.  
  635.  
  636.  
  637.         public static string TransferPrice = "";
  638.  
  639.         private void Pay_Click(object sender, EventArgs e)
  640.  
  641.         {
  642.  
  643.  
  644.  
  645.             if (label3.Text == "")
  646.  
  647.             {
  648.  
  649.                 MessageBox.Show("Please Order to Continue");
  650.  
  651.             } //if Label is blank, it will not proceed
  652.  
  653.  
  654.  
  655.             else
  656.  
  657.             {
  658.  
  659.                 TransferPrice = label3.Text;
  660.  
  661.  
  662.  
  663.                 FinishedPay fp = new FinishedPay();
  664.  
  665.                 this.Hide();
  666.  
  667.                 fp.ShowDialog();
  668.  
  669.             }  //once condition are met: it transfer over
  670.  
  671.         }
  672.  
  673.     }
  674.  
  675. }
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683. Forum 3:
  684.  
  685.  
  686.  
  687. using System;
  688.  
  689. using System.Collections.Generic;
  690.  
  691. using System.ComponentModel;
  692.  
  693. using System.Data;
  694.  
  695. using System.Drawing;
  696.  
  697. using System.Linq;
  698.  
  699. using System.Text;
  700.  
  701. using System.Threading.Tasks;
  702.  
  703. using System.Windows.Forms;
  704.  
  705.  
  706.  
  707. namespace PizzaStore
  708.  
  709. {
  710.  
  711.     public partial class FinishedPay : Form
  712.  
  713.     {
  714.  
  715.         public FinishedPay()
  716.  
  717.         {
  718.  
  719.             InitializeComponent();
  720.  
  721.         }
  722.  
  723.  
  724.  
  725.         private void FinishedPay_Load(object sender, EventArgs e)
  726.  
  727.         {
  728.  
  729.             totalprice.Text = Pizzamenu.TransferPrice;            
  730.  
  731.         }
  732.  
  733.  
  734.  
  735.         private void Exit_Click(object sender, EventArgs e)
  736.  
  737.         {
  738.  
  739.             Application.Exit();
  740.  
  741.         }
  742.  
  743.  
  744.  
  745.         private void Finished_Click(object sender, EventArgs e)
  746.  
  747.         {
  748.  
  749.             decimal price = Convert.ToDecimal(totalprice.Text);
  750.  
  751.             decimal finalpay = 0;
  752.  
  753.  
  754.  
  755.             if (Cash.Checked)
  756.  
  757.             {
  758.  
  759.                 if (change.Text == "")
  760.  
  761.                 {
  762.  
  763.                     MessageBox.Show("What is the Cash? ");
  764.  
  765.                 }
  766.  
  767.  
  768.  
  769.                 else
  770.  
  771.                 {
  772.  
  773.                     decimal handover = Convert.ToDecimal(change.Text);
  774.  
  775.  
  776.  
  777.                     finalpay = handover - price;
  778.  
  779.  
  780.  
  781.                     MessageBox.Show("Thank you: $ " + finalpay);
  782.  
  783.                 }
  784.  
  785.             }
  786.  
  787.  
  788.  
  789.             if (Card.Checked)
  790.  
  791.             {
  792.  
  793.                 MessageBox.Show("Your Credit Card has been Charged: $" + price);
  794.  
  795.             }
  796.  
  797.  
  798.  
  799.             if (Gift.Checked)
  800.  
  801.             {
  802.  
  803.                 MessageBox.Show("Your Gift Card has been Charged a total of: $" + price);
  804.  
  805.             }
  806.  
  807.  
  808.  
  809.             if(!Cash.Checked && !Card.Checked && !Gift.Checked)
  810.  
  811.             {
  812.  
  813.                 MessageBox.Show("Please Choose an Option to Pay");
  814.  
  815.                 return;
  816.  
  817.             }
  818.  
  819.         }
  820.  
  821.  
  822.  
  823.         private void GoBack_Click(object sender, EventArgs e)
  824.  
  825.         {
  826.  
  827.             Pizzamenu pm = new Pizzamenu();
  828.  
  829.             this.Hide();
  830.  
  831.             pm.ShowDialog();
  832.  
  833.         }
  834.  
  835.     }
  836.  
  837. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement