protected void addbranchButton_Click(object sender, EventArgs e) { try { int cid = Int32.Parse(collegeDropDownList.SelectedValue); int bid = Int32.Parse(branchDropDownList.SelectedValue); int pid = Int32.Parse(programDropDownList.SelectedValue); int gen = Int32.Parse(generalTextBox.Text); int obc = Int32.Parse(obcTextBox.Text); int sc = Int32.Parse(scTextBox.Text); int st = Int32.Parse(stTextBox.Text); admissionEntities ae = new admissionEntities(); Branch_College bc = new Branch_College(); bc.branch_id = bid; bc.college_id = cid; bc.program_id = pid; bc.general = gen; bc.obc = obc; bc.sc = sc; bc.st = st; ae.Branch_College.Add(bc); ae.SaveChanges(); Response.Redirect(Request.RawUrl); errLabel.Text = ""; } catch (Exception err) { errLabel.Text = "some error"; } }
protected void Button3_Click(object sender, EventArgs e) { branchaddButton.Enabled = false; int gen = Int32.Parse(genTextBox.Text); int obc = Int32.Parse(obcTextBox.Text); int sc = Int32.Parse(scTextBox.Text); int st = Int32.Parse(stTextBox.Text); ae = new admissionEntities(); Branch_College bc = new Branch_College(); bc.college_id = cid; bc.branch_id = Int32.Parse(branchDropDownList.SelectedValue); bc.program_id = Int32.Parse(programDropDownList.SelectedValue); bc.general = gen; bc.obc = obc; bc.sc = sc; bc.st = st; ae.Branch_College.Add(bc); ae.SaveChanges(); }