コード例 #1
0
ファイル: AdminController.cs プロジェクト: keshava/ODR
        public ActionResult UpdateSituation(int conflictId, int situation)
        {
            int totalPages = 0;

            BLLConflicts.UpdateConflictState(conflictId, situation);
            var conflicts = BLLConflicts.SearchConflicts(null, null, Enum.GetName(typeof(ConflictState), (ConflictState)situation), 0, 10, out totalPages);

            return(RedirectToAction("CaseList", new { id = conflictId }));
        }
コード例 #2
0
        public ActionResult UpdateState(int conflictId, int newStateId, bool hasCountdown, int countdown)
        {
            var csh = new ConflictStateHistoric()
            {
                IdConflict        = conflictId,
                ConflictStateId   = newStateId,
                ConflictStateName = MetadataHelper.GetEnumDisplayNAme((ConflictState)newStateId),
            };

            if (hasCountdown)
            {
                csh.CountDown = countdown;
            }
            BLLConflicts.AddConflictStateHistoric(csh);
            BLLConflicts.UpdateConflictState(conflictId, newStateId);
            return(RedirectToAction("Conflict", new { conflictId = conflictId }));
        }
コード例 #3
0
        public ActionResult WriteSentence(int conflictId, HttpPostedFileBase FileClause)
        {
            BLLConflicts.UpdateConflictState(conflictId, (int)ConflictState.Concluded);

            var evt = BLLConflicts.AddEvent(new Event()
            {
                DateBegin   = DateTime.Now,
                Description = "L'arbitre " + User.Identity.FirstName() + " " + User.Identity.LastName() + " a rédigé sa sentence. Vous la retrouverez ci-dessous.",
                IdConflict  = conflictId,
                Name        = "Sentence",
                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        = "Sentence",
                UploadDate  = DateTime.Now,
            }, evt.Id);

            var csh = new ConflictStateHistoric()
            {
                IdConflict        = conflictId,
                ConflictStateId   = (int)ConflictState.Concluded,
                ConflictStateName = MetadataHelper.GetEnumDisplayNAme(ConflictState.Concluded),
            };

            BLLConflicts.AddConflictStateHistoric(csh);

            return(RedirectToAction("Conflict", "Viewer", new { conflictId = conflictId }));
        }
コード例 #4
0
        // GET: Viewer
        public ActionResult Conflict(int conflictId, string i)
        {
            if (TempData.Keys.Any(c => c == "Info"))
            {
                ViewBag.Info = TempData["Info"];
            }
            else if (TempData.Keys.Any(c => c == "Error"))
            {
                ViewBag.Error = TempData["Error"];
            }
            else if (TempData.Keys.Any(c => c == "Success"))
            {
                ViewBag.Success = TempData["Success"];
            }

            var conflict = BLLConflicts.GetConflictForArbitration(conflictId);

            if (conflict.State == (int)ConflictState.FreeHandsArbitration)
            {
                var state = conflict.ConflictStateHistorics.Where(c => c.ConflictStateId == (int)ConflictState.FreeHandsArbitration).LastOrDefault();
                if (state != null)
                {
                    if (state.CreateDate.AddDays(state.CountDown.Value) < DateTime.Now)
                    {
                        BLLConflicts.AddConflictStateHistoric(new ConflictStateHistoric()
                        {
                            CreateDate        = state.CreateDate.AddDays(state.CountDown.Value),
                            IdConflict        = conflictId,
                            ConflictStateId   = (int)ConflictState.ExchangeClosure,
                            ConflictStateName = MetadataHelper.GetEnumDisplayNAme(ConflictState.ExchangeClosure)
                        });

                        BLLConflicts.UpdateConflictState(conflictId, (int)ConflictState.ExchangeClosure);
                        conflict = BLLConflicts.GetConflictForArbitration(conflictId);
                    }
                }
            }
            else if (conflict.State == (int)ConflictState.PreConclusionDebate)
            {
                var state = conflict.ConflictStateHistorics.Where(c => c.ConflictStateId == (int)ConflictState.PreConclusionDebate).FirstOrDefault();
                if (state != null)
                {
                    if (state.CreateDate.AddDays(state.CountDown.Value) < DateTime.Now)
                    {
                        BLLConflicts.AddConflictStateHistoric(new ConflictStateHistoric()
                        {
                            CreateDate        = state.CreateDate.AddDays(state.CountDown.Value),
                            IdConflict        = conflictId,
                            ConflictStateId   = (int)ConflictState.EndOfDebates,
                            ConflictStateName = MetadataHelper.GetEnumDisplayNAme(ConflictState.EndOfDebates)
                        });

                        BLLConflicts.AddConflictStateHistoric(new ConflictStateHistoric()
                        {
                            CreateDate        = DateTime.Now,
                            IdConflict        = conflictId,
                            ConflictStateId   = (int)ConflictState.FinalDeliberation,
                            ConflictStateName = MetadataHelper.GetEnumDisplayNAme(ConflictState.FinalDeliberation)
                        });

                        BLLConflicts.UpdateConflictState(conflictId, (int)ConflictState.FinalDeliberation);
                        conflict = BLLConflicts.GetConflictForArbitration(conflictId);
                    }
                }
            }

            return(View(conflict));
        }