示例#1
0
        public IActionResult DeleteColaberator(string email, string filename)
        {
            Models.DocsViewModel.DocsContextClass context = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            context.ReWriteColabFile(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString(), filename, email);

            return(View("PrivateDocsView", context.GetAllPrivateFiles(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString())));
        }
示例#2
0
        public IActionResult PublicDocsView()
        {
            Models.DocsViewModel.DocsContextClass context = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            ViewBag.UserID = this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString();

            return(View(context.GetAllFiles()));
        }
示例#3
0
        public IActionResult DeleteColabView(string filename)
        {
            Models.DocsViewModel.DocsContextClass dbcontext = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            ViewBag.Filename = filename;

            List <DocsClass> ColabEmail = dbcontext.GetColabView(dbcontext.GetEmail(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString()), filename);

            return(View("DeleteColabView", ColabEmail));
        }
示例#4
0
        public async Task <IActionResult> WriteColaberatorFile(string email, string filename)
        {
            Models.DocsViewModel.DocsContextClass context = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            context.writeColaberatorFile(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString(), email, filename);
            string message = context.GetEmail(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString()) + " has added you as a collaberator for " + filename;
            await _emailSender.SendEmailAsync(email, "Collaberation", message);

            return(View("PrivateDocsView", context.GetAllPrivateFiles(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString())));
        }
示例#5
0
        public IActionResult DeletePublicFile(string OwnerID, string filename, string path)
        {
            Models.DocsViewModel.DocsContextClass context = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            if (context.DeletePublicFile(OwnerID, filename))
            {
                System.IO.File.Delete(path);
                return(View("PublicDocsView", context.GetAllFiles()));
            }
            else
            {
                return(View());
            }
        }
示例#6
0
        public IActionResult DeletePrivateFile(string OwnerID, string filename, string path)
        {
            Models.DocsViewModel.DocsContextClass context = HttpContext.RequestServices.GetService(typeof(TestWebAp.Models.DocsViewModel.DocsContextClass)) as Models.DocsViewModel.DocsContextClass;

            if (context.DeletePrivateFile(OwnerID, filename))
            {
                System.IO.File.Delete(path);
                return(View("PrivateDocsView", context.GetAllPrivateFiles(this.User.FindFirstValue(ClaimTypes.NameIdentifier).ToString())));
            }
            else
            {
                return(View());
            }
        }