public string GetCoureEnrollID(DropDownList dropSems, DropDownList dropCourse, DropDownList dropAcadmicyear) { try { if (dropSems.SelectedIndex != -1) { string a = @"Declare @x int; Declare @y int; Declare @z int; " + "select @y = CODE_ID from App_CODE where CODE_VALUE = '" + dropSems.SelectedValue + "';" + "select @z = course_id from App_Course where course_name = '" + dropCourse.SelectedValue + "';" + "select @x = COURSE_ENROL_ID from APP_COURSE_ENROLMENT where ACDEMIC_YEAR = '" + dropAcadmicyear.SelectedValue + "' and SEMESTER = @y and APP_COURSE_ID = @z;" + "select @x as 'CEID';select @y,@x,@z"; MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdr = db.readOperation(a); string enrollId = ""; while (sdr.Read()) { enrollId = sdr["CEID"].ToString(); } return(enrollId); } else { return(""); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error:", ex); return(""); } }
private void GetAllStd(string a) { try { MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(a); List <App_Student> list = new List <App_Student>(); while (sdb.Read()) { App_Student info = new App_Student() { CourseID = sdb["Course Enroll ID"].ToString(), StudentID = sdb["Student ID PK"].ToString(), StudentRoll = sdb["Student ID"].ToString(), StudentName = sdb["Student Name"].ToString() }; list.Add(info); } Student.DataSource = list; Student.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetAllCourseTopicEnrollment() { try { string query = "select TOPIC_ID as ID, TOPIC_STATEMENT as TS, t2.course_name as 'CN', t3.clo_statement as 'C' from APP_COURSE_TOPIC t1 inner join App_Course t2 on t1.COURSE_ID = t2.course_id inner join I_CLO t3 on t1.CLO_ID = t3.clo_id where t2.course_name = '" + course.SelectedValue + "'"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(query); List <APP_CourseTopic> list = new List <APP_CourseTopic>(); while (sdb.Read()) { list.Add(new APP_CourseTopic() { TOPIC_ID = sdb["ID"].ToString(), Course_ID = sdb["CN"].ToString(), TOPIC_STATEMENT = sdb["TS"].ToString(), CLO = sdb["C"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error Occur While Get Course Topic Enrollment", ex); } }
public List <string> GetAssessmentandRawScore(DropDownList Assessment, TextBox t1, DropDownList Semester, DropDownList Year, DropDownList Course) { try { List <string> li = new List <string>(); Assessment.Items.Clear(); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select t2.CODE_VALUE as ASS, t1.SCORE_VALUE as SV from APP_SCORE_DISTRIBUTION t1 inner join App_CODE t2 on t1.ASSESSMENT_ID = t2.CODE_ID where COURSE_ENR_ID = " + new Students().GetCoureEnrollID(Semester, Course, Year) + ""); while (sdb.Read()) { li.Add(sdb["SV"].ToString()); Assessment.Items.Add(sdb["ASS"].ToString()); } if (li.Count != 0) { t1.Text = li[Assessment.SelectedIndex]; Assessment.Enabled = true; } else { Assessment.Enabled = false; t1.Text = ""; } return(li); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While Get Assessment", ex); return(null); } }
protected void grid_Load(object sender, EventArgs e) { try { string a = @"select COURSE_ENROL_ID as ID,t2.course_name as 'Course Name',ACDEMIC_YEAR as 'Acadmic Year',t3.instructor_name as 'Instructor Name',t4.CODE_VALUE as Semester from APP_COURSE_ENROLMENT t1 inner join App_Course t2 on t1.APP_COURSE_ID = t2.course_id inner join App_Instructor t3 on t1.INSTRUCTOR_ID = t3.instructor_id inner join App_CODE t4 on t1.SEMESTER = t4.CODE_ID where t1.UNIVERSITY_ID = t3.UNI_ID"; MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(a); List <Course_Information> list = new List <Course_Information>(); while (sdb.Read()) { Course_Information info = new Course_Information() { ACDEMIC_YEAR = sdb["Acadmic Year"].ToString(), APP_COURSE_ID = sdb["Course Name"].ToString(), COURSE_ENROL_ID = sdb["ID"].ToString(), INSTRUCTOR_ID = sdb["Instructor Name"].ToString(), SEMESTER = sdb["Semester"].ToString() }; list.Add(info); } grid.DataSource = list; grid.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
public void getData() { try { string CEID = new Students().GetCoureEnrollID(Semester, course, Years); string Query = "select t.SCORE_DISTRIBUTION_ID as ID, t2.CODE_VALUE as AID,t.SCORE_VALUE as SV,t.COURSE_ENR_ID as CID from APP_SCORE_DISTRIBUTION t inner join App_CODE t2 on t.ASSESSMENT_ID = t2.CODE_ID inner join APP_COURSE_ENROLMENT t3 on t.COURSE_ENR_ID = t3.COURSE_ENROL_ID inner join App_Instructor t4 on t3.UNIVERSITY_ID = t4.UNI_ID where COURSE_ENR_ID = " + CEID + " and t4.instructor_id = " + Session["LoginID"].ToString() + ""; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(Query); List <Score_Distribution> List = new List <Score_Distribution>(); while (sdb.Read()) { List.Add(new Score_Distribution() { Assessment_ID = sdb["AID"].ToString(), ID = sdb["ID"].ToString(), Score_Value = sdb["SV"].ToString() }); } MainGrid.DataSource = List; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public List <AppUser> getListOfUsers() { List <AppUser> listOfUsers = new List <AppUser>(); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation( "select t2.instructor_name as 'INS', " + " Username," + " EMAIL as Email," + " t2.instructor_id as ID," + " ADM_IJ.CODE_VALUE as ADM_TYPE," + " ES_IJ.CODE_VALUE AS ES_TYPE," + " COUR.course_name + ' (' + COUR.COURSE_NUMBER + ')' AS COUR" + " from Users t1 inner join App_Instructor t2 on t1.InstructorID = t2.instructor_id" + " INNER JOIN APP_CODE ES_IJ ON ES_IJ.CODE_ID = EXPERT_SYSTEM_TYPE" + " INNER JOIN APP_CODE ADM_IJ ON ADM_IJ.CODE_ID = INSRUCTOR_TYPE" + " INNER JOIN App_Course COUR ON COUR.course_id = T1.COURSE_ID" + " ORDER BY ID DESC"); while (sdb.Read()) { AppUser userObj = new AppUser(); userObj.email = sdb["Email"].ToString(); userObj.fullName = sdb["INS"].ToString(); userObj.username = sdb["Username"].ToString(); userObj.module = sdb["ES_TYPE"].ToString(); userObj.userType = sdb["ADM_TYPE"].ToString(); userObj.course = sdb["COUR"].ToString(); userObj.instructorId = Int32.Parse(sdb["ID"].ToString()); listOfUsers.Add(userObj); } return(listOfUsers); }
protected void Program_SelectedIndexChanged(object sender, EventArgs e) { try { Course.Items.Clear(); MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader res = db.readOperation(@"declare @a int select @a = program_id from App_Program where program_name = '" + Program.SelectedValue + "'; select (course_name) as Course from App_Course where App_Program_program_id = @a;"); Course.Items.Add(new ListItem() { Text = "Select Course", Value = "Select Course" }); while (res.Read()) { ListItem listItem = new ListItem(); listItem.Text = res["Course"].ToString(); listItem.Value = res["Course"].ToString(); Course.Items.Add(listItem); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Selecting Program And Courses : ", ex); } }
public void GetSamester(DropDownList dropSemester, DropDownList dropAcadmicyear, DropDownList dropCourse) { try { if (dropAcadmicyear.SelectedIndex != -1) { string qus = @"select t3.CODE_VALUE from APP_COURSE_ENROLMENT t1 inner join App_Course t2 on t1.APP_COURSE_ID = t2.course_id " + "inner join App_CODE t3 on t1.SEMESTER = t3.CODE_ID " + "where t1.ACDEMIC_YEAR = " + dropAcadmicyear.SelectedValue + " and t2.course_name = '" + dropCourse.SelectedValue + "';"; dropSemester.Items.Clear(); MyUtilities.DBUtils dbs = new MyUtilities.DBUtils(); SqlDataReader sdr1 = dbs.readOperation(qus); while (sdr1.Read()) { ListItem li = new ListItem(); li.Value = sdr1["CODE_VALUE"].ToString(); li.Text = sdr1["CODE_VALUE"].ToString(); dropSemester.Items.Add(li); } } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
private void SelectionData() { try { MyUtilities.DBUtils db = new MyUtilities.DBUtils(); string que = "Declare @a varchar(50);Declare @b varchar(50); select @a = t2.program_name, @b = t1.course_name from App_Course t1 inner join App_Program t2 on t1.App_Program_program_id = t2.program_id where t1.course_id = (select COURSE_ID from APP_COURSE_TOPIC where TOPIC_ID = " + IDs + "); select *,@a as PN,@b as CN from APP_COURSE_TOPIC where TOPIC_ID = " + IDs + ""; SqlDataReader res = db.readOperation(que); while (res.Read()) { Program.SelectedValue = res["PN"].ToString(); Course.Items.Add(res["CN"].ToString()); Course.SelectedIndex = Course.Items.Count - 1; TopicStatement.Text = res["TOPIC_STATEMENT"].ToString(); Lab_Hours.Items.Add(res["LAB_HOURS"].ToString()); Lab_Hours.SelectedIndex = Lab_Hours.Items.Count - 1; Lecture.Items.Add(res["LECTURE_HOURS"].ToString()); Lecture.SelectedIndex = Lecture.Items.Count - 1; } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error:", ex); } }
protected void Instructorgrid_Load(object sender, EventArgs e) { try { string a = "select instructor_id as 'Instructor ID', instructor_name as 'Name' ,FIRST_NAME +' '+ MIDDLE_NAME +' '+ LAST_NAME as 'Full Name', EMAIL as Email, CELL_PHONE_NUM as 'Cell Number', UNI_NAME as 'University Name' from App_Instructor t1 inner join APP_UNIVERSITY t2 on t1.UNI_ID = t2.UNI_ID"; MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(a); List <App_Instructor> list = new List <App_Instructor>(); while (sdb.Read()) { App_Instructor info = new App_Instructor() { instructor_id = sdb["Instructor ID"].ToString(), instructor_name = sdb["Name"].ToString(), Full_Name = sdb["Full Name"].ToString(), EMAIL = sdb["Email"].ToString(), CELL_PHONE_NUM = sdb["Cell Number"].ToString(), UNI_ID = sdb["University Name"].ToString() }; list.Add(info); } Instructorgrid.DataSource = list; Instructorgrid.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }
public void GetAcadmicYear(DropDownList dropProgram, DropDownList dropCourse, DropDownList dropAcadmicYear) { try { if (dropCourse.SelectedIndex != -1) { string qu = @" Declare @a int; Declare @b int; Declare @c int; Select @a = program_id from App_Program where App_Program.program_name = '" + dropProgram.SelectedValue + "';" + "select @b = course_id from App_Course where course_name = '" + dropCourse.SelectedValue + "';" + "select distinct ACDEMIC_YEAR from APP_COURSE_ENROLMENT where APP_COURSE_ID = @b;"; dropAcadmicYear.Items.Clear(); MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdr = db.readOperation(qu); while (sdr.Read()) { ListItem li = new ListItem(); li.Text = sdr["ACDEMIC_YEAR"].ToString(); li.Value = sdr["ACDEMIC_YEAR"].ToString(); dropAcadmicYear.Items.Add(li); } } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetAllCourseTopicEnrollment() { try { string query = "select t1.COURSE_TOPIC_ENR_ID as ID,t2.course_name as CN,t3.TOPIC_STATEMENT as St,t1.TOPIC_SEQ_NUM as SQ from APP_COURSE_TOPIC_ENROL t1 inner join App_Course t2 on t1.COURSE_ENR_ID = t2.course_id inner join APP_COURSE_TOPIC t3 on t1.COURSE_TOPIC_ID = t3.TOPIC_ID inner join APP_COURSE_ENROLMENT t4 on t4.COURSE_ENROL_ID = t1.COURSE_ENR_ID where t4.ACDEMIC_YEAR = " + Acadmicyear.SelectedValue + " and t4.SEMESTER = (select CODE_ID from App_CODE where CODE_VALUE = '" + semester.SelectedValue + "')"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(query); List <App_Course_Topic_Enroll> list = new List <App_Course_Topic_Enroll>(); while (sdb.Read()) { list.Add(new App_Course_Topic_Enroll() { CourseTopicEnrID = sdb["ID"].ToString(), CourseEnrolID = sdb["CN"].ToString(), CourseTopicID = sdb["St"].ToString(), TopicSeqNo = sdb["SQ"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error Occur While Get Course Topic Enrollment", ex); } }
public void GetAllEnrollmentData() { try { List <APP_CourseTopic> MainList = new List <APP_CourseTopic>(); List <string> li = Connections.LIST; string query = "select TOPIC_ID as ID, TOPIC_STATEMENT as TS,t2.course_name as 'CN' from APP_COURSE_TOPIC t1 inner join App_Course t2 on t1.COURSE_ID = t2.course_id where t2.course_name = '" + course.SelectedValue + "'"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(query); List <APP_CourseTopic> list = new List <APP_CourseTopic>(); while (sdb.Read()) { list.Add(new APP_CourseTopic() { TOPIC_ID = sdb["ID"].ToString(), Course_ID = sdb["CN"].ToString(), TOPIC_STATEMENT = sdb["TS"].ToString() }); } for (int i = 0; i < li.Count; i++) { for (int j = 0; j < list.Count; j++) { if (li[i] == list[j].TOPIC_STATEMENT) { MainList.Add(list[j]); } } } MainGrid.DataSource = MainList; MainGrid.DataBind(); foreach (GridViewRow item in MainGrid.Rows) { DropDownList dropdown = (DropDownList)item.FindControl("drop"); if (dropdown.SelectedIndex == 0 || true) { for (int i = 0; i < MainList.Count; i++) { dropdown.Items.Add(new ListItem() { Text = i + 1 + "", Value = i + 1 + "" }); } } } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetUniBYCourse() { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select t2.UNI_NAME as N from APP_COURSE_ENROLMENT t1 inner join APP_UNIVERSITY t2 on t1.UNIVERSITY_ID = t2.UNI_ID where t1.COURSE_ENROL_ID = " + new Students().GetCoureEnrollID(Semester, course, Years) + ""); University.Items.Clear(); while (sdb.Read()) { University.Items.Add(sdb["N"].ToString()); } } catch (Exception ex) { } }
private void SelectionData() { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select Program_name as PN from App_Program where program_id = " + IDs + ""); while (sdb.Read()) { Program.Text = sdb["PN"].ToString(); } } catch (Exception ex) { } }
public void GetAssessemntsValues(DropDownList semester, TextBox Score, DropDownList course, DropDownList year, DropDownList Assessment, DropDownList AssessmentType) { Assessment.Items.Clear(); MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(@"select t1.ASSESSMENT_NAME as AN, t1.RAW_SCORE as RS from APP_SCORE_DESIGN t1 inner join APP_SCORE_DISTRIBUTION t2 on t1.SCORE_DISTRIBUTION_ID = t2.SCORE_DISTRIBUTION_ID where t1.SCORE_DISTRIBUTION_ID = (select t1.SCORE_DISTRIBUTION_ID from APP_SCORE_DISTRIBUTION t1 where t1.ASSESSMENT_ID = (select CODE_ID from App_CODE where CODE_VALUE = '" + AssessmentType.SelectedValue + "') and t1.COURSE_ENR_ID = " + new Students().GetCoureEnrollID(semester, course, year) + " )"); while (sdb.Read()) { ListItem li = new ListItem(); li.Text = sdb["AN"].ToString(); li.Value = sdb["AN"].ToString(); Assessment.Items.Add(li); Score.Text = sdb["RS"].ToString(); } }
public void GetCLO(DropDownList CLO) { try { CLO.Items.Clear(); string Query = "select clo_statement as ST from I_CLO where App_Course_course_id = (select course_id from App_Course where course_name = '" + course.SelectedValue + "');"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(Query); while (sdb.Read()) { CLO.Items.Add(sdb["ST"].ToString()); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void Genrate(GridView grids) { string qu = "select INSTRUCTION_METHOD_ID as ID,COURSE_ENR_ID as CID, t3.CODE_VALUE as IID, t2.clo_statement as S from APP_INSTRUCTION_METHOD t1 inner join I_CLO t2 on t1.CLO_ID = t2.clo_id inner join App_CODE t3 on t1.INSTRUCTION_ID = t3.CODE_ID where t1.CLO_ID = " + Clo.SelectedValue + " and COURSE_ENR_ID = " + new Students().GetCoureEnrollID(Semsester, Course, Year) + ""; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(qu); List <insMethod> list = new List <insMethod>(); while (sdb.Read()) { list.Add(new insMethod() { ID = sdb["ID"].ToString(), CID = sdb["CID"].ToString(), Clo = sdb["S"].ToString(), IID = sdb["IID"].ToString() }); } grids.DataSource = list; grids.DataBind(); }
private void SelectionData() { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select UNI_ID as ID, UNI_NAME as Name, UNI_ADDRESS as 'A', UNI_VERIFIED as V from APP_UNIVERSITY where UNI_ID = " + IDs + ";"); while (sdb.Read()) { uniname.Text = sdb["Name"].ToString(); Address.Text = sdb["A"].ToString(); isv.Checked = Convert.ToBoolean(sdb["V"].ToString()); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetSemester(DropDownList dropSemester) { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select CODE_VALUE as SM from App_CODE_TYPE t1 inner join App_CODE t2 on t1.CODE_TYPE_ID = t2.CODE_TYPE_ID where t1.CODE_TYPE_ID = 1400"); while (sdb.Read()) { dropSemester.Items.Add(new ListItem() { Text = sdb["SM"].ToString(), Value = sdb["SM"].ToString() }); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetInsMed(DropDownList dropInsMetd) { try { string qu = "select CODE_ID as ID, CODE_VALUE as N from App_CODE where CODE_TYPE_ID = 1800"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(qu); dropInsMetd.Items.Clear(); while (sdb.Read()) { dropInsMetd.Items.Add(new ListItem() { Text = sdb["N"].ToString(), Value = sdb["iD"].ToString() }); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (Connections.LIST.Count == 0) { Response.Redirect("~/AppPages/CourseTopicEnrollAdd.aspx"); } if (Page.IsPostBack == false) { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select course_name as CN, program_name as PN from App_Course t1 inner join App_Program t2 on t1.App_Program_program_id = t2.program_id where t1.course_name = '" + Request.QueryString["CID"].ToString() + "'"); while (sdb.Read()) { program.Items.Add(new ListItem() { Text = sdb["PN"].ToString(), Value = sdb["PN"].ToString() }); course.Items.Add(new ListItem() { Value = sdb["CN"].ToString(), Text = sdb["CN"].ToString() }); } program.SelectedIndex = program.Items.Count - 1; course.SelectedIndex = course.Items.Count - 1; Acadmicyear.Items.Add(Request.QueryString["y"].ToString()); Acadmicyear.SelectedIndex = Acadmicyear.Items.Count - 1; Acadmicyear.Enabled = false; semster.Items.Add(Request.QueryString["s"].ToString()); semster.Enabled = false; semster.SelectedIndex = semster.Items.Count - 1; GetAllEnrollmentData(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error Occure While Run Page Load Of Course Topic Enroll View.", ex); } } }
public int GetAssesmentID(string AssessmentName) { try { MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation("Select CODE_ID from App_CODE where CODE_VALUE = '" + AssessmentName + "'"); while (sdb.Read()) { return(Convert.ToInt32(sdb[0])); } return(0); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Erro", ex); return(0); } }
private void SelectionData() { try { string qu = "select t1.clo_statement as CLOS, t3.program_name as PN, t2.course_name as CN from I_CLO t1 join App_Course t2 on t1.App_Course_course_id = t2.course_id join App_Program t3 on t2.App_Program_program_id = t3.program_id where clo_id = " + IDs + ""; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(qu); while (sdb.Read()) { Program.SelectedValue = sdb["PN"].ToString(); Course.Items.Add(sdb["CN"].ToString()); Course.SelectedIndex = Course.Items.Count - 1; clos.Text = sdb["CLOS"].ToString(); break; } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetStudent(DropDownList Student, string Instructor, DropDownList Semester, DropDownList Course, DropDownList Year) { try { Student.Items.Clear(); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select t1.STUDENT_NAME as Name from APP_STUDENT t1 inner join APP_COURSE_ENROLMENT t2 on t1.COURSE_ENR_ID = t2.COURSE_ENROL_ID inner join App_Instructor t3 on t2.INSTRUCTOR_ID = t3.instructor_id where t2.INSTRUCTOR_ID = '" + Instructor + "' and t1.COURSE_ENR_ID = " + new Students().GetCoureEnrollID(Semester, Course, Year) + ""); while (sdb.Read()) { Student.Items.Add(new ListItem() { Text = sdb["Name"].ToString(), Value = sdb["Name"].ToString() }); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
public void GetProgram() { try { MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(@"select program_name as PN from App_Program"); while (sdb.Read()) { ListItem li = new ListItem(); li.Text = sdb["PN"].ToString(); li.Value = sdb["PN"].ToString(); AdSPro.Items.Add(li); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
protected void Page_Load(object sender, EventArgs e) { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select UNI_ID as ID, UNI_NAME as Name, UNI_ADDRESS as 'A', UNI_VERIFIED as V from APP_UNIVERSITY;"); List <Universities> list = new List <Universities>(); while (sdb.Read()) { list.Add(new Universities() { ID = sdb["ID"].ToString(), UA = sdb["A"].ToString(), UN = sdb["Name"].ToString(), V = sdb["V"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { } }
public void GetSOs(DropDownList SO, DropDownList Program) { try { SO.Items.Clear(); string Query = "select SO_STATEMENT as ST, SO_ID as ID from APP_SO where APP_PROGRAM_ID = (select program_id from App_Program where App_Program.program_name = '" + Program.SelectedValue + "');"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(Query); while (sdb.Read()) { SO.Items.Add(new ListItem() { Text = sdb["ST"].ToString(), Value = sdb["ID"].ToString() }); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While GET SO STATEMENT", ex); } }
public string GetCourseID(DropDownList course) { try { string a = "select course_id as CID from App_Course where course_name = '" + course.SelectedValue + "';"; MyUtilities.DBUtils db = new MyUtilities.DBUtils(); SqlDataReader sdb = db.readOperation(a); while (sdb.Read()) { return(sdb["CID"].ToString()); } return(null); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While Get Course Enrollment", ex); return(null); } }