public ActionResult SubmitUpdatedCriteria(FormCollection fc) { string criterianame = fc["criterianame"].ToString(); int poorpts = Convert.ToInt32(fc["poorpts"]); string poordesc = fc["poordesc"].ToString(); int fairpts = Convert.ToInt32(fc["fairpts"]); string fairdesc = fc["fairdesc"].ToString(); int epts = Convert.ToInt32(fc["epts"]); string edesc = fc["edesc"].ToString(); int spts = Convert.ToInt32(fc["spts"]); string sdesc = fc["sdesc"].ToString(); int webID = Convert.ToInt32(Request.QueryString["WebID"]); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var ac = sm.Assessment_Criteria.SingleOrDefault(b => b.assesmentCriteria_ID == webID); ac.criteriaName = criterianame; ac.poor_pts = poorpts; ac.poor_desc = poordesc.Replace(System.Environment.NewLine, "<br />"); ac.fair_pts = fairpts; ac.fair_desc = fairdesc.Replace(System.Environment.NewLine, "<br />"); ac.satisfactory_pts = spts; ac.satisfactory_desc = sdesc.Replace(System.Environment.NewLine, "<br />"); ac.excellent_pts = epts; ac.excellent_desc = edesc.Replace(System.Environment.NewLine, "<br />"); ac.highestPoints = epts; sm.SaveChanges(); return(RedirectToAction("AssessmentCriteria", "Teacher")); }
// Teacher and Coordinator Learning Plan public ActionResult LearningPlan() { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); //retrieve table details (firstName, lastName, etc.) Learning_Plan d = new Learning_Plan(); //from the table friends, select all in descending order by age var learningList = (from u in syllabus.Learning_Plan join qrter in syllabus.Quarters on u.quarter_FK equals qrter.quarter_ID select new LearningPlan { LearningId = u.learning_ID, CourseOutcomeFK = u.courseOutcome_FK.Value, CourseIdFK = u.course_id_fk, QuarterIdFK = u.quarter_FK, SyllabusIdFK = u.syllabus_FK, LODesc = u.learningOutcomeDesc, hrs = u.hours, topics = u.topics, teacherAct = u.teacherActivity, learnerAct = u.learnerActivity, assessAct = u.assessmentActivity, QuarterName = qrter.quarter_name }).ToList(); //converting all the retrieved data (friends) into a list object ViewData["LearningPlanList"] = learningList; return(View(learningList)); }
public ActionResult insert_grading(FormCollection fc) { string require_grading = fc["requirements"].ToString(); string type_grading = fc["type"].ToString(); double weight_grading = Convert.ToDouble(fc["weight"]); Syllabus_ManagementEntities4 fe = new Syllabus_ManagementEntities4(); Grading_System d = new Grading_System(); d.syllabus_FK = 1; d.typeOfGrading = type_grading; d.weight = weight_grading; d.requirementsName = require_grading; ; try { fe.Grading_System.Add(d); fe.SaveChanges(); ViewBag.Result = "Save Changes"; } catch (Exception e) { ViewBag.Result = "Error! " + e.Message; } return RedirectToAction("grading_system", "Teacher"); }
// Chair Update public ActionResult UpdatedCoreValue(FormCollection cv_info) { //retrieve the Id passed from the update page (Method = "GET") int cv_attrbId = Convert.ToInt32(Request.QueryString["CoreValueAttrbId"]); string cv_desc = cv_info["cvCoreAttrbU"].Replace(System.Environment.NewLine, "<br />"); string cv_CoreValueName = cv_info["cvCoreValueU"]; //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); //retrieve specific table data based from the detail Id (firstName, lastName, etc.) //retrieve table details (firstName, lastName, etc.) //find the id base from the selected var coreValue_FKRet = (from u in syllabus.Core_Value where u.name == cv_CoreValueName select u.coreValue_ID).FirstOrDefault(); var cvaDetail = syllabus.Core_Value_Attribute.SingleOrDefault(b => b.coreValueAttrib_ID == cv_attrbId); //assigning the table data through the input cvaDetail.coreValue_FK = coreValue_FKRet; cvaDetail.description = cv_desc; syllabus.SaveChanges(); return(RedirectToAction("InstGradAttrb", "InstGradAttrb")); //ViewBag.Result = cv_desc; //return View(); }
public ActionResult UpdateNow(FormCollection fc) { string code = fc["code"].ToString(); string desc = fc["desc"].ToString(); string status = fc["status"].ToString(); int id2 = Convert.ToInt32(Request.QueryString["id"]); Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Core_Value cores = new Core_Value(); var stat = (from u in f.Core_Value where u.name == status select u.coreValue_ID).FirstOrDefault(); var d = f.Program_Educational_Objs.SingleOrDefault(b => b.programEduOutcome_ID == id2); d.objectives = code; d.codeName = code; d.coreValue_FK = stat; f.SaveChanges(); return(RedirectToAction("ProgramObj2", "Chairman")); }
// Chair Create public ActionResult AddCoreValue(FormCollection cv_info) { //retrieve data from URL because passed through form string cv_desc = Convert.ToString(Request.QueryString["cvAttrib"]).Replace(System.Environment.NewLine, "<br />"); string cv_CoreValueName = Convert.ToString(Request.QueryString["cvCoreValue"]); //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); //retrieve table details (firstName, lastName, etc.) Core_Value_Attribute cv_a = new Core_Value_Attribute(); Core_Value cv = new Core_Value(); //find the id base from the selected var core_val = (from u in syllabus.Core_Value where u.name == cv_CoreValueName select u); //assigning the table data through the input using only the FIRST cv_a.coreValue_FK = core_val.First().coreValue_ID; cv_a.description = cv_desc; try { //add data to db syllabus.Core_Value_Attribute.Add(cv_a); //save data to db syllabus.SaveChanges(); } catch (Exception) { } return(RedirectToAction("InstGradAttrb", "InstGradAttrb")); }
// Add Software Used public ActionResult SoftwareUsedAdd(FormCollection software) { //retrieve the Id passed from the update page (Method = "GET") int syllabusIDFK = Convert.ToInt32(Request.QueryString["syllabusId"]); string softUsed = software["software"].ToString(); //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); //retrieve specific table data based from the detail Id (firstName, lastName, etc.) Software_Used s = new Software_Used(); //assigning the table data through the input s.syllabus_FK = syllabusIDFK; s.software = softUsed.Replace(System.Environment.NewLine, "<br />"); try { //add data to db syllabus.Software_Used.Add(s); //save data to db syllabus.SaveChanges(); ViewBag.Result = "Saved"; } catch (Exception e) { ViewBag.Result = "Not Saved" + e.Message; } syllabus.SaveChanges(); return(RedirectToAction("SoftwareUsed", "SoftwareUsed")); }
public ActionResult insert_revision(FormCollection getRevisionDetails) { string items = getRevisionDetails["revision_items"].ToString(); string revisedBy = getRevisionDetails["revision_revisedBy"].ToString(); string revisionDate = getRevisionDetails["revision_revisionDate"].ToString(); string approvedBy = getRevisionDetails["revision_approvedBy"].ToString(); string approvedDate = getRevisionDetails["revision_approvedDate"].ToString(); Syllabus_ManagementEntities4 fe = new Syllabus_ManagementEntities4(); Revision getTable = new Revision(); getTable.syllabus_FK = 1; getTable.versionNum = 1.0; getTable.fieldsRevised = items; getTable.dateRevised = revisionDate; getTable.approvedDate = approvedDate; getTable.revisedBy = revisedBy; getTable.approvedBy = approvedBy; try { fe.Revisions.Add(getTable); fe.SaveChanges(); ViewBag.Result = "Save Changes"; } catch (Exception) { ViewBag.Result = "Error! "; } return RedirectToAction("revision_history", "Teacher"); }
public ActionResult AddDeli(FormCollection fc) { string code = fc["code"].ToString(); string desc = fc["desc"].ToString(); int co = 7; string ass1 = fc["ass1"].ToString(); string ass2 = fc["ass2"].ToString(); int syllabus = 1; Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Course_Deliverable d = new Course_Deliverable(); d.outputName = code; d.output_description = desc; d.courseOutcomeAddressed_FK = co; d.assessmentTypeA = ass1; d.assessmentTypeB = ass2; d.syllabus_FK = syllabus; try { f.Course_Deliverable.Add(d); f.SaveChanges(); ViewBag.Result = "Saved"; } catch (Exception e) { ViewBag.Result = e; } return(RedirectToAction("outputs_requirements", "Teacher")); //return View("../teacher/outputs_requirements"); }
// Teacher and Coordinator Learning Plan //Note CO Addressed and Academic Term updated yet because no value public ActionResult LearningPlanUpdated(FormCollection fc) { Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); Learning_Plan p = new Learning_Plan(); //string topics = lp_info["topics"]; //int hrs = Convert.ToInt32(lp_info["noOfHrs"]); int learningPlanId = Convert.ToInt32(Request.QueryString["learn_id"]); string learning_outcome = fc["learningOutcome"]; int hours = Convert.ToInt32(fc["noOfHrs"]); string topics = fc["topics"]; string teacher_act = fc["teacherAct"]; string learner_act = fc["learnAct"]; string ass_act = fc["assessAct"]; var d = syllabus.Learning_Plan.SingleOrDefault(b => b.learning_ID == learningPlanId); d.learningOutcomeDesc = learning_outcome; d.hours = hours; d.topics = topics.Replace(System.Environment.NewLine, "<br />"); d.teacherActivity = teacher_act.Replace(System.Environment.NewLine, "<br />"); d.learnerActivity = learner_act.Replace(System.Environment.NewLine, "<br />"); d.assessmentActivity = ass_act.Replace(System.Environment.NewLine, "<br />"); try { syllabus.SaveChanges(); } catch (Exception e) { ViewBag.Result = e; } return(RedirectToAction("LearningPlan", "LearningPlan")); }
// Teacher and Coordinator Learning Plan public ActionResult LearningPlanAddData(FormCollection lp_info) { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); int syllabusIdFK = Convert.ToInt32(Request.QueryString["syllabusIdFK"]); int courseIdFK = Convert.ToInt32(Request.QueryString["courseIdFK"]); string quarter = lp_info["academicTerm"]; //static as of the moment int co_IdFk = Convert.ToInt32("1"); int quarterValue_FKRet = (from u in syllabus.Quarters where u.quarter_name == quarter select u.quarter_ID).FirstOrDefault(); string lOutcome = lp_info["learningOutcome"]; int hrs = Convert.ToInt32(lp_info["noOfHrs"]); string topics = lp_info["topics"]; string teachAct = lp_info["teacherAct"]; string learnAct = lp_info["learnAct"]; string assessAct = lp_info["assessAct"]; if (assessAct == " ") { assessAct = null; } Learning_Plan lp = new Learning_Plan(); //assigning the table data through the input lp.courseOutcome_FK = co_IdFk; lp.course_id_fk = courseIdFK; lp.quarter_FK = quarterValue_FKRet; lp.syllabus_FK = syllabusIdFK; lp.learningOutcomeDesc = lOutcome.Replace(System.Environment.NewLine, "<br />"); lp.hours = hrs; lp.topics = topics.Replace(System.Environment.NewLine, "<br />"); lp.teacherActivity = teachAct.Replace(System.Environment.NewLine, "<br />"); lp.learnerActivity = learnAct.Replace(System.Environment.NewLine, "<br />"); lp.assessmentActivity = assessAct.Replace(System.Environment.NewLine, "<br />"); try { //add data to db syllabus.Learning_Plan.Add(lp); //save data to db syllabus.SaveChanges(); ViewBag.Result = "Saved"; } catch (Exception e) { ViewBag.Result = "Not Saved" + e.Message; } return(RedirectToAction("LearningPlan", "LearningPlan")); }
public ActionResult outputs_requirements() { Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); Course_Deliverable D = new Course_Deliverable(); var deliverableList = (from u in sm.Course_Deliverable select u); ViewData["ListOfDeliverables"] = deliverableList.ToList(); return View(); }
public ActionResult revision_history() { Syllabus_ManagementEntities4 revise = new Syllabus_ManagementEntities4(); Revision revised = new Revision(); var reviseList = (from u in revise.Revisions select u); ViewData["ListOfRevisions"] = reviseList.ToList(); return View(); }
// GET: Chairman public ActionResult ViewAllChSyllabus() { Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); Syllabu s = new Syllabu(); var syllabusList = (from u in sm.Syllabus select u); ViewData["ListofSyllabus_C"] = syllabusList.ToList(); return(View()); }
public ActionResult UpdateCriteria() { int webID = Convert.ToInt32(Request.QueryString["WebID"]); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var ac = (from p in sm.Assessment_Criteria where p.assesmentCriteria_ID == webID select p).FirstOrDefault(); ViewData["ACInfo"] = ac; return(View()); }
// Add/Edit Software Used public ActionResult SoftwareUsedDelete() { Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); int softUID = Convert.ToInt32(Request.QueryString["softUID"]); var delData = (from u in syllabus.Software_Used where u.softwareUsed_ID == softUID select u).FirstOrDefault(); syllabus.Software_Used.Remove(delData); syllabus.SaveChanges(); return(RedirectToAction("SoftwareUsed", "SoftwareUsed")); }
public ActionResult EditPolicy(FormCollection fc) { int policyID = Convert.ToInt32(fc["policyID_uneditable"]); string edited = fc["policyName"].ToString(); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var policy = sm.Class_Policy.SingleOrDefault(b => b.policy_ID == policyID); policy.policyItem = edited; var res = sm.SaveChanges(); return(RedirectToAction("EditClassroomPolicies", "Syllabus")); }
// Edit Software Used public ActionResult SoftwareUsedUpdate() { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); int softUID = Convert.ToInt32(Request.QueryString["softUid"]); var retOneData = (from u in syllabus.Software_Used where u.softwareUsed_ID == softUID select u).FirstOrDefault(); ViewData["SoftwareUsed"] = retOneData; return(View()); }
public ActionResult DeleteBook() { int bookID = Convert.ToInt32(Request.QueryString["BookID"]); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var c = (from p in sm.Books where p.book_id == bookID select p).FirstOrDefault(); sm.Books.Remove(c); sm.SaveChanges(); return(RedirectToAction("Bibliography", "Teacher")); }
public ActionResult DeleteOnlineResource() { int webID = Convert.ToInt32(Request.QueryString["WebID"]); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var webrow = (from p in sm.Online_Sources where p.onlineSource_ID == webID select p).FirstOrDefault(); sm.Online_Sources.Remove(webrow); sm.SaveChanges(); return(RedirectToAction("Bibliography", "Teacher")); }
public ActionResult DeleteCriteria() { int webID = Convert.ToInt32(Request.QueryString["WebID"]); Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); var ac = (from p in sm.Assessment_Criteria where p.assesmentCriteria_ID == webID select p).FirstOrDefault(); sm.Assessment_Criteria.Remove(ac); sm.SaveChanges(); return(RedirectToAction("AssessmentCriteria", "Teacher")); }
// Chair Update public ActionResult UpdateCoreValue(FormCollection cv_info) { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); int cv_attr_id = Convert.ToInt32(Request.QueryString["coreValAttrIdU"]); var retOneData = (from u in syllabus.Core_Value_Attribute where u.coreValueAttrib_ID == cv_attr_id select u).FirstOrDefault(); ViewData["OneDetailCVA"] = retOneData; return(View()); }
public ActionResult DeletePolicy(FormCollection fc) { Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); int policyID = Convert.ToInt32(Request.QueryString["PolicyID"]); var c = (from p in sm.Class_Policy where p.policy_ID == policyID select p).FirstOrDefault(); sm.Class_Policy.Remove(c); sm.SaveChanges(); return(RedirectToAction("EditClassroomPolicies", "Syllabus")); }
// Chair Delete public ActionResult DeleteCoreValue(FormCollection cv_info) { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); int cv_attr_id = Convert.ToInt32(Request.QueryString["coreValAttrIdD"]); var delData = (from u in syllabus.Core_Value_Attribute where u.coreValueAttrib_ID == cv_attr_id select u).FirstOrDefault(); syllabus.Core_Value_Attribute.Remove(delData); syllabus.SaveChanges(); return(RedirectToAction("InstGradAttrb", "InstGradAttrb")); }
// Add/Edit Software Used public ActionResult SoftwareUsed() { //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); //retrieve table details (firstName, lastName, etc.) Software_Used d = new Software_Used(); //from the table friends, select all in descending order by age var detailS = (from u in syllabus.Software_Used select u).FirstOrDefault(); //converting all the retrieved data (friends) into a list object ViewData["SoftwareUsed"] = detailS; return(View()); }
// Teacher and Coordinator Learning Plan public ActionResult LearningPlanAdd() { //connect to db Syllabus_ManagementEntities4 term = new Syllabus_ManagementEntities4(); //retrieve table details (firstName, lastName, etc.) Quarter q = new Quarter(); //from the table friends, select all in descending order by age var quarterList = (from u in term.Quarters select u); //converting all the retrieved data (friends) into a list object ViewData["QuarterList"] = quarterList.ToList(); return(View()); }
// Teacher and Coordinator Learning Plan public ActionResult LearningPlanDelete() { int learningPlanId = Convert.ToInt32(Request.QueryString["lpId"]); //connect to db Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4(); var delData = (from u in syllabus.Learning_Plan where u.learning_ID == learningPlanId select u).FirstOrDefault(); syllabus.Learning_Plan.Remove(delData); syllabus.SaveChanges(); return(RedirectToAction("LearningPlan", "LearningPlan")); }
public ActionResult DeleteThings() { Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Program_Educational_Objs d = new Program_Educational_Objs(); int ids = Convert.ToInt32(Request.QueryString["ids"]); var c = (from p in f.Program_Educational_Objs where p.programEduOutcome_ID == ids select p).FirstOrDefault(); f.Program_Educational_Objs.Remove(c); f.SaveChanges(); return(RedirectToAction("ProgramObj2", "Chairman")); }
public ActionResult UpdateDeliverablesAndRequirements() { Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4(); Course_Deliverable d = new Course_Deliverable(); int id = Convert.ToInt32(Request.QueryString["DRID"]); var c = (from u in sm.Course_Deliverable where u.courseDeliverables_ID == id select u).FirstOrDefault(); ViewBag.id = c.courseDeliverables_ID; ViewBag.name = c.outputName; ViewBag.desc = c.output_description; ViewBag.ass1 = c.assessmentTypeA; ViewBag.ass2 = c.assessmentTypeB; return(View()); }
public ActionResult ProgramObj2() { Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4(); Program_Educational_Objs d = new Program_Educational_Objs(); var detailList = (from u in f.Core_Value select u); ViewData["cores"] = detailList.ToList(); var proEduOut = (from u in f.Program_Educational_Objs join newer in f.Core_Value on u.coreValue_FK equals newer.coreValue_ID select u); ViewData["listOfProEdu"] = proEduOut.ToList(); return(View()); }