public async Task <IActionResult> editResumeData(int id, ResumeData resumeData)
        {
            _context.Entry(resumeData).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ResumeDataExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            //var updatedResume = await _context.ResumeData
            //    .Where(r => r.ResumeId == id)
            //    .Include(s => s.Links)
            //    .Include(w => w.WorkData)
            //    .Include(w => w.Education)
            //    .Include(w => w.Language)
            //    .Include(w => w.Projects)
            //    .Include(w => w.Recommends)
            //    .Include(w => w.Skills)
            //    .FirstOrDefaultAsync();

            return(NoContent());
        }
Exemplo n.º 2
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData data)
        {
            yield return(new ResumeParagraph(data.DocumentTitle)
                         .SetSectionHeaderStyle()
                         .SetHorisontalAlignment(ElementAlignmnet.Center));

            var relativeColumnWidths = new float[] { 25, 25, 25, 25 };

            yield return(new ResumeTable(relativeColumnWidths)
            {
                new ResumeTableRow()
                {
                    new ResumeTableCell("Telephone"),
                    new ResumeTableCell(data.Telephone),
                    new ResumeTableCell("Email"),
                    new ResumeTableCell(data.Email),
                },
                new ResumeTableRow()
                {
                    new ResumeTableCell("Experience"),
                    new ResumeTableCell(data.ExperienceYears + " year(s)"),
                    new ResumeTableCell("Country of Residence"),
                    new ResumeTableCell(data.ResidenceCountry),
                }
            });
        }
Exemplo n.º 3
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData data)
        {
            if (!data.EmploymentHistories.Any())
            {
                yield break;
            }

            yield return(new ResumeParagraph("Employment History").SetSectionHeaderStyle());


            var table = new ResumeTable(new float[] { 15, 15, 15, 60 })
            {
                new ResumeTableRow()
                {
                    new ResumeTableCell("Period"),
                    new ResumeTableCell("Company"),
                    new ResumeTableCell("Position"),
                    new ResumeTableCell("Description"),
                }
            };

            foreach (var record in data.EmploymentHistories)
            {
                var row = new ResumeTableRow()
                {
                    new ResumeTableCell(String.Format("{0:y} - {1:y}", record.StartDate, record.EndDate)),
                    new ResumeTableCell(record.EmployerName),
                    new ResumeTableCell(record.Position),
                    new ResumeTableCell(record.Description),
                };
                table.Add(row);
            }

            yield return(table);
        }
Exemplo n.º 4
0
 public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
 {
     if (SectionSpecification.IsSatisfiedBy(resumeData))
     {
         return(TruthSection.ProduceElements(resumeData));
     }
     return(Enumerable.Empty <IResumeElement>());
 }
        public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
        {
            yield return(new ResumeParagraph("Citizen Secrets").SetSectionHeaderStyle());

            foreach (var secret in resumeData.CitizenSecrets)
            {
                yield return(new ResumeParagraph(secret.SecretInformation));
            }
        }
        public ActionResult <ResumeData> SaveToMongoDB([FromBody] ResumeData request)
        {
            var req     = request;
            var utcTime = DateTime.UtcNow;

            req.Name        = string.Format("{0} {1}", request.PersonalInfo.CurrentOccupation, "Resume");
            req.CreatedTime = utcTime;
            req.UpdatedTime = utcTime;

            return(Ok(_resumeStoreService.Create(request)));
        }
 public ActionResult Index(HomeModel model)
 {
     ViewBag.Title     = "Home Page";
     model.Skills      = ResumeData.GetSkills();
     model.WorkHistroy = ResumeData.GetJobs();
     model.Education   = ResumeData.GetDegrees();
     model.Interests   = ResumeData.GetInterests();
     model.FAQ         = ResumeData.GetFAQ();
     model.LinkedInUrl = WebConfigurationManager.AppSettings["LinkedInUrl"];
     model.GithubUrl   = WebConfigurationManager.AppSettings["GitHubUrl"];
     return(View(model));
 }
Exemplo n.º 8
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
        {
            var result = new List <IResumeElement>();

            foreach (var section in Sections)
            {
                var sectionElements = section.ProduceElements(resumeData);
                result.AddRange(sectionElements);
            }

            return(result);
        }
        public async Task <ActionResult <ResumeData> > CreateResume(ResumeData resumeData)
        {
            int userId = resumeData.UserId;

            _context.ResumeData.Add(resumeData);
            await _context.SaveChangesAsync();

            var userData = await _context.ResumeData
                           .Where(u => u.UserId == userId).Select(p => new { p.ResumeId, p.ResumeName, p.Layout })
                           .ToListAsync();

            return(Ok(userData));
        }
