Ejemplo n.º 1
0
        // 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"));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "activeValues_ID,columnName,programOutcomeAbbr,activeStatus,courseOutcomes_FK")] Active_Values active_Values)
        {
            if (ModelState.IsValid)
            {
                db.Active_Values.Add(active_Values);
                db.SaveChanges();
                return(RedirectToAction("ShowResults", active_Values));
            }

            ViewBag.courseOutcomes_FK = new SelectList(db.Course_Outcomes, "courseOutcomes_ID", "codeName", active_Values.courseOutcomes_FK);
            return(View(active_Values));
        }
Ejemplo n.º 3
0
        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"));
        }
Ejemplo n.º 4
0
        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");
        }
Ejemplo n.º 5
0
        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"));
        }
Ejemplo n.º 6
0
        // 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"));
        }
Ejemplo n.º 7
0
        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");
        }
Ejemplo n.º 8
0
         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");
        }
Ejemplo n.º 9
0
        // 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();
        }
Ejemplo n.º 10
0
        // 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"));
        }
Ejemplo n.º 11
0
        // 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"));
        }
Ejemplo n.º 12
0
        public ActionResult Create([Bind(Include = "courseOutcomes_ID,syllabus_FK,codeName,outcomeDescription,domainLearningLVL")] Course_Outcomes course_Outcomes)
        {
            if (ModelState.IsValid)
            {
                db.Course_Outcomes.Add(course_Outcomes);
                db.SaveChanges();

                db.Entry(course_Outcomes).GetDatabaseValues();
                int newID      = course_Outcomes.courseOutcomes_ID;
                int numOfPO    = db.Program_Outcomes.Select(d => d.code_outcome).Distinct().Count();
                int syllabusID = course_Outcomes.syllabus_FK;
                PopulateModels(numOfPO, newID);

                return(RedirectToAction("ShowResults", "Active_Values", new { id = syllabusID }));
            }

            ViewBag.syllabus_FK = new SelectList(db.Syllabus, "syllabus_ID", "title", course_Outcomes.syllabus_FK);
            return(View(course_Outcomes));
        }
Ejemplo n.º 13
0
 public ActionResult Create([Bind(Include = "madeBy_FK, course_FK, title, academicYear, academicPeriod, status")]Syllabu newSyllabus)
 {
     if (ModelState.IsValid)
     {
         sm.Syllabus.Add(newSyllabus);
         sm.SaveChanges();
         return RedirectToAction("Creation");
     }
     return View("Creation");
 }
Ejemplo n.º 14
0
        // 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"));
        }
Ejemplo n.º 15
0
        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"));
        }
Ejemplo n.º 16
0
        // 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"));
        }
Ejemplo n.º 17
0
        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"));
        }
Ejemplo n.º 18
0
        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"));
        }
Ejemplo n.º 19
0
        public ActionResult AddNewPolicyToDB(FormCollection fc)
        {
            //int syllabusID = Convert.ToInt32(Request.QueryString["SyllabusID"]);
            int          syllabusID = 1;
            string       policy     = fc["PolicyString"].ToString();
            Class_Policy cp         = new Class_Policy();

            cp.policyItem  = policy;
            cp.syllabus_FK = syllabusID;

            try
            {
                sm.Class_Policy.Add(cp);
                sm.SaveChanges();
                ViewBag.Result = "Saved";
            }
            catch
            {
                ViewBag.Result = "Not saved";
            }

            return(RedirectToAction("ClassroomPolicy", "Teacher"));
        }
Ejemplo n.º 20
0
        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"));
        }
Ejemplo n.º 21
0
        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"));
        }
Ejemplo n.º 22
0
        // 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"));
        }
Ejemplo n.º 23
0
        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"));
        }
Ejemplo n.º 24
0
        // Update to DB Software Used
        public ActionResult SoftwareUsedUpdated(FormCollection software)
        {
            //retrieve the Id passed from the update page (Method = "GET")
            int    softUID      = Convert.ToInt32(Request.QueryString["softUid"]);
            string syllabusDesc = software["software"];


            //connect to db
            Syllabus_ManagementEntities4 syllabus = new Syllabus_ManagementEntities4();
            //retrieve specific table data based from the detail Id (firstName, lastName, etc.)
            var softwareDetail = syllabus.Software_Used.SingleOrDefault(b => b.softwareUsed_ID == softUID);

            //assigning the table data through the input
            softwareDetail.software = syllabusDesc.Replace(System.Environment.NewLine, "<br />");

            syllabus.SaveChanges();
            return(RedirectToAction("SoftwareUsed", "SoftwareUsed"));
        }
