private void BindDrop() { try { TeacherMsts mst = new TeacherMsts(); List <TeacherMst> obj = mst.FullDetails(); ddlTeacher.DataTextField = "FirstName"; ddlTeacher.DataValueField = "TeacherID"; ddlTeacher.DataSource = obj; ddlTeacher.DataBind(); ddlTeacher.Items.Insert(0, new ListItem("-Select-", "0")); CollegeMsts mst1 = new CollegeMsts(); List <CollegeMst> obj1 = mst1.FullDetails(); ddlCollege.DataTextField = "CollegeName"; ddlCollege.DataValueField = "CollegeID"; ddlCollege.DataSource = obj1; ddlCollege.DataBind(); ddlCollege.Items.Insert(0, new ListItem("-Select-", "0")); } catch (Exception ex) { } }
private void BindGridView() { CollegeMsts msts = new CollegeMsts(); List <CollegeMst> Collage = msts.FullDetails(); grdTeacherInfo.DataSource = Collage; grdTeacherInfo.DataBind(); }
private void BindControl() { CollegeMsts msts = new CollegeMsts(); CollegeMst collmst = msts.Details(Convert.ToInt32(Request.QueryString["EID"].ToString())); txtCollName.Text = collmst.CollegeName; txtDetails.Text = collmst.CollegeDesc; ddlstate.SelectedValue = collmst.StateID.ToString(); }
protected void makelink_delete(object sender, EventArgs e) { string strparm = (sender as ImageButton).CommandArgument; CollegeMsts msts = new CollegeMsts(); String strerr = msts.DeleteColl(Convert.ToInt32(strparm)); BindGridView(); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { CollegeMst mst = new CollegeMst(); mst.CollegeID = Convert.ToInt32(Request.QueryString["EID"].ToString()); mst.CollegeName = txtCollName.Text.Trim(); mst.CollegeDesc = txtDetails.Text.Trim(); mst.StateID = Convert.ToInt32(ddlstate.SelectedValue.Trim()); CollegeMsts cooldata = new CollegeMsts(); String strerr = cooldata.EditColl(mst); if (strerr == "0") { Response.Redirect("~/College/CollegeDetails", false); } } catch (Exception ex) { } }
protected void btnCreate_Click(object sender, EventArgs e) { try { CollegeMst mst = new CollegeMst(); mst.CollegeName = txtCollege.Text.Trim(); mst.CollegeDesc = txtDetails.Text.Trim(); mst.StateID = Convert.ToInt32(ddlstate.SelectedValue.Trim()); CollegeMsts Colldata = new CollegeMsts(); String strerr = Colldata.CreateColl(mst); if (strerr == "0") { Response.Redirect("~/CollegeJoining/CJDetails", false); } } catch (Exception ex) { } }