public TagProgramOutcomeRelationship(Tag tag, ProgramOutcome outcome) { Tag = tag; Outcome = outcome; var rel = from tpo in tag.TagProgramOutcomes where tpo.ProgramOutcome == outcome select tpo; AreRelated = rel.SingleOrDefault() != null; }
public bool delProOut(string id) { try { ProgramOutcome dpoe = db.ProgramOutcomes.Where(po => po.id == id).Single(); db.ProgramOutcomes.DeleteOnSubmit(dpoe); db.SubmitChanges(); return(true); } catch { return(false); } }
public bool EditProOut(string id, string no, int type, string content) { try { ProgramOutcome poe = db.ProgramOutcomes.Where(po => po.id == id).Single(); poe.OutcomeNo = no; poe.OutcomeContent = content; poe.OutcomeType = type; db.SubmitChanges(); return(true); } catch { return(false); } }
public bool AddProOut(string idp, string no, int type, string content) { try { ProgramOutcome poc = new ProgramOutcome(); poc.id = createID(); poc.idProgram = idp; poc.OutcomeNo = no; poc.OutcomeType = type; poc.OutcomeContent = content; db.ProgramOutcomes.InsertOnSubmit(poc); db.SubmitChanges(); return(true); } catch { return(false); } }
public ActionResult InsertSyll(Syll data) { List <Syllab> kita = new List <Syllab>(); Syllab res = new Syllab(); Syllab syllabus = new Syllab(); syllabus.User_ID = logID; syllabus.Course_ID = 1; //IList<Syllab> syllablist = new List<Syllab>(); db.Syllabs.Add(syllabus); kita = db.Syllabs.ToList(); foreach (var sud in kita) { if (sud.Course_ID == syllabus.Course_ID) { res = sud; break; } } foreach (PEO p in data.Lpeo) { if (p.Peo_CODE != null && p.Peo_CVA != null && p.Peo_DESC != null) { PEO peo = new PEO(); peo.Peo_CODE = p.Peo_CODE; peo.Peo_DESC = p.Peo_DESC; peo.Peo_CVA = p.Peo_CVA; peo.Syllabus_ID = res.Syllabus_ID; db.PEOs.Add(peo); db.SaveChanges(); } } foreach (ClassroomAndLabPolicy p in data.Lclp) { if (p.CLP_desc != null) { ClassroomAndLabPolicy classroomAndLabPolicies = new ClassroomAndLabPolicy(); classroomAndLabPolicies.CLP_desc = p.CLP_desc; classroomAndLabPolicies.Syllabus_ID = res.Syllabus_ID; db.ClassroomAndLabPolicies.Add(classroomAndLabPolicies); db.SaveChanges(); } } foreach (CourseDeliverableOutputsAndRequirement p in data.Lcodor) { if (p.OutputReq != null && p.OutputReqDesc != null && p.ToA != null && p.Cilo_Add != null) { CourseDeliverableOutputsAndRequirement courseDeliverableOutputsAndRequirements = new CourseDeliverableOutputsAndRequirement(); courseDeliverableOutputsAndRequirements.OutputReq = p.OutputReq; courseDeliverableOutputsAndRequirements.OutputReqDesc = p.OutputReqDesc; courseDeliverableOutputsAndRequirements.Cilo_Add = p.Cilo_Add; courseDeliverableOutputsAndRequirements.ToA = p.ToA; courseDeliverableOutputsAndRequirements.Syllabus_ID = res.Syllabus_ID; db.CourseDeliverableOutputsAndRequirements.Add(courseDeliverableOutputsAndRequirements); db.SaveChanges(); } } foreach (CourseOutcome p in data.Lco) { if (p.CO_Code != null && p.CO_CVA != null && p.CO_DESC != null && p.CO_DOLLevel != null & p.CO_POactivated != null) { CourseOutcome courseOutcomes = new CourseOutcome(); courseOutcomes.CO_Code = p.CO_Code; courseOutcomes.CO_DESC = p.CO_DESC; courseOutcomes.CO_CVA = p.CO_CVA; courseOutcomes.CO_POactivated = p.CO_POactivated; courseOutcomes.CO_DOLLevel = p.CO_DOLLevel; courseOutcomes.Syllabus_ID = res.Syllabus_ID; db.CourseOutcomes.Add(courseOutcomes); db.SaveChanges(); } } foreach (GradingSystem p in data.Lgs) { if (p.GRD_outputs != null && p.GRD_type != null && p.GRD_weight != null) { GradingSystem gradingSystem = new GradingSystem(); gradingSystem.GRD_outputs = p.GRD_outputs; gradingSystem.GRD_type = p.GRD_type; gradingSystem.GRD_weight = p.GRD_weight; gradingSystem.Syllabus_ID = res.Syllabus_ID; db.GradingSystems.Add(gradingSystem); db.SaveChanges(); } } foreach (LearningPlan p in data.Llplan) { if (p.activityL != null && p.activityT != null & p.LPlan_Asses != null && p.LPlan_No_hours != 0 && p.LPlan_Outcome != null && p.LPlan_Topics != null) { LearningPlan learningPlan = new LearningPlan(); learningPlan.LPlan_Outcome = p.LPlan_Outcome; learningPlan.LPlan_No_hours = p.LPlan_No_hours; learningPlan.LPlan_Topics = p.LPlan_Topics; learningPlan.LPlan_Asses = p.LPlan_Asses; learningPlan.activityL = p.activityL; learningPlan.activityT = p.activityT; learningPlan.Syllabus_ID = res.Syllabus_ID; db.LearningPlans.Add(learningPlan); db.SaveChanges(); } } foreach (ProgramOutcome p in data.Lpo) { if (p.PO_Code != null && p.PO_attr != null & p.PO_CVA != null && p.PO_Desc != null) { ProgramOutcome programOutcome = new ProgramOutcome(); programOutcome.PO_Code = p.PO_Code; programOutcome.PO_attr = p.PO_attr; programOutcome.PO_Desc = p.PO_Desc; programOutcome.PO_CVA = p.PO_CVA; programOutcome.Syllabus_ID = res.Syllabus_ID; db.ProgramOutcomes.Add(programOutcome); db.SaveChanges(); } } foreach (Rubric p in data.Lr) { if (p.marginal != null && p.notAcceptable != null & p.outstanding != null && p.competent != null && p.criteria != null) { Rubric rubric = new Rubric(); rubric.competent = p.competent; rubric.criteria = p.criteria; rubric.marginal = p.marginal; rubric.notAcceptable = p.notAcceptable; rubric.outstanding = p.outstanding; rubric.Syllabus_ID = res.Syllabus_ID; db.Rubrics.Add(rubric); db.SaveChanges(); } } return(View()); }
public async Task <ActionResult <ProgramOutcome> > Post([FromODataUri] int departmentId, [FromBody] ProgramOutcome outcome) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } outcome.DepartmentId = departmentId; _context.Outcomes.Add(outcome); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(Get), new { departmentId = departmentId, id = outcome.Id }, outcome)); }
public async Task <IActionResult> Put([FromODataUri] int departmentId, [FromODataUri] int id, [FromBody] ProgramOutcome outcome) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != outcome.Id || departmentId != outcome.DepartmentId) { return(BadRequest()); } _context.Entry(outcome).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProgramOutcomeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }