-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddfees.aspx.cs
68 lines (61 loc) · 2.11 KB
/
Addfees.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
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class admin_Addfees : System.Web.UI.Page
{
BAL b = new BAL();
BLL bl = new BLL();
protected void Page_Init(object sender, EventArgs e)
{
ddlfeetype.DataSource = bl.callfeetype();
ddlfeetype.DataTextField = "fee_type";
ddlfeetype.DataValueField = "ftid";
ddlfeetype.DataBind();
ddlfeetype.Items.Insert(0, "Select Fee type");
}
protected void Page_Load(object sender, EventArgs e)
{
if(Session["master"] == null || Session["role"].ToString() != "admin")
{
Response.Write("<script>alert('Access Denied'); window.location.href = 'Signin.aspx'</script>");
}
else { };
}
protected void submitclass_Click(object sender, EventArgs e)
{
}
protected void submitfeetype_Click(object sender, EventArgs e)
{
b.fee_type = Txtfeety.Text;
b.fee_type_amount = int.Parse(txtfeeamont.Text);
bl.insfeetype(b);
Response.Write("<script>alert('New fees type Added'); window.location.href = 'Addfees.aspx'</script>");
}
protected void ddlfeetype_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlfeetype.SelectedIndex != 0 && this.IsPostBack)
{
b.ftid = Convert.ToInt32(ddlfeetype.SelectedValue);
bl.callfeetypeamt(b);
lblamt.Text = b.fee_type_amount.ToString();
}
else { }
}
protected void btnupdfee_Click(object sender, EventArgs e)
{
if(txtamt.Text!=null)
{
b.fee_type_amount = int.Parse(txtamt.Text);
b.ftid = Convert.ToInt32(ddlfeetype.SelectedValue);
bl.updfeetypeamt(b);
Response.Write("<script>alert('fees type Updated'); window.location.href = 'Addfees.aspx'</script>"); //
}
else
{
Response.Write("<script>alert('Please Enter Fee Amount')</script>");
}
}
}