using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class registration_form : System.Web.UI.Page { SqlConnection con; SqlCommand com; SqlDataReader dr; string regis = ""; string rollnumber = ""; string rollnumber1 = ""; int i; int rupes; string print = "false"; protected void Page_Load(object sender, EventArgs e) { if (Session["out"].ToString() == "false") { Response.Redirect("log_out.aspx"); } else { con = new SqlConnection(ConfigurationManager.ConnectionStrings["regis_dbConnectionString"].ConnectionString); //if(Session["fill_value"].ToString()=="true") //{ bool aply_r = false; btn_print.Enabled = false; lbl_error_message.Text = ""; if (!Page.IsPostBack) { txt_box_registrar_amt.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_library.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_admin.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_late_registration.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_feedue.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_pay.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_dean_amt.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_receive.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_c_relation1.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_c_name1.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_c_mobile1.Attributes.Add("onkeypress", "return isNumberKey(event)"); txt_box_c_mail1.Attributes.Add("onkeypress", "return isNumberKey(event)"); //TetxBox1.Attributes.Add("onkeypress", "return isNumberKey(event)"); //ddl_branch.Enabled = true; ddl_branch.Items.Clear(); ddl_branch_current.Items.Clear(); string str = "select branch from branch_master"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_branch.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); str = "select branch from branch_master"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_branch_current.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); ddl_sem.Items.Clear(); ddl_sem_current.Items.Clear(); for (i = 1; i <= 6; i++) { ddl_sem.Items.Add(i.ToString()); } for (i = 1; i <= 14; i++) { ddl_sem_current.Items.Add(i.ToString()); } string halt = ""; str = "select registration_no,name,father_name,father_occupation,mother_name,mother_occupation,e_mail,convert(varchar,dob,101)as dob,gender,blood_group,category,yearly_income,identy_mark,permanant_address,present_address,corrospond_address,board_name_h,passing_year_h,percent_mark_h,div_h,board_name_i,passing_year_i,percent_mark_i,div_i,course,branch,session,college,hostel,transport,halt,route,fee_dues,now_pay,mode_details,school_roll_no,convert(varchar,registration_date,101)as registration_date,board_name_d,passing_year_d,percent_mark_d,div_d,board_name_g,passing_year_g,percent_mark_g,div_g,board_name_p,passing_year_p,percent_mark_p,div_p,other,scholar_yes,scholar_no,apply_registration,admin_receive,admin_mode_cash,admin_mode_other,in_d,in_g,in_p,sem,current_session,current_course,current_branch,current_sem,clr_bal_samaj,clr_bal_total,registrar_amount,dean_yes,dean_no,dean_amount,fine_library,fine_admin,fine_late_regis,due_with_fine,receive_from_samaj,student_due,clear_bal,loan_yes,loan_no,handicapped,permanent_address1,current_address1,corrospond_address1 from registration_master where registration_no='" + Session["u_id"].ToString() + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { regis = dr[0].ToString(); Session["roll_no"] = regis; txt_box_roll_no_uni.Text = regis; //txt_box_roll_no_uni.ReadOnly = true; txtbox_box_name.Text = dr[1].ToString(); txt_box_father.Text = dr[2].ToString(); ddl_f_occu.Text = dr[3].ToString(); txt_box_mother.Text = dr[4].ToString(); ddl_mother_occu.Text = dr[5].ToString(); txt_box_email.Text = dr[6].ToString(); txt_box_dob.Text = dr[7].ToString(); ddl_gender.Text = dr[8].ToString(); ddl_blood.Text = dr[9].ToString(); ddl_category.Text = dr[10].ToString(); txt_box_income.Text = dr[11].ToString(); txt_box_id_mark.Text = dr[12].ToString(); txt_box_p_add1.Text = dr[13].ToString(); txt_box_prsnt_add1.Text = dr[14].ToString(); txt_box_c_add1.Text = dr[15].ToString(); txt_box_h_board.Text = dr[16].ToString(); ddl_h_year.Text = dr[17].ToString(); txt_box_h_percent.Text = dr[18].ToString(); ddl_h_div.Text = dr[19].ToString(); txt_box_i_board.Text = dr[20].ToString(); ddl_i_year.Text = dr[21].ToString(); txt_box_i_percent.Text = dr[22].ToString(); ddl_i_div.Text = dr[23].ToString(); ddl_course.Text = dr[24].ToString(); //ddl_sem.Text = dr[25].ToString(); ddl_branch.Text = dr[25].ToString(); ddl_session.Text = dr[26].ToString(); ddl_college.Text = dr[27].ToString(); radio_btn_hostel.Checked = Convert.ToBoolean(dr[28].ToString()); radio_btn_transport.Checked = Convert.ToBoolean(dr[29].ToString()); halt = dr[30].ToString(); ddl_route.Text = dr[31].ToString(); txt_box_feedue.Text = dr[32].ToString(); txt_box_pay.Text = dr[33].ToString(); txt_box_pay_detail.Text = dr[34].ToString(); txt_box_roll_no_school.Text = dr[35].ToString(); TextBox1.Text = dr[36].ToString(); txt_box_d_board.Text = dr[37].ToString(); ddl_d_year.Text = dr[38].ToString(); txt_box_d_percent.Text = dr[39].ToString(); ddl_d_div.Text = dr[40].ToString(); txt_box_g_board.Text = dr[41].ToString(); ddl_g_year.Text = dr[42].ToString(); txt_box_g_percent.Text = dr[43].ToString(); ddl_g_div.Text = dr[44].ToString(); txt_box_p_board.Text = dr[45].ToString(); ddl_p_year.Text = dr[46].ToString(); txt_box_p_percent.Text = dr[47].ToString(); ddl_p_div.Text = dr[48].ToString(); radio_btn_other.Checked = Convert.ToBoolean(dr[49].ToString()); radio_btn_yes.Checked = Convert.ToBoolean(dr[50].ToString()); radio_btn_no.Checked = Convert.ToBoolean(dr[51].ToString()); aply_r = Convert.ToBoolean(dr[52].ToString()); txt_box_receive.Text = dr[53].ToString(); radio_btn_cash.Checked = Convert.ToBoolean(dr[54].ToString()); radio_btn_cash_other.Checked = Convert.ToBoolean(dr[55].ToString()); txt_box_diploma_in.Text = dr[56].ToString(); txt_box_graduation_in.Text = dr[57].ToString(); txt_box_pg_in.Text = dr[58].ToString(); ddl_sem.Text = dr[59].ToString(); ddl_session_current.Text = dr[60].ToString(); ddl_course_current.Text = dr[61].ToString(); ddl_branch_current.Text = dr[62].ToString(); ddl_sem_current.Text = dr[63].ToString(); txt_box_clear_bal_samaj.Text = dr[64].ToString(); txt_box_clear_bal_tatal.Text = dr[65].ToString(); // radio_btn_yes_registrar.Checked = Convert.ToBoolean(dr[64].ToString()); //radio_btn_no_registrar.Checked = Convert.ToBoolean(dr[65].ToString()); txt_box_registrar_amt.Text = dr[66].ToString(); radio_btn_yes_dean.Checked = Convert.ToBoolean(dr[67].ToString()); radio_btn_no_dean.Checked = Convert.ToBoolean(dr[68].ToString()); txt_box_dean_amt.Text = dr[69].ToString(); txt_box_library.Text = dr[70].ToString(); txt_box_admin.Text = dr[71].ToString(); txt_box_late_registration.Text = dr[72].ToString(); txt_box_total_due_withfine.Text = dr[73].ToString(); txt_box_samajkalyan_amt.Text = dr[74].ToString(); txt_box_due_on_student.Text = dr[75].ToString(); txt_box_clear_bal.Text = dr[76].ToString(); radio_btn_loan_yes.Checked = Convert.ToBoolean(dr[77].ToString()); radio_btn_loan_no.Checked = Convert.ToBoolean(dr[78].ToString()); ddl_handicap.Text = dr[79].ToString(); txt_box_p_add2.Text = dr[80].ToString(); txt_box_prsnt_add2.Text = dr[81].ToString(); txt_box_c_add2.Text = dr[82].ToString(); } } com.Dispose(); con.Close(); halt_fill(); if (halt == "") { } else { ddl_halt.Text = halt; } if (ddl_course_current.Text == "B.TECH") { ddl_branch_current.Enabled = true; } else if (ddl_course_current.Text == "MBA") { ddl_branch_current.Enabled = false; ddl_branch_current.Items.Clear(); } else { ddl_branch_current.Items.Clear(); ddl_sem_current.Items.Clear(); } if (ddl_course.Text == "B.TECH") { ddl_branch.Enabled = true; } else if (ddl_course.Text == "MBA") { ddl_branch.Enabled = false; ddl_branch.Items.Clear(); } else { ddl_sem.Items.Clear(); ddl_branch.Items.Clear(); } if (Session["u_type"].ToString() == "Dean") { ResetFormControlValues(this); //radio_btn_yes_registrar.Enabled = false; //radio_btn_no_registrar.Enabled = false; //txt_box_registrar_amt.Enabled = false; //txt_box_feedue.Enabled = false; radio_btn_no_dean.Enabled = true; radio_btn_yes_dean.Enabled = true; txt_box_dean_amt.Enabled = true; btn_save.Enabled = true; if (aply_r) { radio_aply_yes.Checked = true; radio_aply_no.Checked = false; } else { radio_aply_yes.Checked = false; radio_aply_no.Checked = true; } if (radio_btn_yes_dean.Checked) { txt_box_dean_amt.Enabled = true; } else { txt_box_dean_amt.Enabled = false; } } else if (Session["u_type"].ToString() == "Account") { ResetFormControlValues(this); txt_box_feedue.Enabled = true; txt_box_library.Enabled = true; txt_box_admin.Enabled = true; btn_save.Enabled = true; radio_btn_loan_yes.Enabled = true; radio_btn_loan_no.Enabled = true; if (aply_r) { radio_aply_yes.Checked = true; radio_aply_no.Checked = false; } else { radio_aply_yes.Checked = false; radio_aply_no.Checked = true; } //radio_btn_yes_registrar.Enabled = false; //radio_btn_no_registrar.Enabled = false; //txt_box_registrar_amt.Enabled = false; //radio_btn_no_dean.Enabled = false; //radio_btn_yes_dean.Enabled = false; //txt_box_dean_amt.Enabled = false; } else if (Session["u_type"].ToString() == "Registrar") { ResetFormControlValues(this); // txt_box_registrar_amt.Enabled = true; btn_save.Enabled = true; radio_btn_yes.Enabled = true; radio_btn_no.Enabled = true; if (aply_r) { radio_aply_yes.Checked = true; radio_aply_no.Checked = false; } else { radio_aply_yes.Checked = false; radio_aply_no.Checked = true; } if (radio_btn_no.Checked) { txt_box_registrar_amt.Enabled = false; } else { txt_box_registrar_amt.Enabled = true; } } else if (Session["u_type"].ToString() == "admin") { ResetFormControlValues1(this); btn_apply.Visible = true; radio_aply_yes.Enabled = false; radio_aply_no.Enabled = false; if (aply_r) { radio_aply_yes.Checked = true; radio_aply_no.Checked = false; } else { radio_aply_yes.Checked = false; radio_aply_no.Checked = true; } if (radio_btn_transport.Checked) { ddl_route.Enabled = true; ddl_halt.Enabled = true; } else { ddl_route.Enabled = false; ddl_halt.Enabled = false; } if (radio_btn_no.Checked) { txt_box_registrar_amt.Enabled = false; } else { txt_box_registrar_amt.Enabled = true; } if (radio_btn_yes_dean.Checked) { txt_box_dean_amt.Enabled = true; } else { txt_box_dean_amt.Enabled = false; } //btn_print.Enabled = true; //txt_box_prsnt_add1.Enabled = true; //txt_box_prsnt_add2.Enabled = true; //radio_btn_no_dean.Enabled = false; //radio_btn_yes_dean.Enabled = false; //txt_box_dean_amt.Enabled = false; //txt_box_feedue.Enabled = false; //radio_btn_yes_registrar.Enabled = false; //radio_btn_no_registrar.Enabled = false; //txt_box_registrar_amt.Enabled = false; } else if (Session["u_type"].ToString() == "user") { ResetFormControlValues(this); txt_box_c_add1.Enabled = true; txt_box_c_add2.Enabled = true; txt_box_pay.Enabled = true; txt_box_pay_detail.Enabled = true; btn_save.Enabled = true; btn_apply.Enabled = true; txt_box_c_relation1.Enabled = true; txt_box_c_relation2.Enabled = true; txt_box_c_name1.Enabled = true; txt_box_c_name2.Enabled = true; txt_box_c_mail1.Enabled = true; txt_box_c_mail2.Enabled = true; txt_box_c_mobile1.Enabled = true; txt_box_c_mobile2.Enabled = true; radio_btn_hostel.Enabled = true; radio_btn_transport.Enabled = true; radio_btn_other.Enabled = true; if (radio_btn_transport.Checked) { ddl_route.Enabled = true; ddl_halt.Enabled = true; } else { ddl_route.Enabled = false; ddl_halt.Enabled = false; } txt_box_diploma_in.Enabled = true; txt_box_graduation_in.Enabled = true; txt_box_pg_in.Enabled = true; txt_box_h_board.Enabled = true; txt_box_i_board.Enabled = true; txt_box_g_board.Enabled = true; txt_box_d_board.Enabled = true; txt_box_p_board.Enabled = true; ddl_h_year.Enabled = true; ddl_i_year.Enabled = true; ddl_g_year.Enabled = true; ddl_d_year.Enabled = true; ddl_p_year.Enabled = true; txt_box_h_percent.Enabled = true; txt_box_i_percent.Enabled = true; txt_box_d_percent.Enabled = true; txt_box_g_percent.Enabled = true; txt_box_p_percent.Enabled = true; ddl_h_div.Enabled = true; ddl_i_div.Enabled = true; ddl_d_div.Enabled = true; ddl_g_div.Enabled = true; ddl_p_div.Enabled = true; if (aply_r) { radio_aply_yes.Checked = true; radio_aply_no.Checked = false; } else { radio_aply_yes.Checked = false; radio_aply_no.Checked = true; } //btn_print.Enabled = false; //txt_box_prsnt_add1.Enabled = false; //txt_box_prsnt_add2.Enabled = false; } else if (Session["u_type"].ToString() == "Academic cell") { ResetFormControlValues(this); radio_aply_yes.Visible = true; radio_aply_no.Visible = true; Label14.Visible = true; //radio_aply_yes.Enabled = false; //radio_aply_no.Enabled = false; //btn_apply.Visible = false; if (aply_r) { ResetFormControlValues(this); radio_aply_yes.Visible = true; radio_aply_no.Visible = true; Label14.Visible = true; btn_save.Enabled = true; radio_aply_yes.Checked = true; radio_aply_no.Checked = false; txt_box_receive.Enabled = true; radio_btn_cash.Enabled = true; radio_btn_cash_other.Enabled = true; // btn_print.Enabled = true; txt_box_late_registration.Enabled = true; } else { ResetFormControlValues(this); } } rollnumber = Session["u_id"].ToString() + "kumar"; Image1.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber; rollnumber1 = Session["u_id"].ToString() + "vats"; Image2.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber1; i = 1; str = "select * from contact_info where roll_number='" + Session["u_id"].ToString() + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { txt_box_c_name1.Text = dr[1].ToString(); txt_box_c_relation1.Text = dr[2].ToString(); txt_box_c_mobile1.Text = dr[3].ToString(); txt_box_c_mail1.Text = dr[5].ToString(); } i++; } com.Dispose(); con.Close(); str = "select * from contact_info where roll_number='" + Session["u_id"].ToString() + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { txt_box_c_name2.Text = dr[1].ToString(); txt_box_c_relation2.Text = dr[2].ToString(); txt_box_c_mobile2.Text = dr[3].ToString(); txt_box_c_mail2.Text = dr[5].ToString(); } i++; } com.Dispose(); con.Close(); if (radio_btn_transport.Checked) { print = "true"; Session["print_ht"] = print; } else if (radio_btn_hostel.Checked) { print = "true"; Session["print_ht"] = print; } else { print = "false"; Session["print_ht"] = print; } } } } protected void btn_save_Click(object sender, EventArgs e) { if (radio_btn_transport.Checked) { print = "true"; Session["print_ht"] = print; } else if (radio_btn_hostel.Checked) { print = "true"; Session["print_ht"] = print; } else { print = "false"; Session["print_ht"] = print; } int ch; string str; if (txt_box_clear_bal.Text == "") { ch = 0; } else { ch = Int32.Parse(txt_box_clear_bal.Text); } if (ch <= 0) { lbl_error_message.Text = ""; string ses_id = Session["u_id"].ToString(); if (Session["u_type"].ToString() == "Academic cell") { str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',registration_date='" + System.DateTime.Today.ToShortDateString() + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='"+txt_box_p_add2.Text+"',current_address1='"+txt_box_prsnt_add2.Text+"',corrospond_address1='"+txt_box_c_add2.Text+"' where registration_no='" + ses_id + "'"; } else { str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='" + txt_box_p_add2.Text + "',current_address1='" + txt_box_prsnt_add2.Text + "',corrospond_address1='" + txt_box_c_add2.Text + "' where registration_no='" + ses_id + "'"; } //string str = "insert into registration_master values('" + ses_id + "','" + txtbox_box_name.Text + "','" + txt_box_father.Text + "','" + ddl_f_occu.Text + "','" + txt_box_mother.Text + "','" + ddl_mother_occu.Text + "','" + txt_box_email.Text + "','" + txt_box_dob.Text + "','" + ddl_gender.Text + "','" + ddl_blood.Text + "','" + ddl_category.Text + "','" + txt_box_income.Text + "','" + txt_box_id_mark.Text + "','" + txt_box_p_add1.Text + "','" + txt_box_prsnt_add1.Text + "','" + txt_box_c_add1.Text + "','" + txt_box_h_board.Text + "','" + ddl_h_year.Text + "','" + txt_box_h_percent.Text + "','" + ddl_h_div.Text + "','" + txt_box_i_board.Text + "','" + ddl_i_year.Text + "','" + txt_box_i_percent.Text + "','" + ddl_i_div.Text + "','" + ddl_course.Text + "','" + ddl_sem.Text + "','" + ddl_branch.Text + "','" + ddl_session.Text + "','" + txt_box_college.Text + "','" + check_hostel.Checked + "','" + check_transport.Checked + "','" + txt_box_halt.Text + "','" + txt_box_route.Text + "','" + txt_box_feedue.Text + "','" + txt_box_pay.Text + "','" + txt_box_pay_detail.Text + "')"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); int i = 1; str = "update contact_info set name='" + txt_box_c_name1.Text + "',relation='" + txt_box_c_relation1.Text + "',phone_no='" + txt_box_c_mobile1.Text + "',e_mail='" + txt_box_c_mail1.Text + "' where roll_number='" + ses_id + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); i++; com.Dispose(); con.Close(); str = "update contact_info set name='" + txt_box_c_name2.Text + "',relation='" + txt_box_c_relation2.Text + "',phone_no='" + txt_box_c_mobile2.Text + "',e_mail='" + txt_box_c_mail2.Text + "' where roll_number='" + ses_id + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); if (FileUpload1.HasFile) { string productName = ses_id; byte[] productImage = FileUpload1.FileBytes; string empno = ses_id + "kumar"; string query = "update image_master set image_name=@ProductName, image_data=@ProductImage where roll_number=@id"; ////SqlConnection con = new SqlConnection(constr); com = new SqlCommand(query, con); // com.Parameters.Add("@id", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductName", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductImage", SqlDbType.VarBinary).Value = productImage; com.Parameters.AddWithValue("@id", empno); con.Open(); int result = com.ExecuteNonQuery(); con.Close(); rollnumber = Session["u_id"].ToString() + "kumar"; Image1.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber; //int result=1; if (result > 0) { //lblMessage.Text = "Product Saved Successfully"; } } else { //lblMessage.Text = "Please Select Product Image File"; } if (FileUpload2.HasFile) { string productName = ses_id; byte[] productImage = FileUpload2.FileBytes; string empno = ses_id + "vats"; string query = "update image_master set image_name=@ProductName, image_data=@ProductImage where roll_number=@id"; ////SqlConnection con = new SqlConnection(constr); com = new SqlCommand(query, con); // com.Parameters.Add("@id", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductName", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductImage", SqlDbType.VarBinary).Value = productImage; com.Parameters.AddWithValue("@id", empno); con.Open(); int result = com.ExecuteNonQuery(); con.Close(); //int result=1; rollnumber1 = Session["u_id"].ToString() + "vats"; Image2.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber1; if (result > 0) { //lblMessage.Text = "Product Saved Successfully"; } } else { //lblMessage.Text = "Please Select Product Image File"; } if (Session["u_type"].ToString() == "Academic cell" || Session["u_type"].ToString() == "admin") { btn_print.Enabled = true; } else btn_print.Enabled = false; } else if (radio_btn_no_dean.Checked) { if (Session["u_type"].ToString() == "Academic cell") { lbl_error_message.Text = "Plz get the dean permission for registration"; btn_print.Enabled = false; } else if (Session["u_type"].ToString() == "admin") { string ses_id = Session["u_id"].ToString(); str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='" + txt_box_p_add2.Text + "',current_address1='" + txt_box_prsnt_add2.Text + "',corrospond_address1='" + txt_box_c_add2.Text + "' where registration_no='" + ses_id + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); btn_print.Enabled = true; } else { string ses_id = Session["u_id"].ToString(); str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='" + txt_box_p_add2.Text + "',current_address1='" + txt_box_prsnt_add2.Text + "',corrospond_address1='" + txt_box_c_add2.Text + "' where registration_no='" + ses_id + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); } } else { lbl_error_message.Text = ""; string ses_id = Session["u_id"].ToString(); if (Session["u_type"].ToString() == "Academic cell") { str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',registration_date='" + System.DateTime.Today.ToShortDateString() + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='" + txt_box_p_add2.Text + "',current_address1='" + txt_box_prsnt_add2.Text + "',corrospond_address1='" + txt_box_c_add2.Text + "' where registration_no='" + ses_id + "'"; } else { str = "update registration_master set name='" + txtbox_box_name.Text + "',father_name='" + txt_box_father.Text + "',father_occupation='" + ddl_f_occu.Text + "',mother_name='" + txt_box_mother.Text + "',mother_occupation='" + ddl_mother_occu.Text + "',e_mail='" + txt_box_email.Text + "',dob='" + txt_box_dob.Text + "',gender='" + ddl_gender.Text + "',blood_group='" + ddl_blood.Text + "',category='" + ddl_category.Text + "',yearly_income='" + txt_box_income.Text + "',identy_mark='" + txt_box_id_mark.Text + "',permanant_address='" + txt_box_p_add1.Text + "',present_address='" + txt_box_prsnt_add1.Text + "',corrospond_address='" + txt_box_c_add1.Text + "',board_name_h='" + txt_box_h_board.Text + "',passing_year_h='" + ddl_h_year.Text + "',percent_mark_h='" + txt_box_h_percent.Text + "',div_h='" + ddl_i_div.Text + "',board_name_i='" + txt_box_i_board.Text + "',passing_year_i='" + ddl_i_year.Text + "',percent_mark_i='" + txt_box_i_percent.Text + "',div_i='" + ddl_i_div.Text + "',course='" + ddl_course.Text + "',branch='" + ddl_branch.Text + "',session='" + ddl_session.Text + "',college='" + ddl_college.Text + "',hostel='" + radio_btn_hostel.Checked + "',transport='" + radio_btn_transport.Checked + "',halt='" + ddl_halt.Text + "',route='" + ddl_route.Text + "',fee_dues='" + txt_box_feedue.Text + "',now_pay='" + txt_box_pay.Text + "',mode_details='" + txt_box_pay_detail.Text + "',school_roll_no='" + txt_box_roll_no_school.Text + "',board_name_d='" + txt_box_d_board.Text + "',passing_year_d='" + ddl_d_year.Text + "',percent_mark_d='" + txt_box_d_percent.Text + "',div_d='" + ddl_d_div.Text + "',board_name_g='" + txt_box_g_board.Text + "',passing_year_g='" + ddl_g_year.Text + "',percent_mark_g='" + txt_box_g_percent.Text + "',div_g='" + ddl_g_div.Text + "',board_name_p='" + txt_box_p_board.Text + "',passing_year_p='" + ddl_p_year.Text + "',percent_mark_p='" + txt_box_p_percent.Text + "',div_p='" + ddl_p_div.Text + "',other='" + radio_btn_other.Checked + "',scholar_yes='" + radio_btn_yes.Checked + "',scholar_no='" + radio_btn_no.Checked + "',admin_receive='" + txt_box_receive.Text + "',admin_mode_cash='" + radio_btn_cash.Checked + "',admin_mode_other='" + radio_btn_cash_other.Checked + "',in_d='" + txt_box_diploma_in.Text + "',in_g='" + txt_box_graduation_in.Text + "',in_p='" + txt_box_pg_in.Text + "',sem='" + ddl_sem.Text + "',current_session='" + ddl_session_current.Text + "',current_course='" + ddl_course_current.Text + "',current_branch='" + ddl_branch_current.Text + "',current_sem='" + ddl_sem_current.Text + "',clr_bal_samaj='" + txt_box_clear_bal_samaj.Text + "',clr_bal_total='" + txt_box_clear_bal_tatal.Text + "',registrar_amount='" + txt_box_registrar_amt.Text + "',dean_yes='" + radio_btn_yes_dean.Checked + "',dean_no='" + radio_btn_no_dean.Checked + "',dean_amount='" + txt_box_dean_amt.Text + "',fine_library='" + txt_box_library.Text + "',fine_admin='" + txt_box_admin.Text + "',fine_late_regis='" + txt_box_late_registration.Text + "',due_with_fine='" + txt_box_total_due_withfine.Text + "',receive_from_samaj='" + txt_box_samajkalyan_amt.Text + "',student_due='" + txt_box_due_on_student.Text + "',clear_bal='" + txt_box_clear_bal.Text + "',loan_yes='" + radio_btn_loan_yes.Checked + "',loan_no='" + radio_btn_loan_no.Checked + "',handicapped='" + ddl_handicap.Text + "',permanent_address1='" + txt_box_p_add2.Text + "',current_address1='" + txt_box_prsnt_add2.Text + "',corrospond_address1='" + txt_box_c_add2.Text + "' where registration_no='" + ses_id + "'"; } con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); int i = 1; str = "update contact_info set name='" + txt_box_c_name1.Text + "',relation='" + txt_box_c_relation1.Text + "',phone_no='" + txt_box_c_mobile1.Text + "',e_mail='" + txt_box_c_mail1.Text + "' where roll_number='" + ses_id + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); i++; com.Dispose(); con.Close(); str = "update contact_info set name='" + txt_box_c_name2.Text + "',relation='" + txt_box_c_relation2.Text + "',phone_no='" + txt_box_c_mobile2.Text + "',e_mail='" + txt_box_c_mail2.Text + "' where roll_number='" + ses_id + "' and id='" + i.ToString() + "'"; con.Open(); com = new SqlCommand(str, con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); if (FileUpload1.HasFile) { string productName = ses_id; byte[] productImage = FileUpload1.FileBytes; string empno = ses_id + "kumar"; string query = "update image_master set image_name=@ProductName, image_data=@ProductImage where roll_number=@id"; ////SqlConnection con = new SqlConnection(constr); com = new SqlCommand(query, con); // com.Parameters.Add("@id", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductName", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductImage", SqlDbType.VarBinary).Value = productImage; com.Parameters.AddWithValue("@id", empno); con.Open(); int result = com.ExecuteNonQuery(); con.Close(); rollnumber = Session["u_id"].ToString() + "kumar"; Image1.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber; //int result=1; if (result > 0) { //lblMessage.Text = "Product Saved Successfully"; } } else { //lblMessage.Text = "Please Select Product Image File"; } if (FileUpload2.HasFile) { string productName = ses_id; byte[] productImage = FileUpload2.FileBytes; string empno = ses_id + "vats"; string query = "update image_master set image_name=@ProductName, image_data=@ProductImage where roll_number=@id"; ////SqlConnection con = new SqlConnection(constr); com = new SqlCommand(query, con); // com.Parameters.Add("@id", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductName", SqlDbType.VarChar).Value = productName; com.Parameters.Add("@ProductImage", SqlDbType.VarBinary).Value = productImage; com.Parameters.AddWithValue("@id", empno); con.Open(); int result = com.ExecuteNonQuery(); con.Close(); //int result=1; rollnumber1 = Session["u_id"].ToString() + "vats"; Image2.ImageUrl = "~/ShowImage.ashx?roll_number=" + rollnumber1; if (result > 0) { //lblMessage.Text = "Product Saved Successfully"; } } else { //lblMessage.Text = "Please Select Product Image File"; } if (Session["u_type"].ToString() == "Academic cell" || Session["u_type"].ToString() == "admin") { btn_print.Enabled = true; } else btn_print.Enabled = false; } } private void ResetFormControlValues(Control parent) { foreach (Control c in parent.Controls) { if (c.Controls.Count > 0) { ResetFormControlValues(c); } else { switch (c.GetType().ToString()) { case "System.Web.UI.WebControls.TextBox": ((TextBox)c).Enabled =false; break; case "System.Web.UI.WebControls.CheckBox": ((CheckBox)c).Enabled = false ; break; case "System.Web.UI.WebControls.RadioButton": ((RadioButton)c).Enabled=false; break; case "System.Web.UI.WebControls.DropDownList": ((DropDownList)c).Enabled = false; break; case "System.Web.UI.WebControls.FileUpload": ((FileUpload)c).Enabled = false; break; case "System.Web.UI.WebControls.Button": ((Button)c).Enabled = false; break; } } } } private void ResetFormControlValues1(Control parent) { foreach (Control c in parent.Controls) { if (c.Controls.Count > 0) { ResetFormControlValues1(c); } else { switch (c.GetType().ToString()) { case "System.Web.UI.WebControls.TextBox": ((TextBox)c).Enabled = true; break; case "System.Web.UI.WebControls.CheckBox": ((CheckBox)c).Enabled = true; break; case "System.Web.UI.WebControls.RadioButton": ((RadioButton)c).Enabled = true; break; case "System.Web.UI.WebControls.DropDownList": ((DropDownList)c).Enabled = true; break; case "System.Web.UI.WebControls.FileUpload": ((FileUpload)c).Enabled = true; break; case "System.Web.UI.WebControls.Button": ((Button)c).Enabled = true; break; } } } } protected void ddl_course_SelectedIndexChanged(object sender, EventArgs e) { if (ddl_course.SelectedItem.Text == "B.TECH") { ddl_branch.Enabled = true; ddl_branch.Items.Clear(); ddl_sem.Items.Clear(); string str = "select branch from branch_master"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_branch.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); for (int i = 1; i <= 6; i++) { ddl_sem.Items.Add(i.ToString()); } } else if (ddl_course.SelectedItem.Text == "MBA") { ddl_branch.Items.Clear(); ddl_sem.Items.Clear(); ddl_branch.Enabled = false; for (int i = 1; i <= 4; i++) { ddl_sem.Items.Add(i.ToString()); } } else { ddl_branch.Items.Clear(); ddl_sem.Items.Clear(); } } protected void Button1_Click(object sender, EventArgs e) { //Session["ctrl"] = hi; //ClientScript.RegisterStartupScript(this.GetType(), "onclick", ""); Response.Redirect("print_form.aspx"); } protected void btn_apply_Click(object sender, EventArgs e) { bool apply_regis; apply_regis=true; string aply = "update registration_master set apply_registration='" + apply_regis + "' where registration_no='" + Session["u_id"].ToString() + "'"; con.Open(); com = new SqlCommand(aply,con); com.ExecuteNonQuery(); com.Dispose(); con.Close(); } protected void link_btn_home_Click(object sender, EventArgs e) { if(Session["u_type"].ToString()=="admin") { Response.Redirect("admin_choice_form.aspx"); } else if (Session["u_type"].ToString() == "user") { Response.Redirect("log_out.aspx"); } else Response.Redirect("admin_form.aspx"); //Response.Redirect("log_in_form.aspx"); } protected void link_btn_logout_Click(object sender, EventArgs e) { string session_check="false"; Session["out"]=session_check; Response.Redirect("log_out.aspx"); // FormsAuthentication.SignOut(); // FormsAuthentication.RedirectToLoginPage(); //// Response.Redirect("log_in_form.aspx"); } protected void radio_btn_hostel_CheckedChanged(object sender, EventArgs e) { if (radio_btn_hostel.Checked) { ddl_route.Text = ""; ddl_route.Enabled = false; ddl_halt.Enabled = false; ddl_halt.Items.Clear(); } } protected void radio_btn_transport_CheckedChanged(object sender, EventArgs e) { if (radio_btn_transport.Checked) { ddl_route.Enabled = true; ddl_halt.Enabled = true; } } protected void radio_btn_other_CheckedChanged(object sender, EventArgs e) { if (radio_btn_other.Checked) { ddl_route.Text = ""; ddl_route.Enabled = false; ddl_halt.Enabled = false; ddl_halt.Items.Clear(); } } protected void radio_btn_no_dean_CheckedChanged(object sender, EventArgs e) { if (radio_btn_no_dean.Checked) { txt_box_dean_amt.Enabled = false; txt_box_dean_amt.Text = ""; } } protected void radio_btn_yes_dean_CheckedChanged(object sender, EventArgs e) { if (radio_btn_yes_dean.Checked) { txt_box_dean_amt.Enabled = true; } } protected void txt_box_registrar_amt_TextChanged(object sender, EventArgs e) { int test; if (txt_box_registrar_amt.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_registrar_amt.Text); } txt_box_samajkalyan_amt.Text = rupes.ToString(); if (txt_box_total_due_withfine.Text == "") { test = 0; } else { test = Int32.Parse( txt_box_total_due_withfine.Text); } rupes1 = test - rupes; txt_box_due_on_student.Text = rupes1.ToString(); if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } //if (txt_box_receive.Text == "") //{ // due1 = 0; //} //else //{ // due1 = Int32.Parse(txt_box_receive.Text); //} //if (due < 0) //{ // due = due + due1; //} //else //{ // due = due - due1; //} if (txt_box_total_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_total_receive.Text); } if (due < 0) { due = due - due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text = rupes.ToString(); due1 = test - due1; txt_box_clear_bal_tatal.Text = due1.ToString(); } protected void radio_btn_no_CheckedChanged(object sender, EventArgs e) { if (radio_btn_no.Checked) { txt_box_registrar_amt.Enabled = false; txt_box_registrar_amt.Text = ""; txt_box_samajkalyan_amt.Text = ""; int test,rupes1; if (txt_box_registrar_amt.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_registrar_amt.Text); } txt_box_samajkalyan_amt.Text = rupes.ToString(); if (txt_box_total_due_withfine.Text == "") { test = 0; } else { test = Int32.Parse(txt_box_total_due_withfine.Text); } rupes1 = test - rupes; txt_box_due_on_student.Text = rupes1.ToString(); if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } if (txt_box_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_receive.Text); } if (due < 0) { due = due + due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text = rupes.ToString(); due1 = test - due1; txt_box_clear_bal_tatal.Text = due1.ToString(); } } protected void radio_btn_yes_CheckedChanged(object sender, EventArgs e) { if (radio_btn_yes.Checked) { txt_box_registrar_amt.Enabled = true; } } int rupes1, rupes2, rupes3,rupes4,rupes5; protected void txt_box_library_TextChanged(object sender, EventArgs e) { if (txt_box_feedue.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_feedue.Text); } if (txt_box_library.Text == "") { rupes1 = 0; } else { rupes1 = Int32.Parse(txt_box_library.Text); } if (txt_box_admin.Text == "") { rupes2 = 0; } else { rupes2 = Int32.Parse(txt_box_admin.Text); } if (txt_box_late_registration.Text == "") { rupes3 = 0; } else { rupes3 = Int32.Parse(txt_box_late_registration.Text); } rupes5 = rupes1 + rupes + rupes2 + rupes3; if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } txt_box_total_due_withfine.Text = rupes5.ToString(); rupes = rupes5 - rupes4; txt_box_due_on_student.Text = rupes.ToString(); if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } //if (txt_box_receive.Text == "") //{ // due1 = 0; //} //else //{ // due1 = Int32.Parse(txt_box_receive.Text); //} //if (due < 0) //{ // due = due + due1; //} //else //{ // due = due - due1; //} if (txt_box_total_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_total_receive.Text); } if (due < 0) { due = due + due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text=rupes4.ToString(); rupes5 = rupes5-due1; txt_box_clear_bal_tatal.Text=rupes5.ToString(); } protected void txt_box_admin_TextChanged(object sender, EventArgs e) { if (txt_box_feedue.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_feedue.Text); } if (txt_box_library.Text == "") { rupes1 = 0; } else { rupes1 = Int32.Parse(txt_box_library.Text); } if (txt_box_admin.Text == "") { rupes2 = 0; } else { rupes2 = Int32.Parse(txt_box_admin.Text); } if (txt_box_late_registration.Text == "") { rupes3 = 0; } else { rupes3 = Int32.Parse(txt_box_late_registration.Text); } rupes5 = rupes1 + rupes + rupes2 + rupes3; if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } txt_box_total_due_withfine.Text = rupes5.ToString(); rupes = rupes5 - rupes4; txt_box_due_on_student.Text = rupes.ToString(); if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } if (txt_box_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_receive.Text); } if (due < 0) { due = due + due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text = rupes4.ToString(); rupes5 = rupes5 - due1; txt_box_clear_bal_tatal.Text = rupes5.ToString(); } protected void txt_box_late_registration_TextChanged(object sender, EventArgs e) { if (txt_box_feedue.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_feedue.Text); } if (txt_box_library.Text == "") { rupes1 = 0; } else { rupes1 = Int32.Parse(txt_box_library.Text); } if (txt_box_admin.Text == "") { rupes2 = 0; } else { rupes2 = Int32.Parse(txt_box_admin.Text); } if (txt_box_late_registration.Text == "") { rupes3 = 0; } else { rupes3 = Int32.Parse(txt_box_late_registration.Text); } rupes5 = rupes1 + rupes + rupes2 + rupes3; if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } txt_box_total_due_withfine.Text = rupes5.ToString(); rupes = rupes5 - rupes4; txt_box_due_on_student.Text = rupes.ToString(); if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } if (txt_box_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_receive.Text); } if (due < 0) { due = due + due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text = rupes4.ToString(); rupes5 = rupes5 - due1; txt_box_clear_bal_tatal.Text = rupes5.ToString(); } protected void txt_box_feedue_TextChanged(object sender, EventArgs e) { if (txt_box_feedue.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_feedue.Text); } if (txt_box_library.Text == "") { rupes1 = 0; } else { rupes1 = Int32.Parse(txt_box_library.Text); } if (txt_box_admin.Text == "") { rupes2 = 0; } else { rupes2 = Int32.Parse(txt_box_admin.Text); } if (txt_box_late_registration.Text == "") { rupes3 = 0; } else { rupes3 = Int32.Parse(txt_box_late_registration.Text); } rupes5 = rupes1 + rupes + rupes2 + rupes3; if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } txt_box_total_due_withfine.Text = rupes5.ToString(); rupes = rupes5 - rupes4; txt_box_due_on_student.Text = rupes.ToString(); if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } //if (txt_box_receive.Text == "") //{ // due1 = 0; //} //else //{ // due1 = Int32.Parse(txt_box_receive.Text); //} //if (due < 0) //{ // due = due + due1; //} //else //{ // due = due - due1; //} if (txt_box_total_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_total_receive.Text); } if (due < 0) { due = due - due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text = rupes4.ToString(); rupes5 = rupes5 - due1; txt_box_clear_bal_tatal.Text = rupes5.ToString(); } int due,due1; protected void txt_box_receive_TextChanged(object sender, EventArgs e) { if (txt_box_feedue.Text == "") { rupes = 0; } else { rupes = Int32.Parse(txt_box_feedue.Text); } if (txt_box_library.Text == "") { rupes1 = 0; } else { rupes1 = Int32.Parse(txt_box_library.Text); } if (txt_box_admin.Text == "") { rupes2 = 0; } else { rupes2 = Int32.Parse(txt_box_admin.Text); } if (txt_box_late_registration.Text == "") { rupes3 = 0; } else { rupes3 = Int32.Parse(txt_box_late_registration.Text); } rupes = rupes1 + rupes + rupes2 + rupes3; if (txt_box_samajkalyan_amt.Text == "") { rupes4 = 0; } else { rupes4 = Int32.Parse(txt_box_samajkalyan_amt.Text); } if (txt_box_due_on_student.Text == "") { due = 0; } else { due = Int32.Parse(txt_box_due_on_student.Text); } if (txt_box_receive.Text == "") { due1 = 0; } else { due1 = Int32.Parse(txt_box_receive.Text); } if (due < 0) { due = due + due1; } else { due = due - due1; } txt_box_clear_bal.Text = due.ToString(); txt_box_clear_bal_samaj.Text=rupes4.ToString(); rupes = rupes - due1; txt_box_clear_bal_tatal.Text = rupes.ToString(); } protected void ddl_route_SelectedIndexChanged(object sender, EventArgs e) { halt_fill(); //string str; //ddl_halt.Items.Clear(); //if (ddl_route.Text == "Delhi") //{ // str = "select halt from route_master where route='"+ddl_route.Text+"'"; // con.Open(); // com = new SqlCommand(str,con); // dr = com.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // ddl_halt.Items.Add(dr[0].ToString()); // } // } // com.Dispose(); // con.Close(); //} //else if(ddl_route.Text=="Ghaziabad") //{ // str = "select halt from route_master where route='" + ddl_route.Text + "'"; // con.Open(); // com = new SqlCommand(str, con); // dr = com.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // ddl_halt.Items.Add(dr[0].ToString()); // } // } // com.Dispose(); // con.Close(); //} //else if (ddl_route.Text == "Modinagar") //{ // str = "select halt from route_master where route='" + ddl_route.Text + "'"; // con.Open(); // com = new SqlCommand(str, con); // dr = com.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // ddl_halt.Items.Add(dr[0].ToString()); // } // } // com.Dispose(); // con.Close(); //} //else if (ddl_route.Text == "Meerut") //{ // str = "select halt from route_master where route='" + ddl_route.Text + "'"; // con.Open(); // com = new SqlCommand(str, con); // dr = com.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // ddl_halt.Items.Add(dr[0].ToString()); // } // } // com.Dispose(); // con.Close(); //} //else if (ddl_route.Text == "Baraut") //{ // str = "select halt from route_master where route='" + ddl_route.Text + "'"; // con.Open(); // com = new SqlCommand(str, con); // dr = com.ExecuteReader(); // if (dr.HasRows) // { // while (dr.Read()) // { // ddl_halt.Items.Add(dr[0].ToString()); // } // } // com.Dispose(); // con.Close(); //} //else //{ // ddl_halt.Items.Clear(); //} } private void halt_fill() { string str; ddl_halt.Items.Clear(); if (ddl_route.Text == "Delhi") { str = "select halt from route_master where route='" + ddl_route.Text + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_halt.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); } else if (ddl_route.Text == "Ghaziabad") { str = "select halt from route_master where route='" + ddl_route.Text + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_halt.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); } else if (ddl_route.Text == "Modinagar") { str = "select halt from route_master where route='" + ddl_route.Text + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_halt.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); } else if (ddl_route.Text == "Meerut") { str = "select halt from route_master where route='" + ddl_route.Text + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_halt.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); } else if (ddl_route.Text == "Baraut") { str = "select halt from route_master where route='" + ddl_route.Text + "'"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_halt.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); } else { ddl_halt.Items.Clear(); } } protected void txt_box_due_on_student_TextChanged(object sender, EventArgs e) { } protected void ddl_course_current_SelectedIndexChanged(object sender, EventArgs e) { if (ddl_course_current.SelectedItem.Text == "B.TECH") { ddl_branch_current.Enabled = true; ddl_branch_current.Items.Clear(); ddl_sem_current.Items.Clear(); string str = "select branch from branch_master"; con.Open(); com = new SqlCommand(str, con); dr = com.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { ddl_branch_current.Items.Add(dr[0].ToString()); } } com.Dispose(); con.Close(); for (int i = 1; i <= 14; i++) { ddl_sem_current.Items.Add(i.ToString()); } } else if (ddl_course_current.SelectedItem.Text == "MBA") { ddl_sem_current.Items.Clear(); ddl_branch_current.Enabled = false; ddl_branch_current.Items.Clear(); for (int i = 1; i <= 8; i++) { ddl_sem_current.Items.Add(i.ToString()); } } else { ddl_branch.Items.Clear(); ddl_sem_current.Items.Clear(); } } protected void txt_box_pay_detail_TextChanged(object sender, EventArgs e) { } protected void txt_box_dean_amt_TextChanged(object sender, EventArgs e) { } }