-
Notifications
You must be signed in to change notification settings - Fork 0
/
Default.aspx.cs
54 lines (51 loc) · 1.81 KB
/
Default.aspx.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.AutoPostBack = true;
CheckBox1.AutoPostBack = true;
CheckBox2.AutoPostBack = true;
CheckBox3.AutoPostBack = true;
TextBox1.Text = "100000";
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked)
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
else
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
CheckBox1.Checked = false;
CheckBox2.Checked = false;
CheckBox3.Checked = false;
}
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox2.Checked)
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
else
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
}
protected void CheckBox3_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox3.Checked)
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
else
TextBox1.Text = (int.Parse(TextBox1.Text) + 2000).ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Convert.ToInt32(TextBox1.Text) > 100000)
Label1.Text = "%5 indirimli fiyatı" + (int.Parse(TextBox1.Text) * 0.95).ToString();
if (Convert.ToInt32(TextBox1.Text) < 100000)
Label1.Text = "%3 indirimli fiyatı" + (int.Parse(TextBox1.Text) * 0.97).ToString();
}
}