public static List <ProgramList> GetProgramName(string SearchProgramTxt, string StudentId) { List <ProgramList> empResult = new List <ProgramList>(); { DBCommon db = new DBCommon(); using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "sp_GetEduProgramListAutocom"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SearchProgramTxt", SearchProgramTxt); cmd.Parameters.AddWithValue("@StudentId", Convert.ToInt32(StudentId)); DataTable dt = db.GetTable(cmd); foreach (DataRow dr in dt.Rows) { ProgramList pr = new ProgramList(); pr.ProgramId = dr["ProgramId"].ToString(); pr.ProgramName = dr["ProgramName"].ToString(); empResult.Add(pr); } return(empResult); } } }
private void BindCatalogYear() { DateTime currDate = DateTime.Now; string yearpart = currDate.Year.ToString(); yearpart = yearpart.Substring(1); DBCommon db = new DBCommon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT YearID, YearName From tlYearMaster where YearIndicator >= @YearPart"; cmd.Parameters.AddWithValue("@YearPart", yearpart); DataTable yearDT = db.GetTable(cmd); if (yearDT != null) { ddlCatalogYear.DataSource = yearDT; ddlCatalogYear.DataTextField = "YearName"; ddlCatalogYear.DataValueField = "YearID"; ddlCatalogYear.DataBind(); } }
// Bind Student Information using studentid private void BindStudentInfo(int studentId) { DBCommon db = new DBCommon(); SqlCommand cmd = new SqlCommand(); DataTable studInfo = db.GetTable(cmd); if (studInfo != null) { } }
private void BindEduPlanList(int StudentId) { DBCommon db = new DBCommon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sp_GetEduPlantList"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@StudentId", StudentId); DataTable dtplans = db.GetTable(cmd); if (dtplans != null) { DataList1.DataSource = dtplans; DataList1.DataBind(); } }
private void BindStudentInfo(int StudentId) { DBCommon db = new DBCommon(); SqlCommand cmd = new SqlCommand("select * from tsstudent where StudentId = @StudentId"); cmd.Parameters.AddWithValue("@StudentId", StudentId); DataTable studInfo = db.GetTable(cmd); if (studInfo != null) { lblSID.Text = studInfo.Rows[0]["SID"].ToString(); lblName.Text = studInfo.Rows[0]["FirstName"].ToString() + " " + studInfo.Rows[0]["LastName"].ToString(); lblHeaderName.Text = studInfo.Rows[0]["FirstName"].ToString() + " " + studInfo.Rows[0]["LastName"].ToString(); LblDOB.Text = Convert.ToDateTime(studInfo.Rows[0]["DOB"]).ToString("MMM dd yyyy"); LblEmailid.Text = studInfo.Rows[0]["Email"].ToString(); } }
public void GetProgramList() { int studentId = 0; DBCommon db = new DBCommon(); using (SqlCommand cmd = new SqlCommand()) { studentId = Convert.ToInt32(Session["StudentId"]); //cmd.CommandText = "SELECT ProgramId, ProgramName from tsProgram order by ProgramName Asc"; cmd.CommandText = "sp_GetEduProgramListBrowse"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@StudentID", studentId); DataTable dt = db.GetTable(cmd); ProgramList.DataSource = dt; ProgramList.DataBind(); } }