Beispiel #1
0
        public virtual ActionResult NewMission(string operationNumber)
        {
            ViewBag.New = true;
            ViewBag.OrganizationalUnit = string.Empty;
            if (string.IsNullOrEmpty(operationNumber))
            {
                operationNumber = IDBContext.Current.Operation;
            }

            var statusDraf = _viewModelMapperHelper.GetStatusDrafMasterData(
                MISSION_STATUS, MissionStatusCode.MISSION_STATUS_DRAFT);

            MissionCompleteViewModel model = new MissionCompleteViewModel()
            {
                Header = new MissionHeaderViewModel()
                {
                    StartDate  = DateTime.Now,
                    EndDate    = DateTime.Now,
                    StatusDraf = statusDraf
                },
                DocumentMissionList   = new List <DocumentViewModel>(),
                MissionContactList    = new List <MissionContactViewModel>(),
                MissionTeamMemberList = new List <MissionTeamMemberViewModel>(),
                IsBeforeApproved      = true
            };

            model.Header.RegionalCountry = _missionService.GetRegionalCountry(
                operationNumber, Localization.CurrentLanguage).RegionalCountry;

            model.Header.operationNumber = operationNumber;
            _missionService.BuildMissionFieldsConfig(model.Header);
            _missionService.BuildMissionOptions(model.Header);

            ViewBagMission(operationNumber);

            model.ExecutionPhase = _viewModelMapperHelper.IsExecutionPhaseOperation(operationNumber);

            model.HasSupervisionPlan = _missionService.HasSupervisionPlan(operationNumber);

            if (model.ExecutionPhase && model.HasSupervisionPlan)
            {
                model.NumberActual          = _viewModelMapperHelper.GetFieldCurrentActivity(operationNumber);
                ViewBag.MessageNumberActual = string.Format(
                    Localization.GetText("OP.MS.MissionCompleteView.Message.NumberActual"),
                    model.NumberActual);
            }

            var isACTOperation = _viewModelMapperHelper.IsOperationType(
                operationNumber, OperationType.ACT);

            SetMissionPermission(isACTOperation);

            return(View("MissionCompleteView", model));
        }