public virtual ActionResult Edit(string operationNumber, int planId = 0, int taskBucketId = 0, string tabName = null)
        {
            ProcurementPlanViewModel model = null;

            var errorMessage = SynchronizationHelper.AccessToResources(SynchronizationHelper.EDIT_MODE, SGP_PROCUREMENT_PLAN_URL, operationNumber, IDBContext.Current.UserLoginName);

            if (!string.IsNullOrWhiteSpace(errorMessage))
            {
                return(RedirectToAction("Read", new { operationNumber = operationNumber, tabName = tabName, errorMessage = errorMessage }));
            }

            switch (tabName)
            {
            case ProcurementPlanNavigation.TAB_NAME_PROCUREMENT_PARAMETRIZATION:
                model = GetParameterizationData(operationNumber, planId);
                model.ViewContainer["ActiveTab"] = ProcurementPlanNavigation.TAB_NAME_PROCUREMENT_PARAMETRIZATION;
                break;

            case ProcurementPlanNavigation.TAB_NAME_OPERATION_LEVEL:
                model = GetOperationLevelData(operationNumber, planId, taskBucketId);
                model.ViewContainer["ActiveTab"] = ProcurementPlanNavigation.TAB_NAME_OPERATION_LEVEL;
                break;

            default:
                model = GetPlanData(operationNumber, planId, taskBucketId);
                model.ViewContainer["ActiveTab"] = ProcurementPlanNavigation.TAB_NAME_PROCUREMENT_LEVEL;
                break;
            }

            return(View(model));
        }
        public static ProcurementPlanViewModel Update(this ProcurementPlanViewModel model, ClientFieldData[] formData)
        {
            if (model.Parametrization != null)
            {
                model.Parametrization.UpdateParameterization(formData);
            }

            if (model.ProcurementLevel != null)
            {
                model.ProcurementLevel.UpdateProcurementLevel(formData);
            }

            if (model.OperationLevel != null)
            {
                model.OperationLevel.UpdateOperationLevel(formData);
            }

            return model;
        }