protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TextBox1.Enabled = true; TextBox2.Enabled = true; TextBox3.Enabled = true; TextBox4.Enabled = true; dbconnect db19 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_account where account_id=@aid"; cmd5.Parameters.AddWithValue("@aid", DropDownList1.SelectedValue); SqlDataReader dr1 = db19.executeread(cmd5); dr1.Read(); TextBox1.Text = dr1.GetString(1); TextBox2.Text = dr1.GetString(3); TextBox3.Text = dr1.GetString(4); TextBox4.Text = dr1.GetString(5); string des = dr1.GetString(2); string d = "HOD"; if (des == d) { RadioButtonList1.Items[1].Selected = true; } else { RadioButtonList1.Items[0].Selected = true; } }
protected void Page_Load(object sender, EventArgs e) { string a = Request.QueryString["id"]; TextBox1.Text = a; dbconnect db2 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select * from admission where adm_no=@adm_no"; cmd2.Parameters.AddWithValue("@adm_no", a); SqlDataReader dr1 = db2.executeread(cmd2); dr1.Read(); TextBox2.Text = dr1.GetString(2); TextBox3.Text = dr1.GetInt32(1).ToString(); db2.execute(cmd2); if (!IsPostBack) { dbconnect db4 = new dbconnect(); SqlCommand cmd4 = new SqlCommand(); cmd4.CommandText = "select div from division where class=@class"; cmd4.Parameters.AddWithValue("@class", TextBox3.Text); SqlDataReader dr2 = db4.executeread(cmd4); while (dr2.Read()) { DropDownList1.Items.Add(dr2.GetString(0)); } db4.execute(cmd4); } }
protected void Page_Load(object sender, EventArgs e) { String s = Convert.ToString(Session["us"]); dbconnect db21 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_account where account_id=@cid"; cmd5.Parameters.AddWithValue("@cid", s); SqlDataReader dr11 = db21.executeread(cmd5); dr11.Read(); TextBox5.Text = dr11.GetString(3); if (!IsPostBack) { dbconnect db1 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select branch_id from tbl_course"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { DropDownList4.Items.Add(dr1.GetString(0)); } } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db2 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select * from division where div_id=@id"; cmd2.Parameters.AddWithValue("@id", DropDownList1.SelectedValue); SqlDataReader dr1 = db2.executeread(cmd2); dr1.Read(); TextBox1.Text = dr1.GetInt32(1).ToString(); TextBox2.Text = dr1.GetString(2); TextBox3.Text = dr1.GetString(3); TextBox5.Text = dr1.GetDateTime(4).ToShortDateString(); dbconnect db3 = new dbconnect(); SqlCommand cmd3 = new SqlCommand(); cmd3.CommandText = "select name from faculty where staff_id=@id"; cmd3.Parameters.AddWithValue("@id", TextBox3.Text); SqlDataReader dr2 = db3.executeread(cmd3); dr2.Read(); TextBox4.Text = dr2.GetString(0); //TextBox5.Text = dr.GetDateTime(4); db3.execute(cmd3); }
protected void Page_Load(object sender, EventArgs e) { string a = Request.QueryString["id"]; TextBox5.Text = a; dbconnect db2 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select gallery_no from key_gen"; SqlDataReader dr = db2.executeread(cmd1); dr.Read(); int x = dr.GetInt32(0); x++; string galno = "G_" + x.ToString(); TextBox1.Text = galno; dbconnect db3 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "update key_gen set gallery_no=@x"; cmd2.Parameters.AddWithValue("@x", x); db3.execute(cmd2); }
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { TextBox3.Enabled = false; dbconnect db3 = new dbconnect(); SqlCommand cmd3 = new SqlCommand(); cmd3.CommandText = "select subject from tbl_sem where sub_code=@code"; cmd3.Parameters.AddWithValue("@code", DropDownList2.SelectedValue); SqlDataReader dr10 = db3.executeread(cmd3); dr10.Read(); TextBox3.Text = dr10.GetString(0); String d = TextBox5.Text; dbconnect db4 = new dbconnect(); SqlCommand cmd4 = new SqlCommand(); cmd4.CommandText = "select * from tbl_account where dept_id=@id"; cmd4.Parameters.AddWithValue("@id", d); SqlDataReader dr14 = db4.executeread(cmd4); while (dr14.Read()) { DropDownList3.Items.Add(dr14.GetString(0)); } }
/* protected void Button2_Click(object sender, EventArgs e) * { * //FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName)); * dbconnect db4 = new dbconnect(); * SqlCommand cmd1 = new SqlCommand(); * * cmd1.CommandText = "insert into admission values(@adm_no,@class,@name,@photo,@aadhar,@dob,@mother,@religion,@nation,@state,@medium,@prev_school,@tc)"; * cmd1.Parameters.AddWithValue("@adm_no", ""); * cmd1.Parameters.AddWithValue("@class",Label2.Text); * cmd1.Parameters.AddWithValue("@name", TextBox2.Text); * // cmd1.Parameters.AddWithValue("@photo", "~/photos/" + FileUpload1.FileName); * cmd1.Parameters.AddWithValue("@aadhar",TextBox3.Text); * cmd1.Parameters.AddWithValue("@religion",TextBox13.Text); * cmd1.Parameters.AddWithValue("@nation",TextBox14.Text); * cmd1.Parameters.AddWithValue("@state",TextBox15.Text); * cmd1.Parameters.AddWithValue("@medium",TextBox18.Text); * cmd1.Parameters.AddWithValue("@prev_school",TextBox16.Text); * cmd1.Parameters.AddWithValue("@tc",TextBox17.Text); * db4.execute(cmd1); * }*/ /* protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) * { * * dbconnect db4 = new dbconnect(); * SqlCommand cmd4 = new SqlCommand(); * cmd4.CommandText = "select div from division where class=@class"; * cmd4.Parameters.AddWithValue("@class", DropDownList1.SelectedValue); * SqlDataReader dr2 = db4.executeread(cmd4); * while (dr2.Read()) * { * DropDownList2.Items.Add(dr2.GetString(0)); * } * db4.execute(cmd4); * }*/ protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { /* dbconnect db4 = new dbconnect(); * SqlCommand cmd4 = new SqlCommand(); * cmd4.CommandText = "select div_id from division where class=@class and div=@division"; * cmd4.Parameters.AddWithValue("@class", DropDownList1.SelectedValue); * cmd4.Parameters.AddWithValue("@division",DropDownList2.SelectedValue); * SqlDataReader dr2 = db4.executeread(cmd4); * dr2.Read(); * TextBox12.Text = dr2.GetString(0); * db4.execute(cmd4); */ dbconnect db5 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select name from admission,div_allot where admission.adm_no=div_allot.adm_no and div_allot.div_id=@div_id"; cmd5.Parameters.AddWithValue("@div_id", TextBox12.Text); SqlDataReader dr3 = db5.executeread(cmd5); while (dr3.Read()) { DropDownList3.Items.Add(dr3.GetString(2)); } db5.execute(cmd5); }
protected void Button1_Click(object sender, EventArgs e) { dbconnect db6 = new dbconnect(); SqlCommand cmd6 = new SqlCommand(); cmd6.CommandText = "SELECT * from tbl_account where account_id=@acid"; cmd6.Parameters.AddWithValue("@acid", TextBox1.Text); SqlDataReader dr2 = db6.executeread(cmd6); if (dr2.HasRows) { Response.Write("<script>confirm('Account Id alredy exists')</script>"); //Server.Transfer("add_account.aspx"); Server.Transfer("adminhome.aspx"); } else { dbconnect db5 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "insert into tbl_account values(@aid,@name,@desig,@di,@em,@ph,@st,@ph)"; cmd1.Parameters.AddWithValue("@aid", TextBox1.Text); cmd1.Parameters.AddWithValue("@name", TextBox2.Text); cmd1.Parameters.AddWithValue("@desig", DropDownList1.SelectedValue); cmd1.Parameters.AddWithValue("di", Label8.Text); cmd1.Parameters.AddWithValue("@em", TextBox3.Text); cmd1.Parameters.AddWithValue("@ph", TextBox4.Text); cmd1.Parameters.AddWithValue("@st", "ok"); db5.execute(cmd1); Response.Write("<script>alert('Account Created')</script>"); Server.Transfer("adminhome.aspx"); //Response.Redirect("adminhome.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dbconnect db4 = new dbconnect(); SqlCommand cmd4 = new SqlCommand(); cmd4.CommandText = "select distinct class from division"; SqlDataReader dr2 = db4.executeread(cmd4); while (dr2.Read()) { DropDownList1.Items.Add(dr2.GetInt32(0).ToString()); } db4.execute(cmd4); } dbconnect db = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from admission where class=@class and status=@x"; cmd.Parameters.AddWithValue("@class", Convert.ToInt32(DropDownList1.SelectedItem.Text)); cmd.Parameters.AddWithValue("@x", "Notalloted"); SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dbconnect db4 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select fid from tbl_key"; SqlDataReader dr = db4.executeread(cmd1); dr.Read(); int x = dr.GetInt32(0); x++; string fid = "FED_" + x.ToString(); TextBox6.Text = fid; dbconnect db3 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "update tbl_key set fid=@x"; cmd2.Parameters.AddWithValue("@x", x); db3.execute(cmd2); Session["fid"] = TextBox6.Text; } dbconnect db6 = new dbconnect(); SqlCommand cmd4 = new SqlCommand(); cmd4.CommandText = "select distinct dept_id from tbl_dept"; SqlDataReader dr1 = db6.executeread(cmd4); while (dr1.Read()) { DropDownList4.Items.Add(dr1.GetString(0)); } }
protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e) { String x = RadioButtonList1.Text; FileUpload1.SaveAs(Server.MapPath("~/photos/" + FileUpload1.FileName)); fn = FileUpload1.FileName; if (x.Equals("Yes")) { MultiView1.ActiveViewIndex = 0; } else { MultiView1.ActiveViewIndex = 1; dbconnect db5 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select guard_no from key_gen"; SqlDataReader dr5 = db5.executeread(cmd5); dr5.Read(); xx = dr5.GetInt32(0); xx++; string did = "GUARD_" + xx.ToString(); TextBox14.Text = did; db5.execute(cmd5); } }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from tbl_login where userid=@ur and pass=@p"; cmd.Parameters.AddWithValue("@ur", textuser.Text); cmd.Parameters.AddWithValue("@p", textpass.Text); SqlDataReader dr = db.executeread(cmd); if (dr.Read()) { Session["us"] = textuser.Text; // Session["pw"] = textpass.Text; string type = dr.GetString(2); if (type == "Admin") { Response.Redirect("Admin/Admin_home.aspx"); } else if (type == "HOD") { Response.Redirect("HOD/HOD_home.aspx");; } else if (type == "Tutor") { Response.Redirect("tutor/tutor_home.aspx");; } } else { Label3.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String nm; nm = Convert.ToString(Session["us"]); dbconnect db33 = new dbconnect(); SqlCommand cmd11 = new SqlCommand(); cmd11.CommandText = "select dept_id from tbl_account where account_id=@id"; cmd11.Parameters.AddWithValue("@id", nm); SqlDataReader dr11 = db33.executeread(cmd11); dr11.Read(); TextBox1.Text = dr11.GetString(0); dbconnect db34 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_account where dept_id=@did"; cmd5.Parameters.AddWithValue("@did", TextBox1.Text); SqlDataReader dr1 = db34.executeread(cmd5); dr1.Read(); while (dr1.Read()) { DropDownList1.Items.Add(dr1.GetString(0)); } } }
protected void Page_Load(object sender, EventArgs e) { String did = Session["divid"].ToString(); dbconnect db = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select div_allotment.adm_no from div_allotment,admission where divid=@did and div_allotment.adm_no=admission.adm_no order by name"; cmd.Parameters.AddWithValue("@did", did); SqlDataReader dr2 = db.executeread(cmd); r = 1; while (dr2.Read()) { String adm = dr2.GetString(0); dbconnect db1 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "update div_allotment set roll_no=@rol where adm_no=@adm"; cmd1.Parameters.AddWithValue("@rol", r); cmd1.Parameters.AddWithValue("@adm", adm); r = r + 1; db1.execute(cmd1); } dbconnect db2 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select * from admission,div_allotment where admission.adm_no=div_allotment.adm_no"; SqlDataReader dr3 = db2.executeread(cmd2); DataList1.DataSource = dr3; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { String sub, tchr, f; int m, y; sub = Convert.ToString(Session["subject"]); tchr = Convert.ToString(Session["teacher"]); m = Convert.ToInt32(Session["month"]); y = Convert.ToInt32(Session["year"]); f = Convert.ToString(Session["code"]); Label1.Text = Convert.ToString(m); Label2.Text = Convert.ToString(y); Label8.Text = Convert.ToString(f); Label3.Text = sub; Label4.Text = tchr; if (!IsPostBack) { dbconnect db1 = new dbconnect(); dbconnect db2 = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from tbl_qstn where qno=" + i + ""; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select count(*) from tbl_qstn"; count = db2.id(cmd1); SqlDataReader dr = db1.executeread(cmd); while (dr.Read()) { Label5.Text = dr[0].ToString(); TextBox1.Text = dr[1].ToString(); } } }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from tbl_login where userid=@ur and pass=@p"; cmd.Parameters.AddWithValue("@ur", textuser.Text); cmd.Parameters.AddWithValue("@p", textpass.Text); SqlDataReader dr = db.executeread(cmd); SqlCommand cmd14 = new SqlCommand(); cmd14.CommandText = "select designation from tbl_account INNER JOIN tbl_login on account_id = userid"; SqlDataReader dr2 = db.executeread(cmd14); if (dr2.Read()) { string desig = dr2.GetString(0); TextBox1.Text = desig; } if (dr.Read()) { Session["us"] = textuser.Text; // Session["pw"] = textpass.Text; string type = dr.GetString(2); if (type == "Admin") { Response.Redirect("Admin/Admin_home.aspx"); } else if (type == "HOD") { Response.Redirect("HOD/HOD_home.aspx"); } else if (type == "Tutor") { Label4.Visible = true;; } } else { Label3.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { dbconnect db2 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select * from tbl_dept"; SqlDataReader dr = db2.executeread(cmd1); GridView1.DataSource = dr; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbconnect db = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select pic,caption from gallery order by date DESC"; SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbconnect db = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from faculty"; SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db5 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from faculty where name=@nm "; cmd5.Parameters.AddWithValue("@nm", DropDownList3.SelectedValue); SqlDataReader dr = db5.executeread(cmd5); dr.Read(); TextBox3.Text = dr.GetString(0); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db2 = new dbconnect(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select * from events where event_no=@no"; cmd2.Parameters.AddWithValue("@no", DropDownList1.SelectedValue); SqlDataReader dr1 = db2.executeread(cmd2); dr1.Read(); TextBox1.Text = dr1.GetString(1); }
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db8 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from stud_feedback where sub=@sub"; cmd5.Parameters.AddWithValue("@sub", DropDownList4.SelectedValue); SqlDataReader dr1 = db8.executeread(cmd5); dr1.Read(); TextBox1.Text = dr1.GetString(6); }
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db10 = new dbconnect(); SqlCommand cmd10 = new SqlCommand(); cmd10.CommandText = "select dept_id from tbl_dept where dept_name=@dname"; cmd10.Parameters.AddWithValue("@dname", DropDownList2.SelectedValue); SqlDataReader dr1 = db10.executeread(cmd10); dr1.Read(); Label8.Text = dr1.GetString(0); }
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db21 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_course where branch_id=@cid"; cmd5.Parameters.AddWithValue("@cid", DropDownList4.SelectedValue); SqlDataReader dr1 = db21.executeread(cmd5); dr1.Read(); TextBox2.Text = dr1.GetString(2); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db24 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_account where dept_id=@did"; cmd5.Parameters.AddWithValue("@did", TextBox3.Text); SqlDataReader dr1 = db24.executeread(cmd5); dr1.Read(); TextBox4.Text = dr1.GetString(1); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db4 = new dbconnect(); SqlCommand cmd4 = new SqlCommand(); cmd4.CommandText = "select name from tbl_account where account_id=@id"; cmd4.Parameters.AddWithValue("@id", DropDownList3.SelectedValue); SqlDataReader dr14 = db4.executeread(cmd4); dr14.Read(); TextBox4.Text = dr14.GetString(0); }
protected void Page_Load(object sender, EventArgs e) { String no = Session["event_no"].ToString(); dbconnect db = new dbconnect(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select pic,caption from gallery where event_no=@no order by date DESC "; cmd.Parameters.AddWithValue("@no", no); SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbconnect db1 = new dbconnect(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select account_id from tbl_account"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { DropDownList1.Items.Add(dr1.GetString(0)); } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db3 = new dbconnect(); SqlCommand cmd3 = new SqlCommand(); cmd3.CommandText = "select name from faculty where staff_id not in (select staff_id from division)"; cmd3.Parameters.AddWithValue("@id", TextBox1.Text); SqlDataReader dr2 = db3.executeread(cmd3); dr2.Read(); TextBox5.Text = dr2.GetString(0); db3.execute(cmd3); }
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) { dbconnect db24 = new dbconnect(); SqlCommand cmd5 = new SqlCommand(); cmd5.CommandText = "select * from tbl_sem where subject=@sid"; cmd5.Parameters.AddWithValue("@sid", DropDownList3.SelectedValue); SqlDataReader dr45 = db24.executeread(cmd5); dr45.Read(); TextBox3.Text = dr45.GetString(4); TextBox7.Text = dr45.GetString(0); }