-
Notifications
You must be signed in to change notification settings - Fork 2
/
Organization.aspx.cs
63 lines (59 loc) · 1.89 KB
/
Organization.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
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace Serving_Hands
{
public partial class Organization1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetCategoriesId();
}
}
Models.ClearTextBox tx = new Models.ClearTextBox();
Organization or = new Organization();
protected void Button1_Click(object sender, EventArgs e)
{
or.Name = TextBox1.Text;
or.requirement = TextBox2.Text;
or.Add(or);
tx.ClearTextbox(TextBox1,TextBox2);
}
protected void Button2_Click(object sender, EventArgs e)
{
or.oid = Convert.ToInt32(DropDownList1.Text);
or.Delete(or);
tx.ClearTextbox(TextBox1, TextBox2);
}
private void GetCategoriesId()
{
DropDownList1.Items.Clear();
foreach (var item in or.GetIds())
{
DropDownList1.Items.Add(Convert.ToString(item.oid));
}
}
protected void Button3_Click(object sender, EventArgs e)
{
or.oid = Convert.ToInt32(DropDownList1.Text);
or.Name = TextBox1.Text;
or.requirement = TextBox2.Text;
or.Update(or);
tx.ClearTextbox(TextBox1, TextBox2);
}
protected void Button4_Click(object sender, EventArgs e)
{
Organization org = new Organization();
org.oid = Convert.ToInt32(DropDownList1.Text);
org.Search(org);
TextBox1.Text = org.Name;
TextBox2.Text = org.requirement;
}
}
}