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 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 <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); }
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 <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); } }
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 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); } }
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 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(); }
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); } } }
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 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); } }
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) { } }
protected void Page_Load(object sender, EventArgs e) { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("Select Program_id as ID, Program_Name as PN from App_Program"); List <Program> list = new List <Program>(); while (sdb.Read()) { list.Add(new Program() { ID = sdb["ID"].ToString(), Program_Name = sdb["PN"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { } }
public void GetRecords() { try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select TOPIC_ID as TID,TOPIC_STATEMENT as TS,t2.course_name as CID,LECTURE_HOURS as LH,LAB_HOURS as LABH from APP_COURSE_TOPIC t1 inner join App_Course t2 on t1.COURSE_ID = t2.course_id where t2.course_id = " + new Connections().GetCourseID(Course) + " and CLO_ID = " + CLO.SelectedValue + ""); List <APP_CourseTopic> list = new List <APP_CourseTopic>(); while (sdb.Read()) { list.Add(new APP_CourseTopic() { TOPIC_ID = sdb["TID"].ToString(), TOPIC_STATEMENT = sdb["TS"].ToString(), Course_ID = sdb["CID"].ToString(), LAB_HOURS = sdb["LABH"].ToString(), LECTURE_HOURS = sdb["LH"].ToString() }); } GridView1.DataSource = list; GridView1.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error ", ex); } }
protected void Page_Load(object sender, EventArgs e) { try { List <Courses> list = new List <Courses>(); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select course_id as ID, t2.program_name as PN, course_name as CN, COURSE_NUMBER as CNU, t3.CODE_VALUE as CT, THEORY_CREDIT_HOURS as TCRH, LAB_CREDIT_HOURS as LCRH, THEORY_CONTACT_HOURS as TCH, LAB_CONTACT_HOURS as LCH from App_Course t1 inner join App_Program t2 on t1.App_Program_program_id = t2.program_id inner join App_CODE t3 on t1.COURSE_TYPE = t3.CODE_ID "); while (sdb.Read()) { list.Add(new Courses() { ID = sdb["ID"].ToString(), PN = sdb["PN"].ToString(), CN = sdb["CN"].ToString(), CNU = sdb["CNU"].ToString(), CT = sdb["CT"].ToString(), LCHOURS = sdb["LCH"].ToString(), LCRHOURS = sdb["LCRH"].ToString(), TCHOURS = sdb["TCH"].ToString(), TCRHOURS = sdb["TCRH"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While Gatting Data", ex); } }
public void GETCLOs(DropDownList CLO, DropDownList Course) { try { CLO.Items.Clear(); string Query = "select clo_statement As ST, clo_id as ID 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(new ListItem() { Text = sdb["ST"].ToString(), Value = sdb["ID"].ToString() }); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While GETING CLO", ex); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { List <App_Course_Topic_Enroll> list = new List <App_Course_Topic_Enroll>(); try { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select t1.ACDEMIC_YEAR as 'Y', t3.CODE_VALUE as 'SM', t2.course_name as 'CN', t4.program_name as 'PN' 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 inner join App_Program t4 on t2.App_Program_program_id = t4.program_id where COURSE_ENROL_ID = '" + Request.QueryString["EID"].ToString() + "'"); while (sdb.Read()) { Program.Text = sdb["PN"].ToString(); Course.Text = sdb["CN"].ToString(); Year.Text = sdb["Y"].ToString(); Semester.Text = sdb["SM"].ToString(); } sdb = new MyUtilities.DBUtils().readOperation("select t1.COURSE_TOPIC_ENR_ID as ID, t2.TOPIC_STATEMENT as ST,TOPIC_SEQ_NUM as SEQ from APP_COURSE_TOPIC_ENROL t1 inner join APP_COURSE_TOPIC t2 on t1.COURSE_TOPIC_ID = t2.TOPIC_ID where COURSE_ENR_ID = " + Request.QueryString["EID"].ToString() + ""); while (sdb.Read()) { list.Add(new App_Course_Topic_Enroll() { CourseTopicEnrID = sdb["ID"].ToString(), CourseTopicID = sdb["ST"].ToString(), TopicSeqNo = sdb["seq"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error Occure While Run Page Load Of Course Topic Enroll View.", ex); } } }
private void GetData() { try { List <ScoreDesignDataView> List = new List <ScoreDesignDataView>(); string Query = "select t1.APP_SCORE_DESIGN_ID as ID, t3.CODE_VALUE as 'AT', t1.ASSESSMENT_NAME as AN, t4.clo_statement as 'CLOS', t1.RAW_SCORE as 'RS',t1.SCORE_VALUE as 'SV', t2.SCORE_VALUE as 'TS' from APP_SCORE_DESIGN t1 inner join APP_SCORE_DISTRIBUTION t2 on t1.SCORE_DISTRIBUTION_ID = t2.SCORE_DISTRIBUTION_ID inner join App_CODE t3 on t2.ASSESSMENT_ID = t3.CODE_ID inner join I_CLO t4 on t1.CLO_ID = t4.clo_id where t3.CODE_VALUE = '" + Assessments.SelectedValue + "' and t2.COURSE_ENR_ID = " + new Students().GetCoureEnrollID(Semester, course, Years) + ""; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(Query); while (sdb.Read()) { List.Add(new ScoreDesignDataView() { Assessment = sdb["AN"].ToString(), Assessment_type = sdb["AT"].ToString(), CLO_Statement = sdb["CLOS"].ToString(), ID = sdb["ID"].ToString(), Raw_Score = sdb["RS"].ToString(), Score_Value = sdb["SV"].ToString(), Total_Score = sdb["TS"].ToString() }); } MainGrid.DataSource = List; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
private void SelectionData() { try { new Connections().GetProgram(Program); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select course_id as ID, t2.program_name as PN, course_name as CN, COURSE_NUMBER as CNU, t3.CODE_VALUE as CT, THEORY_CREDIT_HOURS as TCRH, LAB_CREDIT_HOURS as LCRH, THEORY_CONTACT_HOURS as TCH, LAB_CONTACT_HOURS as LCH from App_Course t1 inner join App_Program t2 on t1.App_Program_program_id = t2.program_id inner join App_CODE t3 on t1.COURSE_TYPE = t3.CODE_ID where course_id = " + IDs + ""); while (sdb.Read()) { Program.Items.Add(sdb["PN"].ToString()); Program.SelectedIndex = Program.Items.Count - 1; Course.Text = sdb["CN"].ToString(); CNU.Text = sdb["CNU"].ToString(); CT.Items.Add(sdb["CT"].ToString()); CT.SelectedIndex = CT.Items.Count - 1; TCRH.Text = sdb["TCRH"].ToString(); TCH.Text = sdb["TCH"].ToString(); LCH.Text = sdb["LCH"].ToString(); LCRH.Text = sdb["LCRH"].ToString(); } } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While Selecting Data", ex); } }
protected void Page_Load(object sender, EventArgs e) { try { Update = Request.QueryString["Update"] == null ? false : bool.Parse(Request.QueryString["Update"]); bool Delete = Request.QueryString["Delete"] == null ? false : bool.Parse(Request.QueryString["Delete"]); IDs = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]); if (Delete) { new Connections().DeleteDate("delete from App_Course where course_id = " + IDs + ""); Response.Redirect("~/AppPages/CoursesViews.aspx"); } else if (Update) { if (!IsPostBack) { SelectionData(); } } else { new Connections().GetProgram(Program); SqlDataReader sdb = new MyUtilities.DBUtils().readOperation("select Code_Value as CT from App_CODE where CODE_TYPE_ID = 1700"); CT.Items.Clear(); while (sdb.Read()) { CT.Items.Add(sdb["CT"].ToString()); } } } catch (Exception ex) { } }
public void gridpop() { try { string qu = "select clo_id as ID, t2.course_name as CN, clo_statement as ST from I_CLO t1 inner join App_Course t2 on t1.App_Course_course_id = t2.course_id where t2.course_name = '" + Course.Text + "'"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(qu); List <ICLO> list = new List <ICLO>(); while (sdb.Read()) { list.Add(new ICLO() { ID = sdb["ID"].ToString(), Clo_statement = sdb["St"].ToString(), Course = sdb["CN"].ToString() }); } GridView1.DataSource = list; GridView1.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error While getting Data", ex); } }
public void GetData() { try { string Query = "select t1.APP_SCORE_INPUT_ID as ID, t3.STUDENT_NAME as N, t2.ASSESSMENT_NAME as AN, MARKS_OBTAINED as M from APP_SCORE_INPUT t1 inner join APP_SCORE_DESIGN t2 on t1.APP_SCORE_DESIGN_ID = t2.APP_SCORE_DESIGN_ID inner join APP_STUDENT t3 on t1.STUDENT_ID = t3.STUDENT_ID"; SqlDataReader sdb = new MyUtilities.DBUtils().readOperation(Query); List <Scoreinput> list = new List <Scoreinput>(); while (sdb.Read()) { list.Add(new Scoreinput() { Assessment_Name = sdb["AN"].ToString(), ID = sdb["ID"].ToString(), Marks = sdb["M"].ToString(), Student_Name = sdb["N"].ToString() }); } MainGrid.DataSource = list; MainGrid.DataBind(); } catch (Exception ex) { MyUtilities.LogUtils.myLog.Error("Error", ex); } }
private void SelectionData() { new Connections().GetProgram(program); new Students().SelectCourse(Course, program); new Students().GetAcadmicYear(program, Course, Year, 1); new Students().GetSamester(Semsester, Year, Course); new ClOSO().GETCLOs(Clo, Course); GetInsMed(insMethod); string qu = "select t4.program_name as PN, t2.course_name as CN, ACDEMIC_YEAR as Y, t3.CODE_VALUE as S,(select I_CLO.clo_statement as CLOS from I_CLO join APP_INSTRUCTION_METHOD tt1 on I_CLO.clo_id = tt1.CLO_ID where I_CLO.clo_id = tt1.CLO_ID) as CLOS, (select App_CODE.CODE_VALUE as IT from APP_INSTRUCTION_METHOD tq1 join App_CODE on tq1.INSTRUCTION_ID = App_CODE.CODE_ID) as IT 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 inner join App_Program t4 on t2.App_Program_program_id = t4.program_id where COURSE_ENROL_ID = " + IDs + " and t1.UNIVERSITY_ID = (select UNI_ID from App_Instructor where instructor_id = " + Session["LoginID"].ToString() + " ) "; 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; Year.Items.Add(sdb["Y"].ToString()); Year.SelectedIndex = Year.Items.Count - 1; Semsester.Items.Add(sdb["S"].ToString()); Semsester.SelectedIndex = Semsester.Items.Count - 1; Clo.SelectedValue = sdb["CLOS"].ToString(); insMethod.SelectedValue = sdb["IT"].ToString(); } }
protected void btnlogin_Click(object sender, EventArgs e) { SqlDataReader sdb = new MyUtilities.DBUtils().readOperation( "select t2.instructor_name as 'INS', FIRST_TIME_LOGIN_FLAG AS FIRST_LOGIN," + " EMAIL as Email, t1.Username as ID, t1.InstructorID, ac.course_id," + " ac.course_name + ' (' + ac.COURSE_NUMBER + ')' as course_name," + " INSRUCTOR_TYPE as t, EXPERT_SYSTEM_TYPE AS ES_TYPE" + " from Users t1 inner join App_Instructor t2 on t1.InstructorID = t2.instructor_id" + " join app_course ac on ac.course_id = t1.COURSE_ID" + " where t1.Username = '******' and Password = '******';"); Boolean recordExists = false; while (sdb.Read()) { recordExists = true; Session["Instrutor"] = sdb["INS"]; Session["InstructorID"] = sdb["InstructorID"]; Session["LoginID"] = sdb["ID"]; Session["Email"] = sdb["Email"]; Session["CourseID"] = sdb["course_id"]; Session["CourseName"] = sdb["course_name"]; Session["FIRST_LOGIN"] = Boolean.Parse(sdb["FIRST_LOGIN"].ToString()); String esType = sdb["ES_TYPE"].ToString(); String roleType = sdb["t"].ToString(); if (roleType == "2001") // Admin { Session["userTypeId"] = "1"; } else if (roleType == "2002") // Instructor { Session["userTypeId"] = "2"; } else if (roleType == "2003") // Super Admin { Session["userTypeId"] = "3"; } if (esType == "1901") //QUESTION BANK { Session["ESTYPE"] = "1"; } else if (esType == "1902") //IMPROVEMENT PLAN { Session["ESTYPE"] = "2"; } else //if (esType == "1903") //SUPER ADMIN { Session["ESTYPE"] = "3"; } Response.Redirect("/KMSPages/PageRedirection.aspx"); } if (recordExists == false) { TextBox1.Text = "Error: Provided username or password is wrong."; } }