Exemplo n.º 10
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
        {
            yield return(new ResumeParagraph("Sample text for demonstration"));

            yield return(new ResumeBulletedList()
            {
                Paragraphs = new List <ResumeParagraph>()
                {
                    new ResumeParagraph("Bullet Point One"),
                    new ResumeParagraph("Bullet Point Two"),
                }
            });
        }
Exemplo n.º 11
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData data)
        {
            yield return(new ResumeParagraph("Membership").SetSectionHeaderStyle());

            var bulletedList = new ResumeBulletedList();

            foreach (var membership in data.OrganisationsMemberships)
            {
                bulletedList.AddParagraph(String.Format("{0} - {1}", membership.OrganisationName, membership.MembershipName));
            }

            yield return(bulletedList);
        }
Exemplo n.º 12
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
        {
            yield return(new ResumeParagraph("Certifications").SetSectionHeaderStyle());

            var bulletedList = new ResumeBulletedList();

            foreach (var certification in resumeData.Certifications)
            {
                var text = String.Format("{0} {1:y} - {2:y}", certification.CertificationName, certification.StartDate, certification.ExpiryDate);
                bulletedList.AddParagraph(text);
            }

            yield return(bulletedList);
        }
Exemplo n.º 13
0
        protected override void _Save(FileActivity activity, ResumeResult data)
        {
            if (activity.IsChanged)
            {
                _conn.ExecuteScalar(string.Format("delete from resumelist where guid='{0}';delete from resumedetaillist where guid='{0}';", activity.HashCode));
            }

            DateTime dateTime = DateTime.Now;

            ResumeData resumeData = data.ResumeInfo;

            //记录简历信息
            _conn.ExecuteNonQuery(string.Format(InsertResumeSql, activity.HashCode, resumeData.Name, resumeData.Age, resumeData.Gender, resumeData.Phone, resumeData.Email, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.LatestDegree, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.Residence, activity.FilePath, "本地计算机", resumeData.WorkYears, dateTime.ToString(DateFormat), dateTime.ToUniversalTime(), Dorado.SystemInfo.SystemInfo.GetMacAddress(), data.Text));
        }
Exemplo n.º 14
0
        public IEnumerable <IResumeElement> ProduceElements(ResumeData resumeData)
        {
            yield return(new ResumeParagraph("Education").SetSectionHeaderStyle());

            foreach (var education in resumeData.Educations)
            {
                var header = String.Format("{0:y} - {1:y} {2}", education.StartDate, education.EndDate, education.Establishment);
                yield return(new ResumeParagraph(header).SetFont(new ResumeFont()
                                                                 .SetSize(12)
                                                                 .SetFontWeight(ResumeFontWeight.Bold)));

                var details = String.Format("{0} {1} {2}", education.DegreeLevel, education.CourseName, education.AcheivementLevel);
                yield return(new ResumeParagraph(details));
            }
        }
Exemplo n.º 15
0
        protected void RenderElements(IEnumerable <IResumeSection> resumeSections, ResumeData data)
        {
            var elementRenderers = GetElementRenderers();

            foreach (var section in resumeSections)
            {
                var elements = section.ProduceElements(data);

                // do the rendering
                foreach (var element in elements)
                {
                    var elementRenderer = elementRenderers[element.GetType()];
                    elementRenderer.Invoke(element);
                }
            }
        }
        public IActionResult Update(string id, [FromBody] ResumeData resume)
        {
            var res = _resumeStoreService.Get(id);

            if (res == null)
            {
                return(NotFound());
            }

            var utcTime = DateTime.UtcNow;

            resume.Name        = string.Format("{0} {1}", resume.PersonalInfo.CurrentOccupation, "Resume");
            resume.UpdatedTime = utcTime;
            _resumeStoreService.Update(id, resume);

            return(NoContent());
        }
