Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. /*
  2. * Created by SharpDevelop.
  3. * User: mega
  4. * Date: 16.4.2018 г.
  5. * Time: 17:02
  6. *
  7. * To change this template use Tools | Options | Coding | Edit Standard Headers.
  8. */
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Drawing;
  12. using System.Windows.Forms;
  13.  
  14. namespace gsfgfgs
  15. {
  16. /// <summary>
  17. /// Description of MainForm.
  18. /// </summary>
  19. public partial class MainForm : Form
  20. {
  21. public MainForm()
  22. {
  23. //
  24. // The InitializeComponent() call is required for Windows Forms designer support.
  25. //
  26. InitializeComponent();
  27.  
  28. //
  29. // TODO: Add constructor code after the InitializeComponent() call.
  30. //
  31. }
  32. void CheckBox1CheckedChanged(object sender, EventArgs e)
  33. {
  34. textBox1.Enabled=true;
  35.  
  36. if(checkBox1.Checked==false)
  37. {
  38. textBox1.Enabled=false;
  39. textBox1.Text=" ";
  40. }
  41. }
  42.  
  43.  
  44. void CheckBox2CheckedChanged(object sender, EventArgs e)
  45. {
  46. textBox2.Enabled=true;
  47.  
  48. if(checkBox2.Checked==false)
  49. {
  50. textBox2.Enabled=false;
  51. textBox2.Text=" ";
  52.  
  53. }
  54. }
  55. void Button2Click(object sender, EventArgs e)
  56. {
  57. int a,b;
  58.  
  59.  
  60. double pricea,priceb;
  61. pricea=0;
  62. priceb=0;
  63. string result = "Поръчка - ";
  64. if(radioButton1.Checked==true)
  65. {
  66. result += radioButton1.Text + ":\n";
  67.  
  68.  
  69.  
  70.  
  71. if(checkBox1.Checked)
  72. {
  73.  
  74. a=Convert.ToInt32(textBox1.Text);
  75.  
  76. result += checkBox1.Text + ": " + a.ToString() + " бр." + "\n";
  77. if(a>1 && a<50)
  78. {
  79. pricea=a*1.6;
  80. }
  81.  
  82. else if(a>51&& a<100)
  83. {
  84. pricea=a*0.75;
  85. }
  86.  
  87. else if(a>100)
  88. {
  89. pricea=a*0.55;
  90. }
  91.  
  92.  
  93.  
  94.  
  95. }
  96. if(checkBox2.Checked==true)
  97. {
  98.  
  99. b=Convert.ToInt32(textBox2.Text);
  100.  
  101. result += checkBox2.Text + ": " + b.ToString() + " бр.";
  102.  
  103.  
  104. if(b>1 && b<=50)
  105. {
  106. pricea=b*0.24;
  107. }
  108.  
  109. else if(b>=51 && b<=100)
  110. {
  111. pricea=b*0.12;
  112. }
  113.  
  114. else if(b>100)
  115. {
  116. pricea=b*0.10;
  117. }
  118. }
  119.  
  120. label4.Text=result;
  121. label5.Text=String.Format("{0:0.00} лв.", pricea+priceb);
  122.  
  123.  
  124.  
  125.  
  126.  
  127. }
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement