//function to display the output private void DisplayOutput(ArrayList s) { ArrayList list1 = new ArrayList(); for (int x = 0; x < s.Count; x++) { list1.Add(output[x]); } list1.Sort(); list1.Reverse(); for (int y = 0; y < s.Count; y++) { if (output[y].Equals(list1[0])) { Panel2.Visible = true; lblOutput.Font.Bold = true; lblOutput.ForeColor = System.Drawing.Color.Green; lblOutput.Text = s[y].ToString(); DataTable tabStud = new DataTable(); BusinessLogic obj = new BusinessLogic(); tabStud = obj.Search_Student(Session["RegNo"].ToString()); lblName.Text = tabStud.Rows[0]["Name"].ToString(); lblCName.Text = tabStud.Rows[0]["Cname"].ToString(); return; } } }
private void LoadStudent_Info(string regno) { try { DataTable dt_Info = db.Search_Student(regno); if (dt_Info.Rows.Count != 0) { DataRow r = dt_Info.Rows[0]; TextBox_Name.Text = r["name"].ToString(); TextBox_Reg.Text = r["regno"].ToString(); TextBox_DOB.Text = r["dob"].ToString(); ListItem itemGender = new ListItem(r["gender"].ToString()); int IndexGender = DropDownList_Gender.Items.IndexOf(itemGender); if (IndexGender != -1) { DropDownList_Gender.SelectedIndex = IndexGender; } ListItem itemCourse = new ListItem(r["Cname"].ToString()); int IndexCourse = DropDownList_Course.Items.IndexOf(itemCourse); if (IndexCourse != -1) { DropDownList_Course.SelectedIndex = IndexCourse; } ListItem itemSem = new ListItem(r["sem"].ToString()); int IndexSem = DropDownList_Sem.Items.IndexOf(itemSem); if (IndexSem != -1) { DropDownList_Sem.SelectedIndex = IndexSem; } ListItem itemstatus = new ListItem(r["status"].ToString()); int Indexstatus = DropDownListStatus.Items.IndexOf(itemstatus); if (Indexstatus != -1) { DropDownListStatus.SelectedIndex = Indexstatus; } TextBox_Parent.Text = r["pname"].ToString(); TextBox_Email.Text = r["email_id"].ToString(); TextBox_Mobile.Text = r["mobile"].ToString(); // Txtusername.Text = r["uname"].ToString(); Txtpassword.Text = r["password"].ToString(); txtpStatus.Text = r["PStatus"].ToString(); } } catch { } }
//function to get student details private void GetStudentDetails() { try { BusinessLogic obj = new BusinessLogic(); DataTable tab = new DataTable(); tab = obj.Search_Student(Session["RegNo"].ToString()); lblCourse.Text = tab.Rows[0]["Cname"].ToString(); lblSem.Text = tab.Rows[0]["Sem"].ToString(); } catch { } }
protected void btnAttributes_Click(object sender, EventArgs e) { try { if (db.search_regno(TextBox_Search.Text) == 1) { DataTable tabstudent = new DataTable(); BusinessLogic obj = new BusinessLogic(); tabstudent = obj.Search_Student(TextBox_Search.Text); Response.Redirect(string.Format("frmStudentAttributes.aspx?Cname={0}®no={1}", tabstudent.Rows[0]["Cname"].ToString(), TextBox_Search.Text)); } else { ClientScript.RegisterStartupScript(this.GetType(), "key", "<script>alert('Invalid regno!!!')</script>"); } } catch { } }