Exemplo n.º 17
0
        public OperateResult <ResumeResult> ParseText(string text)
        {
            try
            {
                //先判别文件是否是有效简历
                OperateResult <ResumePredictResult> predictResult = PredictText(text);

                if (predictResult.Status == OperateStatus.Failure)
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, predictResult.Description));
                }

                ResumeResult resumeResult = new ResumeResult
                {
                    Text  = predictResult.Data.Text,
                    Score = predictResult.Data.Score
                };

                if (!predictResult.Data.IsResume)
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, string.Format("不是有效的简历格式,得分[{0}]", predictResult.Data.Score), resumeResult));
                }

                //文本简历解析
                TextCVParser parser     = new TextCVParser(predictResult.Data.Text);
                ResumeData   resumeData = parser.Parse();
                if (!resumeData.IsValid())
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, "不是有效的简历格式,缺少简历必要信息", resumeResult));
                }

                resumeResult.IsResume   = true;
                resumeResult.ResumeInfo = resumeData;
                return(new OperateResult <ResumeResult>(OperateStatus.Success, "操作成功", resumeResult));
            }
            catch (Exception ex)
            {
                LoggerWrapper.Logger.Error("简历解析错误", ex);
                return(new OperateResult <ResumeResult>(OperateStatus.Failure, ex.Message));
            }
        }
        public async Task <IActionResult> UpdtadeResumeData(int id, ResumeData resumeData)
        {
            int userId = resumeData.UserId;
            var resume = _context.ResumeData.First(r => r.ResumeId == id);

            if (resumeData.Layout != null)
            {
                resume.Layout = resumeData.Layout;
            }
            if (resumeData.ResumeName != null)
            {
                resume.ResumeName = resumeData.ResumeName;
            }


            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ResumeDataExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            var userData = await _context.ResumeData
                           .Where(u => u.UserId == userId).Select(p => new { p.ResumeId, p.ResumeName, p.Layout })
                           .ToListAsync();

            return(Ok(userData));
        }
        public async Task <ActionResult <IEnumerable <ResumeData> > > Duplicate(int id, ResumeData resumeData)
        {
            int ResumeId  = resumeData.ResumeId;
            var newResume = await _context.ResumeData.Where(s => s.ResumeId == ResumeId)
                            .Include(s => s.Links)
                            .Include(w => w.WorkData)
                            .Include(w => w.Education)
                            .Include(w => w.Language)
                            .Include(w => w.Projects)
                            .Include(w => w.Recommends)
                            .Include(w => w.Skills)
                            .FirstOrDefaultAsync();

            if (newResume == null)
            {
                return(NotFound());
            }

            newResume.ResumeId   = 0;
            newResume.ResumeName = resumeData.ResumeName;
            int UserId = newResume.UserId;

            _context.ResumeData.Add(newResume);
            await _context.SaveChangesAsync();

            var userData = await _context.ResumeData
                           .Where(u => u.UserId == id).Select(p => new { p.ResumeId, p.ResumeName, p.Layout })
                           .ToListAsync();

            if (userData == null)
            {
                return(NotFound());
            }

            return(Ok(userData));
        }
Exemplo n.º 20
0
        private static void CreateWord(IEnumerable <IResumeSection> basicResumeComposer, ResumeData resumeData)
        {
            var wordRenderer = new WordRenderer();

            var wordStream = wordRenderer.CreateDocument(basicResumeComposer, resumeData);

            File.WriteAllBytes("wordResume.docx", wordStream.ToArray());
        }
Exemplo n.º 21
0
        private static void CreatePdf(IEnumerable <IResumeSection> basicResumeComposer, ResumeData resumeData)
        {
            var pdfRenderer = new PdfRenderer(new StubServerPathMapper());

            var pdfStream = pdfRenderer.CreateDocument(basicResumeComposer, resumeData);

            File.WriteAllBytes("pdfResume.pdf", pdfStream.ToArray());
        }
Exemplo n.º 22
0
 public BasicInfoAnalyzer(List <string> resumeContentList, ResumeData resumedata)
 {
     this.resumeContentList = resumeContentList;
     this.resumedata        = resumedata;
 }
 public bool IsSatisfiedBy(ResumeData data)
 {
     return(data.ReaderClearanceLevel == ClearanceLevel.LoyalCitizen || data.ReaderClearanceLevel == ClearanceLevel.TopSecret);
 }
