Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Created by SharpDevelop.
- * User: mega
- * Date: 16.4.2018 г.
- * Time: 17:02
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Windows.Forms;
- namespace gsfgfgs
- {
- /// <summary>
- /// Description of MainForm.
- /// </summary>
- public partial class MainForm : Form
- {
- public MainForm()
- {
- //
- // The InitializeComponent() call is required for Windows Forms designer support.
- //
- InitializeComponent();
- //
- // TODO: Add constructor code after the InitializeComponent() call.
- //
- }
- void CheckBox1CheckedChanged(object sender, EventArgs e)
- {
- textBox1.Enabled=true;
- if(checkBox1.Checked==false)
- {
- textBox1.Enabled=false;
- textBox1.Text=" ";
- }
- }
- void CheckBox2CheckedChanged(object sender, EventArgs e)
- {
- textBox2.Enabled=true;
- if(checkBox2.Checked==false)
- {
- textBox2.Enabled=false;
- textBox2.Text=" ";
- }
- }
- void Button2Click(object sender, EventArgs e)
- {
- int a,b;
- double pricea,priceb;
- pricea=0;
- priceb=0;
- string result = "Поръчка - ";
- if(radioButton1.Checked==true)
- {
- result += radioButton1.Text + ":\n";
- if(checkBox1.Checked)
- {
- a=Convert.ToInt32(textBox1.Text);
- result += checkBox1.Text + ": " + a.ToString() + " бр." + "\n";
- if(a>1 && a<50)
- {
- pricea=a*1.6;
- }
- else if(a>51&& a<100)
- {
- pricea=a*0.75;
- }
- else if(a>100)
- {
- pricea=a*0.55;
- }
- }
- if(checkBox2.Checked==true)
- {
- b=Convert.ToInt32(textBox2.Text);
- result += checkBox2.Text + ": " + b.ToString() + " бр.";
- if(b>1 && b<=50)
- {
- pricea=b*0.24;
- }
- else if(b>=51 && b<=100)
- {
- pricea=b*0.12;
- }
- else if(b>100)
- {
- pricea=b*0.10;
- }
- }
- label4.Text=result;
- label5.Text=String.Format("{0:0.00} лв.", pricea+priceb);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement