public ActionResult WriteProcedureClosure(int conflictId, int debateId, HttpPostedFileBase FileClause) { var debat = BLLDebates.GetDebate(debateId); var evt = BLLConflicts.AddEvent(new Event() { DateBegin = DateTime.Now, Description = "Ordonnance pour la procédure d'incidence \"" + debat.Title + "\" ", IdConflict = conflictId, Name = "Ordonnance de procédure d'incidence", Type = (int)EventTypeEnum.OfficialDocuments, IdUser = User.Identity.GetId() }); var azureFile = AzureFileHelper.AddFile(conflictId, FileClause); var prooFile = BLLConflicts.AddFile(new ProofFile() { Description = "Sentence", FilePath = azureFile.Uri.AbsoluteUri, FileType = (int)FileTypeEnum.PDF, IdConflict = conflictId, Name = "Ordonnance_Procedure_Incidence_N°_" + debateId, UploadDate = DateTime.Now, }, evt.Id); BLLLegalDocuments.AddLegalDocument(new LegalDocument() { IdConflict = conflictId, Filename = "Ordonnance_Procedure_Incidence_N°_" + debateId, Url = azureFile.Uri.AbsoluteUri, Type = (int)LegalDocumentTypeEnum.OrdonnanceProcedure }); BLLDebates.CloseDebate(debateId); return(RedirectToAction("Conflict", "Viewer", new { conflictId = conflictId })); }
public ActionResult ProcedureClosure(int id, int conflictId) { var conflict = BLLConflicts.GetConflictForArbitration(conflictId); var debate = BLLDebates.GetDebate(id); var file = DocGenerator.GenerateOrdonnanceProcedure(conflict, debate); var azureFile = AzureFileHelper.AddFile(conflictId, file.FileStream, file.FileName); return(View("ProcedureClosure", new ProcedureClosureModel() { Conflict = conflict, Debat = debate, DocumentUrl = azureFile.Uri.AbsoluteUri })); }
public ActionResult MailDebateAdd(int debatId, string mailBody) { var debate = BLLDebates.GetDebate(debatId); if (String.IsNullOrWhiteSpace(mailBody) && Request.Files["FileUpload"] != null && Request.Files["FileUpload"].ContentLength > 0) { HttpPostedFileBase hpf = Request.Files["FileUpload"] as HttpPostedFileBase; var blockBlob = AzureFileHelper.AddFile(debate.Event.IdConflict, hpf); var f = new ProofFile(); f.FilePath = blockBlob.Uri.AbsoluteUri; f.IdConflict = debate.Event.IdConflict; f.Name = blockBlob.Name; var file = BLLConflicts.AddFile(f); var mailDebate = BLLDebates.AddMailDebate(new MailDebate() { IdDebate = debatId, Body = "<a href='" + file.FilePath + "'>" + file.Name + "</a>", CreateDate = DateTime.Now, CreatedBy = User.Identity.GetId(), IdFile = file.Id }); foreach (var item in BLLDebates.GetUsersForDebate(debatId)) { Guid guid = Guid.NewGuid(); FastArbitreEmails.YouHaveMail(item, debate, Url.Action("MailDebate", "Arbitre", new { debatId = debate.Id }, this.Request.Url.Scheme) + "#mail_" + mailDebate.Id, Request.UrlReferrer.DnsSafeHost + Url.Action("Index", "Email", new { id = guid.ToString() }), guid); } } else { var mailDebate = BLLDebates.AddMailDebate(new MailDebate() { IdDebate = debatId, Body = mailBody, CreateDate = DateTime.Now, CreatedBy = User.Identity.GetId() }); foreach (var item in BLLDebates.GetUsersForDebate(debatId)) { Guid guid = Guid.NewGuid(); FastArbitreEmails.YouHaveMail(item, debate, Url.Action("MailDebate", "Arbitre", new { debatId = debate.Id }, this.Request.Url.Scheme) + "#mail_" + mailDebate.Id, Request.UrlReferrer.DnsSafeHost + Url.Action("Index", "Email", new { id = guid.ToString() }), guid); } } return(RedirectToAction("MailDebate", new { debatId = debatId })); }
public ActionResult ShowDebate(int debatId) { var debat = BLLDebates.GetDebate(debatId); if (debat.Type == (int)DebateTypeEnum.Mail) { return(RedirectToAction("MailDebate", new { debatId = debatId })); } else { return(RedirectToAction("VisioDebate", new { debatId = debatId })); } }
public ActionResult MailDebate(int debatId) { var debat = BLLDebates.GetDebate(debatId); if (debat.CountDown != null) { if (debat.CreateDate.Value.AddDays(debat.CountDown.Value) < DateTime.Now) { BLLDebates.CloseDebate(debatId); } } return(View(debat)); }
public ActionResult VisioDebate(int debatId) { return(View(BLLDebates.GetDebate(debatId))); }