Exemplo n.º 24
0
        public override MemoryStream CreateDocument(IEnumerable <IResumeSection> resumeSections, ResumeData data)
        {
            byte[] resultBytes;

            FontFactory.RegisterDirectories();

            var fontPath = mapperPathMapper.MapPath(InconsolataTtf);

            FontFactory.Register(fontPath, PdfConverter.Verdana);

            var pdfOutputStream = new MemoryStream();

            document = new Document(PageSize.A4);
            document.SetMargins(20, 20, 20, 20);



            PdfWriter.GetInstance(document, pdfOutputStream);

            document.AddTitle(data.DocumentTitle);
            document.Open();

            base.RenderElements(resumeSections, data);

            document.Close();
            resultBytes = pdfOutputStream.ToArray();
            pdfOutputStream.Close();
            pdfOutputStream.Dispose();
            return(new MemoryStream(resultBytes));
        }
Exemplo n.º 25
0
 public ResumedSession(ResumeData resumeData, Action <string, JsonElement> eventDispatchCallback, ILogger logger) : base(eventDispatchCallback, logger)
 {
     _logger     = logger;
     _resumeData = resumeData;
 }
Exemplo n.º 26
0
        public ActionResult <ResumeData> Index()
        {
            var rd = new ResumeData()
            {
                main = new Main()
                {
                    address = new Address()
                    {
                        city   = "Tehran",
                        state  = "Tehran, Iran",
                        street = "Khoshi St., Saeedi Hwy",
                        zip    = "1371683776"
                    },
                    bio            = "A software developer with a passionate enthusiasm for Blockchain Technology and cryptography who loves to code. I also love studying and understanding Programming Languages and how they work under the hood. I also have a keen interest in Machine learning and artificial intelligence stuff. I recently got a chance to lead a team of young and passionate software developers.",
                    contactmessage = "Contact me",
                    email          = "*****@*****.**",
                    image          = "profilepic.jpg",
                    name           = "Hamed Mohammadi",
                    occupation     = "Software Developer",
                    phone          = "(+98)939-172-7951",
                    resumedownload = "HMohammadi.pdf",
                    social         = new List <Social>()
                    {
                        new Social()
                        {
                            name      = "github",
                            className = "fa fa-github",
                            url       = "https://github.com/fivil"
                        },
                        new Social()
                        {
                            name      = "twitter",
                            url       = "https://twitter.com/F_IVI_L",
                            className = "fa fa-twitter"
                        },
                        new Social()
                        {
                            url       = "https://www.linkedin.com/in/HammedMohamadi",
                            name      = "linkedin",
                            className = "fa fa-linkedin"
                        },
                        new Social()
                        {
                            url       = "callto://+989391727951",
                            name      = "Skype",
                            className = "fa fa-skype"
                        },
                        new Social()
                        {
                            url       = "mailto:[email protected]",
                            className = "fa fa-envelope",
                            name      = "envelope"
                        }
                    },
                    website = "http://qmak.ir/"
                },
                portfolio = new Portfolio()
                {
                    projects = new List <Project>()
                    {
                        new Project()
                        {
                            category = "Fully Iranian cryptocurrency teller machine which facilitates the process of buying and selling several different cryptocurrencies",
                            image    = "btm.jpg",
                            title    = "EXFA- BTM",
                            url      = "http://exfa.io/"
                        },
                        new Project()
                        {
                            category = "Simple new cryptocurrency based on directed acyclic graph which uses it's very own blockchain, part of my Bachelor's degree project",
                            image    = "ParsiCoin.JPG",
                            title    = "Parsi Coin",
                            url      = "https://github.com/FIVIL/ParsiCoin"
                        },
                        new Project()
                        {
                            category = "Minimum Edit Distance Implementation for my Introduction to Natural Languages processing course.",
                            image    = "MED.JPG",
                            title    = "Minimum Edit Distance",
                            url      = "https://github.com/FIVIL/MED"
                        },
                        new Project()
                        {
                            category = "Fourier Series Visualizer for Engineering Calculus Course",
                            image    = "Furier1.JPG",
                            title    = "Fourier",
                            url      = "https://github.com/FIVIL/Fourier-series"
                        },
                        new Project()
                        {
                            category = "Heart Diseases Diagnosis Expert System for introduction to artificial Intelligence course.",
                            image    = "AI1.JPG",
                            title    = "HDES",
                            url      = "https://github.com/FIVIL/ID3-and-decision-tree"
                        },
                        new Project()
                        {
                            category = "Simple Compiler Lexical Analyser",
                            image    = "lexem.JPG",
                            title    = "Lexem",
                            url      = "https://github.com/FIVIL/Lexeme"
                        },
                        new Project()
                        {
                            category = "Dining Philosopher Problem",
                            image    = "NPhilosopher.JPG",
                            title    = "Dining Philosopher Problem's answer with p2p network",
                            url      = "https://github.com/FIVIL/N-Philasopher"
                        },
                        new Project()
                        {
                            category = "Simple Ball Game",
                            image    = "BallGame.JPG",
                            title    = "Ball Game",
                            url      = "https://github.com/FIVIL/NetWorkProject"
                        },
                        new Project()
                        {
                            category = "Ethereum Based Token which Helps Tracking Ownership of Irainian Authentic Carpets and Provides a Digital Market for Purchesing These Extrovagant ArtPieces.",
                            image    = "viracoin.JPG",
                            title    = "ViraCoin",
                            url      = "http://viracoin2.qmak.ir/"
                        },
                        new Project()
                        {
                            category = "Monitoring and Management Software for High Voltage Switches for Bakhtar Regional Electric Co.",
                            image    = "bakhtar.jpg",
                            title    = "Switch Manager",
                            url      = "http://brec.ir/en"
                        },
                        new Project()
                        {
                            category = "a simple implementation of generic smart pointers for C++ programming language based on reference counting. This library can simply address memory leak issues for C++ language.",
                            image    = "smartpointer.JPG",
                            title    = "C++ Smart Pointers",
                            url      = "https://github.com/FIVIL/smart-pointer"
                        }
                    }
                },
                resume = new Resume()
                {
                    education = new List <Education>()
                    {
                        new Education()
                        {
                            degree      = "BSc, Software Engineering",
                            school      = "K. N. Toosi University of Technology",
                            graduated   = "2014–2019",
                            description = "BSc Project Title: Design and Implementation of a New Cryptocurrency(ParsiCoin) Using Directed acyclic graph(DAG) and blockchain technology. Supervisor: Saeed Sedighian Kashi",
                            gpa         = "Cumulative GPA:15.16/20 (75.8 %)",
                            courses     = @"Java (20/20), Circuit Design Using VHDL (20/20), Operation Systems (19.2/20)
Programming Languages Design (19.1/20), Understanding Assembly Language (18.5/20)
Data Structures (17.5/20), Artificial Intelligence & Expert Systems (17.4/20)"
                        }
                    },
                    work = new List <Work>()
                    {
                        new Work()
                        {
                            company     = "Raya Exchange",
                            description = "Rayex Exchange is a Uniqueu Trading Market for Different Cryptocurrencies, Which Facilitates Leverage Trading.",
                            title       = "CTO and Core developer",
                            years       = "September 2019–present",
                            duties      = "Monitoring Project Progress, Assigning Tasks to Other Project MembersDesigning System Architecture, Developing Back-End Services."
                        }
                    },
                    skillmessage = "",
                    skills       = new List <Skill>()
                    {
                        new Skill()
                        {
                            level = "90%",
                            name  = "C#"
                        },
                        new Skill()
                        {
                            level = "80%",
                            name  = "F#"
                        },
                        new Skill()
                        {
                            level = "80%",
                            name  = "Git"
                        },
                        new Skill()
                        {
                            level = "75%",
                            name  = "Java"
                        },
                        new Skill()
                        {
                            level = "75%",
                            name  = "Solidity"
                        },
                        new Skill()
                        {
                            level = "75%",
                            name  = "C++"
                        },
                        new Skill()
                        {
                            level = "60%",
                            name  = "JavaScript"
                        },
                        new Skill()
                        {
                            level = "60%",
                            name  = "Python"
                        },
                        new Skill()
                        {
                            level = "50%",
                            name  = "Go Lang"
                        }
                    },
                    consepts   = @"Microservices, Object Oriented Programming, OOP Design Patterns, Functional Programming, Concurrency and Parallelism, Asynchronous programming, Version Control Systems (Git), 
Inversion of Control & Dependency Injection,
                    TCP / IP Socket Programming,
                    SOLID Principles, REST and SOAP Web Services,
                    Event - Driven Programming,
                    Test Driven Development, Continuous Integration & Continuous Delivery,
                    Remote Procedure Call,
                    MVC and MVVM Patterns.",
                    databases  = "Microsoft SQL Server, MongoDB, Redis, RavenDB, Elasticsearch.",
                    designLang = "LaTex, HTML5, CSS3, XAML, Markdown.",
                    frameworks = "Anular2+, Blazor, ASP.NET Core, WPF, ML.NET.",
                    libraries  = "ReactJS, SignalR, Ef Core, Serilog, XUnit, MOQ, SciPy, NumPy.",
                    tools      = "Visual Studio, Docker, Docker Compose, Kubernetes"
                },
                teachingExpreiences = new TeachingExpreiences()
                {
                    expreiences = new List <TeachingExpreience>()
                    {
                        new TeachingExpreience()
                        {
                            course     = "Compilers",
                            institue   = "KNTU",
                            instructor = "Seyed Hossein Khasteh",
                            title      = "Teaching assistant",
                            year       = "Spring 2018"
                        },
                        new TeachingExpreience()
                        {
                            course     = "Data Structure",
                            institue   = "KNTU",
                            instructor = "Saeed Farzi",
                            title      = "Teaching assistant",
                            year       = "Spring 2017"
                        },
                        new TeachingExpreience()
                        {
                            course     = "Understanding Databases",
                            institue   = "KNTU",
                            instructor = "Saeed Farzi",
                            title      = "Teaching assistant",
                            year       = "Fall 2017"
                        },
                        new TeachingExpreience()
                        {
                            course     = "Understanding Assembly Language",
                            institue   = "KNTU",
                            instructor = "Hoda Roodaki",
                            title      = "Teaching assistant",
                            year       = "Spring 2016 -Fall2017"
                        },
                        new TeachingExpreience()
                        {
                            course     = "Programming with C",
                            institue   = "KNTU",
                            instructor = "Hoda Roodaki",
                            title      = "Teaching assistant",
                            year       = "Fall 2015"
                        }
                    },
                    talks = new List <Talk>()
                    {
                        new Talk()
                        {
                            description = "Introduction to blockchain for new software students at K. N. Toosi University of Technology.",
                            image       = "Blockchain.JPG",
                            link        = "https://www.slideshare.net/HamedMohamadi4/blockchain-101-177784620",
                            subject     = "Blockchain 101"
                        }
                    }
                }
            };

            return(Ok(rd));
        }