Ejemplo n.º 25
0
        //------- ASSESSMENT CRITERIA ------- //

        public ActionResult AddNewCriteria(FormCollection fc)
        {
            string criterianame = fc["n_criterianame"].ToString();
            string poordesc     = fc["n_poordesc"].ToString();
            string fairdesc     = fc["n_fairdesc"].ToString();
            string edesc        = fc["n_edesc"].ToString();
            string sdesc        = fc["n_sdesc"].ToString();
            int    poorpts      = Convert.ToInt32(fc["n_poorpts"]);
            int    fairpts      = Convert.ToInt32(fc["n_fairpts"]);
            int    epts         = Convert.ToInt32(fc["n_epts"]);
            int    spts         = Convert.ToInt32(fc["n_spts"]);

            Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4();
            Assessment_Criteria          ac = new Assessment_Criteria();

            ac.syllabus_FK       = 1; // static
            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;

            try
            {
                sm.Assessment_Criteria.Add(ac);
                sm.SaveChanges();
                ViewBag.Result = "Saved";
            }
            catch (Exception e)
            {
                ViewBag.Result = e;
            }

            return(RedirectToAction("AssessmentCriteria", "Teacher"));

            /*return View()*/
            ;
        }
Ejemplo n.º 26
0
        public ActionResult DeleteDeliverablesAndRequirements()
        {
            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();

            try
            {
                sm.Course_Deliverable.Remove(c);
                sm.SaveChanges();
            }
            catch (Exception e) {
                ViewBag.Result = e;
            }
            return(RedirectToAction("outputs_requirements", "Teacher"));
        }
Ejemplo n.º 27
0
        public ActionResult ProgramEduObj(FormCollection fc)
        {
            string code   = fc["code"].ToString();
            string desc   = fc["desc"].ToString();
            string status = fc["status"].ToString();
            int    sylid  = 1;



            Syllabus_ManagementEntities4 f = new Syllabus_ManagementEntities4();
            Program_Educational_Objs     d = new Program_Educational_Objs();

            var coreid = (from u in f.Core_Value where u.name == status select u.coreValue_ID).FirstOrDefault();

            ViewBag.code   = code;
            ViewBag.desc   = desc;
            ViewBag.status = status;
            ViewBag.coreid = coreid;

            d.objectives   = desc;
            d.codeName     = code;
            d.syllabus_FK  = sylid;
            d.coreValue_FK = Convert.ToInt32(coreid);


            try
            {
                f.Program_Educational_Objs.Add(d);
                f.SaveChanges();
                ViewBag.Result = "Saved";
            }
            catch (Exception e)
            {
                ViewBag.Result = e;
            }
            return(RedirectToAction("ProgramObj2", "Chairman"));
        }
Ejemplo n.º 28
0
        public ActionResult UpdateNow2(FormCollection fc)
        {
            int    id   = Convert.ToInt32(Request.QueryString["id"]);
            string name = fc["name"].ToString();
            string desc = fc["desc"].ToString();
            string ass1 = fc["ass1"].ToString();
            string ass2 = fc["ass2"].ToString();

            Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4();
            Course_Deliverable           d  = new Course_Deliverable();

            var c = (from u in sm.Course_Deliverable
                     where u.courseDeliverables_ID == id
                     select u).FirstOrDefault();

            c.outputName         = name;
            c.output_description = desc;
            c.assessmentTypeA    = ass1;
            c.assessmentTypeB    = ass2;

            sm.SaveChanges();

            return(RedirectToAction("outputs_requirements", "Teacher"));
        }
Ejemplo n.º 29
0
        // --------------- BOOKS ---------------- //

        public ActionResult UpdateBooks(FormCollection fc)
        {
            //int courseID = Convert.ToInt32(Request.QueryString["CourseID"]);
            string bID = fc["BookID"].ToString();


            if (bID == "")
            {
                ViewBag.res = "add";
                string cnum   = fc["CallNumber"].ToString();
                string title  = fc["Title"].ToString();
                string author = fc["Author"].ToString();
                int    year   = Convert.ToInt32(fc["Year"].ToString());

                Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4();
                Book b = new Book();
                b.course_fk  = 1;
                b.callNumber = cnum;
                b.title      = title;
                b.author     = author;
                b.year       = year;

                try
                {
                    sm.Books.Add(b);
                    sm.SaveChanges();

                    //Book fb = new Book();
                    //var d = sm.Books.SingleOrDefault(newBook => fb.title == title);
                    //ViewBag.bID = d.book_id;
                    //Source s = new Source();
                    //s.type_of_resource = "book";
                    //s.resource_fk = d.book_id;
                    //sm.Sources.Add(s);
                    ViewBag.Result = "Saved";
                }
                catch (Exception e)
                {
                    ViewBag.Result = e;
                }
            }
            else
            {
                Syllabus_ManagementEntities4 sm = new Syllabus_ManagementEntities4();
                ViewBag.res = "update";
                int    bookID = Convert.ToInt32(bID);
                var    book   = sm.Books.SingleOrDefault(b => b.book_id == bookID);
                string cnum   = fc["CallNumber"].ToString();
                string title  = fc["Title"].ToString();
                string author = fc["Author"].ToString();
                int    year   = Convert.ToInt32(fc["Year"].ToString());

                book.callNumber = cnum;
                book.title      = title;
                book.author     = author;
                book.year       = year;
                book.course_fk  = 1;

                sm.SaveChanges();
            }

            return(RedirectToAction("Bibliography", "Teacher"));
            //return View();
        }