Create an application for a Pizza delivery company. The application must provide a place for the user to enter their contact information (address, cell, telephone, e-mail) and some of the contact information should be displayed when the order is placed. Your application should have a picture logo and company name. Provide selections such as small, medium and large for pizza (Vegetarian, Hawaiian, Something Meaty….etc). BE CREATIVE You can also sell wings, mini-loaves, chicken strips or any other restaurant food of your choice. Also include beverages. You must display the price for the order and reset the order form. Experiment, explore, change properties and the review the .Designer.cs.file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace PizzaDeliveryCompany
{
public partial class frmPizzaDeliveryCompany : Form
{
public frmPizzaDeliveryCompany()
{
InitializeComponent();
}
private void btnCalculate_Click(object sender, EventArgs e)
{
double total = 0;
txtOrder.Text = "Order" + Environment.NewLine + Environment.NewLine;
txtOrder.Text += "Name: " + txtName.Text + Environment.NewLine;
txtOrder.Text += "Address: " + txtAddress.Text + Environment.NewLine;
txtOrder.Text += "Cell: " + txtCell.Text + Environment.NewLine;
txtOrder.Text += "Telephone: " + txtTelephone.Text + Environment.NewLine;
txtOrder.Text += "Email: " + txtEmail.Text + Environment.NewLine;
txtOrder.Text += Environment.NewLine + "Pizza info:" + Environment.NewLine;
if (rbSmall.Checked)
{
txtOrder.Text += "Small size" + Environment.NewLine;
total += 10;
}
if (rbMedium.Checked)
{
txtOrder.Text += "Medium size" + Environment.NewLine;
total += 15;
}
if (rbLarge.Checked)
{
txtOrder.Text += "Medium size" + Environment.NewLine;
total += 20;
}
if (rbVegetarian.Checked)
{
txtOrder.Text += "Vegetarian type" + Environment.NewLine;
total += 5;
}
if (rbHawaiian.Checked)
{
txtOrder.Text += "Hawaiian type" + Environment.NewLine;
total += 10;
}
if (rbMeaty.Checked)
{
txtOrder.Text += "Meaty type" + Environment.NewLine;
total += 20;
}
txtOrder.Text += Environment.NewLine + "Beverages info:" + Environment.NewLine;
if (cbWings.Checked)
{
txtOrder.Text += "Wings" + Environment.NewLine;
total += int.Parse(txtQuantityWings.Text) * 5.99;
}
if (cbMiniLoaves.Checked)
{
txtOrder.Text += "Mini-Loaves" + Environment.NewLine;
total += int.Parse(txtQuantityMiniLoaves.Text) * 6.99;
}
if (cbChickenStrips.Checked)
{
txtOrder.Text += "Chicken Strips" + Environment.NewLine;
total += int.Parse(txtQuantityChickenStrips.Text) * 7.99;
}
if (cbSoda.Checked)
{
txtOrder.Text += "Soda" + Environment.NewLine;
total += int.Parse(txtQuantitySoda.Text) * 1.99;
}
if (cbWater.Checked)
{
txtOrder.Text += "Water" + Environment.NewLine;
total += int.Parse(txtQuantityWater.Text) * 0.99;
}
txtOrder.Text += Environment.NewLine + "The price for the order: " + total.ToString("N2") + Environment.NewLine;
}
private void btnReset_Click(object sender, EventArgs e)
{
txtName.Text = "";
txtAddress.Text = "";
txtCell.Text = "";
txtTelephone.Text = "";
txtEmail.Text = "";
rbSmall.Checked = true;
rbVegetarian.Checked = true;
cbWings.Checked = false;
cbMiniLoaves.Checked = false;
cbChickenStrips.Checked = false;
cbSoda.Checked = false;
cbWater.Checked = false;
txtQuantityWings.Text = "";
txtQuantityMiniLoaves.Text = "";
txtQuantityChickenStrips.Text = "";
txtQuantitySoda.Text = "";
txtQuantityWater.Text = "";
txtOrder.Text = "";
}
private void brnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
namespace PizzaDeliveryCompany
{
partial class frmPizzaDeliveryCompany
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnCalculate = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtAddress = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rbSmall = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtCell = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.txtTelephone = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtEmail = new System.Windows.Forms.TextBox();
this.txtOrder = new System.Windows.Forms.TextBox();
this.pictureBoxLogo = new System.Windows.Forms.PictureBox();
this.label6 = new System.Windows.Forms.Label();
this.rbMedium = new System.Windows.Forms.RadioButton();
this.rbLarge = new System.Windows.Forms.RadioButton();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.rbMeaty = new System.Windows.Forms.RadioButton();
this.rbHawaiian = new System.Windows.Forms.RadioButton();
this.rbVegetarian = new System.Windows.Forms.RadioButton();
this.btnReset = new System.Windows.Forms.Button();
this.brnExit = new System.Windows.Forms.Button();
this.txtQuantityWings = new System.Windows.Forms.TextBox();
this.txtQuantityMiniLoaves = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.cbWings = new System.Windows.Forms.CheckBox();
this.cbMiniLoaves = new System.Windows.Forms.CheckBox();
this.txtQuantityChickenStrips = new System.Windows.Forms.TextBox();
this.cbChickenStrips = new System.Windows.Forms.CheckBox();
this.txtQuantitySoda = new System.Windows.Forms.TextBox();
this.cbSoda = new System.Windows.Forms.CheckBox();
this.txtQuantityWater = new System.Windows.Forms.TextBox();
this.cbWater = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxLogo)).BeginInit();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// btnCalculate
//
this.btnCalculate.Location = new System.Drawing.Point(532, 270);
this.btnCalculate.Name = "btnCalculate";
this.btnCalculate.Size = new System.Drawing.Size(172, 44);
this.btnCalculate.TabIndex = 0;
this.btnCalculate.Text = "Calculate the price for the order";
this.btnCalculate.UseVisualStyleBackColor = true;
this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(15, 58);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Address:";
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(84, 55);
this.txtAddress.Name = "txtAddress";
this.txtAddress.Size = new System.Drawing.Size(146, 20);
this.txtAddress.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.rbLarge);
this.groupBox1.Controls.Add(this.rbMedium);
this.groupBox1.Controls.Add(this.rbSmall);
this.groupBox1.Location = new System.Drawing.Point(329, 90);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 56);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Select size";
//
// rbSmall
//
this.rbSmall.AutoSize = true;
this.rbSmall.Checked = true;
this.rbSmall.Location = new System.Drawing.Point(19, 23);
this.rbSmall.Name = "rbSmall";
this.rbSmall.Size = new System.Drawing.Size(50, 17);
this.rbSmall.TabIndex = 0;
this.rbSmall.TabStop = true;
this.rbSmall.Text = "Small";
this.rbSmall.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.txtName);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.txtEmail);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.txtTelephone);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.txtCell);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.txtAddress);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Location = new System.Drawing.Point(33, 90);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(279, 174);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Enter the user contact information";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(15, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Name:";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(84, 29);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(146, 20);
this.txtName.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(15, 84);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(27, 13);
this.label3.TabIndex = 1;
this.label3.Text = "Cell:";
//
// txtCell
//
this.txtCell.Location = new System.Drawing.Point(84, 81);
this.txtCell.Name = "txtCell";
this.txtCell.Size = new System.Drawing.Size(146, 20);
this.txtCell.TabIndex = 2;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(15, 110);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(61, 13);
this.label4.TabIndex = 1;
this.label4.Text = "Telephone:";
//
// txtTelephone
//
this.txtTelephone.Location = new System.Drawing.Point(84, 107);
this.txtTelephone.Name = "txtTelephone";
this.txtTelephone.Size = new System.Drawing.Size(146, 20);
this.txtTelephone.TabIndex = 2;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(15, 136);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(37, 13);
this.label5.TabIndex = 1;
this.label5.Text = "e-mail:";
//
// txtEmail
//
this.txtEmail.Location = new System.Drawing.Point(84, 133);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(146, 20);
this.txtEmail.TabIndex = 2;
//
// txtOrder
//
this.txtOrder.BackColor = System.Drawing.Color.White;
this.txtOrder.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.txtOrder.Location = new System.Drawing.Point(33, 328);
this.txtOrder.Multiline = true;
this.txtOrder.Name = "txtOrder";
this.txtOrder.ReadOnly = true;
this.txtOrder.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtOrder.Size = new System.Drawing.Size(849, 145);
this.txtOrder.TabIndex = 2;
//
// pictureBoxLogo
//
this.pictureBoxLogo.BackgroundImage = global::PizzaDeliveryCompany.Properties.Resources._95_954254_pizza_chef_italian_cuisine_pizza_chef_logo_png;
this.pictureBoxLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBoxLogo.Location = new System.Drawing.Point(737, 90);
this.pictureBoxLogo.Name = "pictureBoxLogo";
this.pictureBoxLogo.Size = new System.Drawing.Size(145, 174);
this.pictureBoxLogo.TabIndex = 4;
this.pictureBoxLogo.TabStop = false;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label6.ForeColor = System.Drawing.Color.Red;
this.label6.Location = new System.Drawing.Point(104, 9);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(727, 73);
this.label6.TabIndex = 5;
this.label6.Text = "Pizza delivery company";
//
// rbMedium
//
this.rbMedium.AutoSize = true;
this.rbMedium.Location = new System.Drawing.Point(75, 24);
this.rbMedium.Name = "rbMedium";
this.rbMedium.Size = new System.Drawing.Size(62, 17);
this.rbMedium.TabIndex = 0;
this.rbMedium.Text = "Medium";
this.rbMedium.UseVisualStyleBackColor = true;
//
// rbLarge
//
this.rbLarge.AutoSize = true;
this.rbLarge.Location = new System.Drawing.Point(143, 24);
this.rbLarge.Name = "rbLarge";
this.rbLarge.Size = new System.Drawing.Size(52, 17);
this.rbLarge.TabIndex = 0;
this.rbLarge.Text = "Large";
this.rbLarge.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.rbMeaty);
this.groupBox3.Controls.Add(this.rbHawaiian);
this.groupBox3.Controls.Add(this.rbVegetarian);
this.groupBox3.Location = new System.Drawing.Point(329, 152);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(200, 112);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Select type";
//
// rbMeaty
//
this.rbMeaty.AutoSize = true;
this.rbMeaty.Location = new System.Drawing.Point(19, 76);
this.rbMeaty.Name = "rbMeaty";
this.rbMeaty.Size = new System.Drawing.Size(54, 17);
this.rbMeaty.TabIndex = 0;
this.rbMeaty.Text = "Meaty";
this.rbMeaty.UseVisualStyleBackColor = true;
//
// rbHawaiian
//
this.rbHawaiian.AutoSize = true;
this.rbHawaiian.Location = new System.Drawing.Point(19, 53);
this.rbHawaiian.Name = "rbHawaiian";
this.rbHawaiian.Size = new System.Drawing.Size(69, 17);
this.rbHawaiian.TabIndex = 0;
this.rbHawaiian.Text = "Hawaiian";
this.rbHawaiian.UseVisualStyleBackColor = true;
//
// rbVegetarian
//
this.rbVegetarian.AutoSize = true;
this.rbVegetarian.Checked = true;
this.rbVegetarian.Location = new System.Drawing.Point(19, 30);
this.rbVegetarian.Name = "rbVegetarian";
this.rbVegetarian.Size = new System.Drawing.Size(76, 17);
this.rbVegetarian.TabIndex = 0;
this.rbVegetarian.TabStop = true;
this.rbVegetarian.Text = "Vegetarian";
this.rbVegetarian.UseVisualStyleBackColor = true;
//
// btnReset
//
this.btnReset.Location = new System.Drawing.Point(33, 270);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(172, 44);
this.btnReset.TabIndex = 0;
this.btnReset.Text = "Reset the order form";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// brnExit
//
this.brnExit.Location = new System.Drawing.Point(710, 270);
this.brnExit.Name = "brnExit";
this.brnExit.Size = new System.Drawing.Size(172, 44);
this.brnExit.TabIndex = 0;
this.brnExit.Text = "Exit";
this.brnExit.UseVisualStyleBackColor = true;
this.brnExit.Click += new System.EventHandler(this.brnExit_Click);
//
// txtQuantityWings
//
this.txtQuantityWings.Location = new System.Drawing.Point(644, 120);
this.txtQuantityWings.Name = "txtQuantityWings";
this.txtQuantityWings.Size = new System.Drawing.Size(69, 20);
this.txtQuantityWings.TabIndex = 2;
//
// txtQuantityMiniLoaves
//
this.txtQuantityMiniLoaves.Location = new System.Drawing.Point(644, 146);
this.txtQuantityMiniLoaves.Name = "txtQuantityMiniLoaves";
this.txtQuantityMiniLoaves.Size = new System.Drawing.Size(69, 20);
this.txtQuantityMiniLoaves.TabIndex = 2;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(641, 101);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(46, 13);
this.label9.TabIndex = 1;
this.label9.Text = "Quantity";
//
// cbWings
//
this.cbWings.AutoSize = true;
this.cbWings.Location = new System.Drawing.Point(546, 122);
this.cbWings.Name = "cbWings";
this.cbWings.Size = new System.Drawing.Size(59, 17);
this.cbWings.TabIndex = 6;
this.cbWings.Text = "Wings:";
this.cbWings.UseVisualStyleBackColor = true;
//
// cbMiniLoaves
//
this.cbMiniLoaves.AutoSize = true;
this.cbMiniLoaves.Location = new System.Drawing.Point(546, 149);
this.cbMiniLoaves.Name = "cbMiniLoaves";
this.cbMiniLoaves.Size = new System.Drawing.Size(79, 17);
this.cbMiniLoaves.TabIndex = 6;
this.cbMiniLoaves.Text = "Mini-loaves";
this.cbMiniLoaves.UseVisualStyleBackColor = true;
//
// txtQuantityChickenStrips
//
this.txtQuantityChickenStrips.Location = new System.Drawing.Point(644, 172);
this.txtQuantityChickenStrips.Name = "txtQuantityChickenStrips";
this.txtQuantityChickenStrips.Size = new System.Drawing.Size(69, 20);
this.txtQuantityChickenStrips.TabIndex = 2;
//
// cbChickenStrips
//
this.cbChickenStrips.AutoSize = true;
this.cbChickenStrips.Location = new System.Drawing.Point(546, 175);
this.cbChickenStrips.Name = "cbChickenStrips";
this.cbChickenStrips.Size = new System.Drawing.Size(92, 17);
this.cbChickenStrips.TabIndex = 6;
this.cbChickenStrips.Text = "Chicken strips";
this.cbChickenStrips.UseVisualStyleBackColor = true;
//
// txtQuantitySoda
//
this.txtQuantitySoda.Location = new System.Drawing.Point(644, 198);
this.txtQuantitySoda.Name = "txtQuantitySoda";
this.txtQuantitySoda.Size = new System.Drawing.Size(69, 20);
this.txtQuantitySoda.TabIndex = 2;
//
// cbSoda
//
this.cbSoda.AutoSize = true;
this.cbSoda.Location = new System.Drawing.Point(546, 201);
this.cbSoda.Name = "cbSoda";
this.cbSoda.Size = new System.Drawing.Size(51, 17);
this.cbSoda.TabIndex = 6;
this.cbSoda.Text = "Soda";
this.cbSoda.UseVisualStyleBackColor = true;
//
// txtQuantityWater
//
this.txtQuantityWater.Location = new System.Drawing.Point(644, 224);
this.txtQuantityWater.Name = "txtQuantityWater";
this.txtQuantityWater.Size = new System.Drawing.Size(69, 20);
this.txtQuantityWater.TabIndex = 2;
//
// cbWater
//
this.cbWater.AutoSize = true;
this.cbWater.Location = new System.Drawing.Point(546, 227);
this.cbWater.Name = "cbWater";
this.cbWater.Size = new System.Drawing.Size(55, 17);
this.cbWater.TabIndex = 6;
this.cbWater.Text = "Water";
this.cbWater.UseVisualStyleBackColor = true;
//
// frmPizzaDeliveryCompany
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(908, 485);
this.Controls.Add(this.cbWater);
this.Controls.Add(this.cbSoda);
this.Controls.Add(this.cbChickenStrips);
this.Controls.Add(this.cbMiniLoaves);
this.Controls.Add(this.cbWings);
this.Controls.Add(this.txtQuantityWater);
this.Controls.Add(this.txtQuantitySoda);
this.Controls.Add(this.txtQuantityChickenStrips);
this.Controls.Add(this.txtQuantityMiniLoaves);
this.Controls.Add(this.txtQuantityWings);
this.Controls.Add(this.label9);
this.Controls.Add(this.label6);
this.Controls.Add(this.pictureBoxLogo);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.brnExit);
this.Controls.Add(this.btnReset);
this.Controls.Add(this.btnCalculate);
this.Controls.Add(this.txtOrder);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmPizzaDeliveryCompany";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Pizza delivery company";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxLogo)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
}
}
Comments
Leave a comment