Exemplo n.º 27
0
 public abstract MemoryStream CreateDocument(IEnumerable <IResumeSection> resumeSections, ResumeData data);
Exemplo n.º 28
0
        public override MemoryStream CreateDocument(IEnumerable <IResumeSection> resumeSections, ResumeData data)
        {
            var memoryStream = new MemoryStream();

            using (var wordDocument = WordprocessingDocument.Create(memoryStream, WordprocessingDocumentType.Document))
            {
                mainDocumentPart = wordDocument.AddMainDocumentPart();

                // set document settings
                var documentSettingsPart = mainDocumentPart.AddNewPart <DocumentSettingsPart>();
                documentSettingsPart.Settings = new Settings(new EvenAndOddHeaders());


                // set headers and footers
                var wordBrandingHelper = new WordBranding(mainDocumentPart);
                wordBrandingHelper.AddHeadersAndFooters();

                styleDefinitionsPart = mainDocumentPart.AddNewPart <StyleDefinitionsPart>();
                GenerateStyleDefinitions(styleDefinitionsPart);


                numberingDefinitionsPart           = mainDocumentPart.AddNewPart <NumberingDefinitionsPart>();
                numberingDefinitionsPart.Numbering = new Numbering();


                mainDocumentPart.Document = new Document();
                body = mainDocumentPart.Document.AppendChild(new Body());

                base.RenderElements(resumeSections, data);

                // apply sections to the document - sections must describe what headers and footers are present
                body.AppendChild(wordBrandingHelper.CreateSections());

                // add numbering instances to the numbering sections. Must be all abstract first, followed by all numbering instances.
                // hence it is moved out up here.
                numberingDefinitionsPart.Numbering.Append(abstractNumberingInstances);
                numberingDefinitionsPart.Numbering.Append(numberingInstances);
            }

            memoryStream.Position = 0;
            return(memoryStream);
        }
Exemplo n.º 29
0
 public void Update(string id, ResumeData resume)
 {
     _resumes.ReplaceOne(res => res.Id == id, resume);
 }
Exemplo n.º 30
0
 public ResumeData Create(ResumeData resume)
 {
     _resumes.InsertOne(resume);
     return(resume);
 }