コード例 #1
0
        public async Task <string> CreateDescriptivePaper(DescriptivePaperDTO DesPaper)
        {
            string code = CodeGenerator.GetSharableCode(EPaperType.Descriptive);

            DesPaper.PaperCode = code;
            string linkwith = await Fire.Upload(DesPaper.paper.OpenReadStream(), null, code);

            DesPaper.PaperPdfUrl = linkwith.Replace("&", Fire.Ampersand);

            DescriptivePaper paper = Mapper.Map <DescriptivePaperDTO, DescriptivePaper>(DesPaper);

            DescriptivePaperRepo.Create(paper);

            EmailService.SendMailForPaper(code, linkwith, paper.PaperTitle, paper.CreatedDate.ToString(), paper.DeadLine.ToString(), paper.TeacherEmailId); //sends mail regarding paper update

            return(code);
        }
コード例 #2
0
 public DescriptivePaper Create(DescriptivePaper paper)
 {
     AppDbContext.DescriptivePapers.Add(paper);
     AppDbContext.SaveChanges();
     return(paper);
 }