-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
93 lines (78 loc) · 2.96 KB
/
Copy pathForm1.cs
File metadata and controls
93 lines (78 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace ProblemStateCounter
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
label1.Visible = false;
label2.Visible = false;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string input = textBox1.Text;
if(input.Length < 45 || string.IsNullOrEmpty(input))
{
label1.Visible = true;
label1.ForeColor = Color.Red;
label1.BackColor = Color.White;
label1.Text = "مقدار ورودی اشتباه می باشد";
}
else
{
List<string> termsList = new List<string>();
if (int.Parse(input.Substring(0, 5)) != 0 || int.Parse(input.Substring(27, 7)) != 0)
{
//techProblems = "آلایندگی" + " | ";
termsList.Add("آلایندگی");
}
if (int.Parse(input.Substring(5, 9)) != 0 || int.Parse(input.Substring(20, 2)) != 0)
{
//techProblems += "ترمز" + " | ";
termsList.Add("ترمز");
}
if (int.Parse(input.Substring(14, 6)) != 0)
{
//techProblems += "کمک فنر" + " | ";
termsList.Add("کمک فنر");
}
if (int.Parse(input.Substring(22, 2)) != 0)
{
//techProblems += "لغزش جانبی" + " | ";
termsList.Add("لغزش جانبی");
}
if (int.Parse(input.Substring(35, 7)) != 0 || int.Parse(input.Substring(43, 3)) != 0)
{
//techProblems += "ظاهری به جز صوت" + " | ";
termsList.Add("ظاهری به جز صوت");
}
if (int.Parse(input.Substring(42, 1)) != 0)
{
//techProblems += "فقط صوت " + " | ";
termsList.Add("فقط صوت");
}
label2.Visible = true;
label2.Font = new Font("SansSerif", 24, FontStyle.Bold);
label2.ForeColor = Color.Green;
label2.BackColor = Color.White;
label2.Text = termsList.Count().ToString();
label1.Visible= true;
label1.Font = new Font("IRANSans", 20, FontStyle.Bold);
label1.Text = string.Join(" / ", termsList);
}
}
}
}