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()))); }
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())); }
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)); }
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()))); }
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()); } }
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()); } }