protected void btnAdd_Click(object sender, EventArgs e) { BusinessLayer.CCEBL objCCE = new CCEBL(); int i = 0; foreach (ListItem lstExam in chklExam.Items) { if (lstExam.Selected) { foreach (ListItem lstClass in chklClass.Items) { if (lstClass.Selected) { i = objCCE.AddScholasticArea(txtScholasticArea.Text, Convert.ToInt32(lstExam.Value), Convert.ToInt32(ddlYear.SelectedValue), Convert.ToInt32(lstClass.Value), Convert.ToInt32(txtMaxMarks.Text), Convert.ToInt32(ddlSubject.SelectedValue)); } } } } if (i > 0) { lblMessage.Visible = true; lblMessage.Text = "Scholastic Area Added successfully"; txtScholasticArea.Text = ""; txtMaxMarks.Text = ""; } }
public void fillScholastic(int ExamID,int Batch,int Subject,int Class) { BusinessLayer.CCEBL objCCE = new CCEBL(); ds = objCCE.GetScholasticArea(Convert.ToInt32(ddlExamType.Items[ddlExamType.SelectedIndex].Value), Convert.ToInt32(ddlBatch.Items[ddlBatch.SelectedIndex].Value), Convert.ToInt32(ddlSubject.Items[ddlSubject.SelectedIndex].Value), Convert.ToInt32(ddlClass.Items[ddlClass.SelectedIndex].Value)); ddlScholastisarea.DataSource = ds.Tables[0]; ddlScholastisarea.DataTextField = "ScholasticArea"; ddlScholastisarea.DataValueField = "ScholasticID"; ddlScholastisarea.DataBind(); ddlScholastisarea.Items.Insert(0, new ListItem("---Select---", "0")); ds = new DataSet(); }