示例#1
0
        public virtual ActionResult SummaryEdit(string operationNumber, int year, SupervisionPlanView view, bool createNew = false)
        {
            //ViewBag.UploadFileError = ((Exception)Session["IndexDocumentRelationshipError"]).Message;
            ViewBag.EditMode             = true;
            ViewBag.LocalizedStatusValue = Localization.GetText("Draft");
            ViewBag.EditableView         = view;
            ViewBag.operationNumber      = operationNumber;

            SupervisionPlanModel plan = null;

            if (createNew)
            {
                plan = new SupervisionPlanModel
                {
                    Year            = year,
                    OperationNumber = operationNumber
                }
            }
            ;
            var supervisionPlans = PrepareSummaryView(plan, operationNumber, year);

            if (view == SupervisionPlanView.Budget)
            {
                LocalizeAndCompleteBudgetMatrix(supervisionPlans);
            }

            ViewBag.IsNewPlan       = supervisionPlans.Find(p => p.Year == year).ActualVersionIsNew;
            ViewBag.DraftOrModified = supervisionPlans.Find(p => p.Year == year).ActualVersionIsInDraftOrModified;
            ViewBag.Approved        = supervisionPlans.Find(p => p.Year == year).ActualVersionIsApproved;
            ViewBag.Modified        = supervisionPlans.Find(p => p.Year == year).ActualVersionIsInModified;
            ViewBag.OperationId     = supervisionPlans.Find(p => p.Year == year).OperationId;
            ViewBag.OperationNumber = supervisionPlans.Find(p => p.Year == year).OperationNumber;

            return(View("Summary", supervisionPlans));
        }
示例#2
0
        public virtual ActionResult CommentsSave(
            int supervisionPlanVersionId,
            string operationNumber,
            int year,
            SupervisionPlanVersionModel comments,
            SupervisionPlanView view = new SupervisionPlanView(),
            bool returnToEdit        = false,
            bool isNew            = false,
            bool requestAfterSave = true)
        {
            comments.UserComments.ForEach(c =>
            {
                c.ModifiedBy = IDBContext.Current.UserName;
                c.CreatedBy  = IDBContext.Current.UserName;
            });

            var versionId = GetVersionIdToSave(supervisionPlanVersionId, operationNumber, year, isNew);

            SupervisionPlanRepository.UpdateCommentPlanVersion(versionId, comments.UserComments);

            if (requestAfterSave)
            {
                string additionalValidators = Request["validator_list_additional_list"];

                return(RedirectToAction("CreatePlanVersionApprovalRequest", new
                {
                    planVersionId = versionId,
                    operationNumber = operationNumber,
                    year = year,
                    additionalValidators = additionalValidators
                }));
            }
            else
            {
                return(RedirectToAction("DetailsPlanVersionApprovalRequest", new
                {
                    planVersionId = versionId,
                    operationNumber = operationNumber,
                    year = year
                }));
            }
        }
示例#3
0
        public virtual ActionResult Summary(string operationNumber, int?year, SupervisionPlanView view = SupervisionPlanView.CriticalProducts)
        {
            ViewBag.operationNumber = operationNumber;
            ViewBag.EditMode        = false;
            ViewBag.EditableView    = view;
            if (!year.HasValue)
            {
                year = DateTime.Now.Year;
            }
            var supervisionPlans = PrepareSummaryView(null, operationNumber, year.Value);

            if (view == SupervisionPlanView.Budget)
            {
                LocalizeAndCompleteBudgetMatrix(supervisionPlans);
            }
            var spService = Globals.Resolve <ISupervisionPlanService>();

            ViewBag.ModalityType = spService.GetModalityCodeById(supervisionPlans[0].SupervisionPlanId);
            ViewBag.SourceList   = _viewModelMapperHelper.GetListMasterData(SpGlobalValues.ListSource);
            ViewBag.ActivityType = _viewModelMapperHelper.GetListMasterData(SpGlobalValues.ActivityType);
            return(View(supervisionPlans));
        }
示例#4
0
 private ActionResult RedirectSelector(int planVersionId, string operationNumber, int year, SupervisionPlanView view, bool requestAfterSave)
 {
     if (requestAfterSave)
     {
         return(RedirectToAction("DetailsPlanVersionApprovalRequest", new
         {
             planVersionId = planVersionId,
             operationNumber = operationNumber,
             year = year
         }));
     }
     else
     {
         return(RedirectToAction("Summary", new
         {
             operationNumber = operationNumber,
             year = year,
             view = view
         }));
     }
 }
示例#5
0
        public virtual ActionResult BudgetSave(int supervisionPlanVersionId, string operationNumber, int year, List <CostModel> costs, bool returnToEdit, bool isNew, SupervisionPlanView view, bool requestAfterSave, bool IsModified = false)
        {
            var versionId = GetVersionIdToSave(supervisionPlanVersionId, operationNumber, year, isNew);

            if (supervisionPlanVersionId > 0)
            {
                SupervisionPlanRepository.UpdateCosts(versionId, costs, IsModified);
            }

            return(RedirectSelector(versionId, operationNumber, year, view, requestAfterSave));
        }
示例#6
0
        public virtual ActionResult ActivitiesSave(int supervisionPlanVersionId, string operationNumber, int year, List <ActivityModel> activities, bool returnToEdit, bool isNew, SupervisionPlanView view, bool requestAfterSave)
        {
            var versionId = GetVersionIdToSave(supervisionPlanVersionId, operationNumber, year, isNew);

            if (supervisionPlanVersionId > 0)
            {
                SupervisionPlanRepository.UpdateActivities(versionId, activities);
            }

            return(RedirectSelector(versionId, operationNumber, year, view, requestAfterSave));
        }
示例#7
0
        public virtual ActionResult CriticalProductsSave(int supervisionPlanVersionId, string operationNumber, int year, List <CriticalProductModel> products, bool returnToEdit, bool isNew, SupervisionPlanView view, bool requestAfterSave)
        {
            var versionId = GetVersionIdToSave(supervisionPlanVersionId, operationNumber, year, isNew);

            if (supervisionPlanVersionId > 0 || isNew)
            {
                SupervisionPlanRepository.UpdateCriticalProducts(versionId, products);
            }

            return(RedirectSelector(versionId, operationNumber, year, view, requestAfterSave));
        }
示例#8
0
        public virtual ActionResult ModifyPlan(int planVersionId, string operationNumber, int year, SupervisionPlanView view)
        {
            var plan = SupervisionPlanRepository.GetNewModifiedPlanVersion(planVersionId);

            ViewBag.EditMode     = true;
            ViewBag.EditableView = view;
            var supervisionPlans = PrepareSummaryView(plan, operationNumber, year);

            if (view == SupervisionPlanView.Budget)
            {
                LocalizeAndCompleteBudgetMatrix(supervisionPlans);
            }

            ViewBag.IsNewPlan       = supervisionPlans.Find(p => p.Year == year).ActualVersionIsNew;
            ViewBag.DraftOrModified = supervisionPlans.Find(p => p.Year == year).ActualVersionIsInDraftOrModified;
            ViewBag.Approved        = supervisionPlans.Find(p => p.Year == year).ActualVersionIsApproved;
            ViewBag.Modified        = supervisionPlans.Find(p => p.Year == year).ActualVersionIsInModified;
            ViewBag.OperationId     = supervisionPlans.Find(p => p.Year == year).OperationId;
            ViewBag.OperationNumber = supervisionPlans.Find(p => p.Year == year).OperationNumber;
            ViewBag.PlanIsModified  = true;
            return(View("Summary", supervisionPlans));
        }