-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegistrationfee.aspx.cs
149 lines (121 loc) · 4.64 KB
/
Registrationfee.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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_Registrationfee : System.Web.UI.Page
{
BLL b = new BLL();
BAL bl = new BAL();
protected void Page_Init(Object sender, EventArgs e)
{
DropDownList1.DataSource = b.selstuforfee();
DropDownList1.DataTextField = "stuname";
DropDownList1.DataValueField = "stuid";
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "please select student");
}
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 DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
CheckBoxList1.Visible = true;
CheckBoxList1.DataSource = b.callfeetype();
CheckBoxList1.DataTextField = "fee_type";
CheckBoxList1.DataValueField = "ftid";
CheckBoxList1.DataBind();
}
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
//foreach (ListItem li in CheckBoxList1.Items)
//{
// if(li.Selected)
// {
// bl.fee_month = DateTime.Now.ToString("MMM");
// bl.ftid = int.Parse(CheckBoxList1.SelectedValue);
// bl.stuid = int.Parse(DropDownList1.SelectedValue);
// b.insregfee(bl);
// Response.Write("<script>alert('Registration Successfull')</script>");
// }
//}
//if (CheckBoxList1.SelectedValue == "2")
//{
// Label1.Visible = true;
// DropDownList2.Visible = true;
//}
//else
//{
// Label1.Visible = true;
// DropDownList2.Visible = true;
//}
}
//static int sta;
protected void Savefees_Click(object sender, EventArgs e)
{
b.getchallansta();
//sta = BAL.fcn;
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
bl.fee_month = DateTime.Now.ToString("MMM");
bl.ftid = int.Parse(li.Value);
bl.stuid = int.Parse(DropDownList1.SelectedValue);
bl.fee_challan_No = BAL.fcn ;
b.insregfee(bl);
Response.Write("<script>alert('Fee Voucher Recorder'); window.location.href = 'Registrationfee.aspx'</script>");
}
else{ }
}
//using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
//{
// cmd.CommandText = "sp_registrationfee_admissionstatusupd";
// cmd.CommandType = System.Data.CommandType.StoredProcedure;
// DAL d = new DAL();
// cmd.Connection = d.con;
// d.con.Open();
// foreach (ListItem li in CheckBoxList1.Items)
// {
// cmd.Parameters.AddWithValue("@fm", DateTime.Now.ToString("MMM"));
// cmd.Parameters.AddWithValue("@ftd", int.Parse(li.Value));
// cmd.Parameters.AddWithValue("@std", int.Parse(DropDownList1.SelectedValue));
// cmd.ExecuteNonQuery();
// cmd.Parameters.Clear();
// }
// d.con.Close();
// Response.Write("<script>alert('Registration Successfull')</script>");
//}
//foreach (ListItem li in CheckBoxList1.Items)
//{
// List<BAL> l = new List<BAL>();
// bl.fee_month = DateTime.Now.ToString("MMM");
// bl.ftid = int.Parse(li.Value);
// bl.stuid = int.Parse(DropDownList1.SelectedValue);
// l.Add(bl);
// b.insregfee(l);
//}
//Response.Write("<script>alert('Registration Successfull')</script>");
}
protected void btnchallan_Click(object sender, EventArgs e)
{
bl.fee_challan_No = int.Parse(txtchallan.Text);
GridView1.DataSource= b.getfeechallan(bl);
GridView1.DataBind();
GridView1.EmptyDataText = "No record Found";
//foreach(ListItem lv in bl.abc)
//{
//}
ListBox1.DataSource = bl.abc;
//ListBox1.DataTextField = "abc";
//ListBox1.DataValueField = "abc";
ListBox1.DataBind();
//ListBox1.DataBind();
}
}