/// <summary>
        /// Export name to a section in a document
        /// </summary>
        /// <param name="toExport">The data to export from</param>
        /// <param name="sect">The section to write on</param>
        /// <returns>The section with appended data</returns>
        public override Section Export(Leerlijn toExport, Section sect)
        {
            base.Export(toExport, sect);

            //custom code
            Paragraph p = sect.AddParagraph("Competenties in deze Leerlijn", "Heading2");

            p.AddLineBreak();

            p = sect.AddParagraph();

            List <Competentie> accumulatedCompetences = new List <Competentie>();

            foreach (Module m in toExport.Module)
            {
                accumulatedCompetences = new List <Competentie>();
                foreach (ModuleCompetentie mc in m.ModuleCompetentie)
                {
                    if (!accumulatedCompetences.Contains(mc.Competentie))
                    {
                        accumulatedCompetences.Add(mc.Competentie);
                    }
                }
            }

            foreach (Competentie c in accumulatedCompetences)
            {
                p.AddText(" - " + (c.Naam ?? "Data incompleet"));
                p.AddLineBreak();
            }
            p.AddLineBreak();

            return(sect);
        }
 public ActionResult Delete(Leerlijn entity)
 {
     try
     {
         var value = _unitOfWork.GetRepository <Leerlijn>().Delete(entity);
         return(value != null?Json(new { success = false, strError = value }) : Json(new { success = true }));
     }
     catch (Exception)
     {
         return(Json(new { success = false }));
     }
 }
        /// <summary>
        /// Export name to a section in a document
        /// </summary>
        /// <param name="toExport">The data to export from</param>
        /// <param name="sect">The section to write on</param>
        /// <returns>The section with appended data</returns>
        public override Section Export(Leerlijn toExport, Section sect)
        {
            base.Export(toExport, sect);

            //custom code
            Paragraph p = sect.AddParagraph();

            p.AddFormattedText((toExport.Naam ?? "Data niet gevonden"), "Heading1");
            p.Format.OutlineLevel = OutlineLevel.Level1;
            p.AddBookmark((toExport.Naam ?? "Data niet gevonden"));
            p.AddLineBreak();

            return(sect);
        }
        /// <summary>
        /// Voegt de leerlijnen toe aan het object met daarbij de vulling van de deellijnen.
        /// </summary>
        /// <param name="leerlijn"></param>
        public void AddLeerlijnen(Leerlijn leerlijn)
        {
            if (leerlijn != null)
            {
                LeerlijnViewModel Leerlijn = new ViewModels.LeerlijnViewModel();

                Leerlijn.Naam = leerlijn.Vakgebied.Naam;
                foreach (var deellijn in leerlijn.Deellijnen)
                {
                    Leerlijn.ExecuteAddDeellijn(deellijn);
                }
                Leerlijnen.Add(Leerlijn);
            }
        }
        public ActionResult Delete(string naam, string schooljaar)
        {
            if (naam == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Leerlijn leerlijn = _unitOfWork.GetRepository <Leerlijn>().GetOne(new object[] { naam, schooljaar });

            if (leerlijn == null)
            {
                return(HttpNotFound());
            }

            return(PartialView("~/Views/Admin/Curriculum/Leerlijn/_Delete.cshtml", leerlijn));
        }
Example #6
0
        /// <summary>
        /// Export name to a section in a document
        /// </summary>
        /// <param name="toExport">The data to export from</param>
        /// <param name="sect">The section to write on</param>
        /// <returns>The section with appended data</returns>
        public override Section Export(Leerlijn toExport, Section sect)
        {
            base.Export(toExport, sect);

            //custom code
            Paragraph p = sect.AddParagraph("Modules in deze leerlijn", "Heading2");

            p.AddLineBreak();

            p = sect.AddParagraph();
            p.AddFormattedText("De leerlijnen zijn klikbaar in PDF viewers").Font.Color = Colors.DarkGray;
            p.AddLineBreak();
            p.AddLineBreak();

            foreach (Module m in toExport.Module)
            {
                p.AddFormattedText((m.Naam ?? "Data niet gevonden")).Font.Bold = true;
                p.AddLineBreak();

                p.AddFormattedText("Komt ook voor in:").Font.Color = Colors.DarkGray;
                p.AddLineBreak();

                List <Leerlijn> otherLines = m.Leerlijn.ToList();
                foreach (Leerlijn l in otherLines)
                {
                    if (!l.Naam.Equals(toExport.Naam))
                    {
                        p.AddTab();
                        Hyperlink hyperlink = p.AddHyperlink((l.Naam ?? "Data niet gevonden"));
                        hyperlink.AddText((l.Naam ?? "Data niet gevonden") + ", zie ook pagina ");
                        hyperlink.AddPageRefField((l.Naam ?? "Data niet gevonden"));
                        hyperlink.Font.Underline = Underline.Single;

                        p.AddLineBreak();
                    }
                }
                p.AddLineBreak();
            }

            return(sect);
        }
        public ActionResult Create(Leerlijn entity)
        {
            try
            {
                var schooljaren = _unitOfWork.GetRepository <Schooljaar>().GetAll().ToArray();
                if (!schooljaren.Any())
                {
                    return(Json(new { success = false }));
                }
                var schooljaar = schooljaren.Last();

                entity.Schooljaar = schooljaar.JaarId;

                var value = _unitOfWork.GetRepository <Leerlijn>().Create(entity);
                return(value != null?Json(new { success = false, strError = value }) : Json(new { success = true }));
            }
            catch (Exception)
            {
                return(Json(new { success = false }));
            }
        }
        public ActionResult Create()
        {
            var leerlijn = new Leerlijn();

            return(PartialView("~/Views/Admin/Curriculum/Leerlijn/_Add.cshtml", leerlijn));
        }