protected void submitButton_Click(object sender, EventArgs e) { //Lets validate the page first if (!Page.IsValid) return; int intResult = 0; // Page is valid, lets go ahead and insert records // Instantiate BAL object sBLL scBLL = new sBLL(); // Instantiate the object we have to deal with sBO scBO = new sBO(); // set the properties of the object sDAL scdal = new sDAL(); scBO.scholarshipName = scNameText.Text; scBO.orgID = 1; try { intResult = scBLL.Insert(scBO); if (intResult > 0) lblMessage.Text = "New record inserted successfully."; else lblMessage.Text = "failed"; } catch (Exception ee) { lblMessage.Text = ee.Message.ToString(); } finally { int sID = scBO.sID; foreach (ListItem li in CheckBoxList1.Items) { if (li.Selected) { mascidBLL masciBLL = new mascidBLL(); mascidBO masciBO = new mascidBO(); masciBO.sID = sID; masciBO.majorID = int.Parse(li.Value); } } } scBO = null; scBLL = null; }
ListItem
CheckBoxList
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)