Пример #1
0
        public JsonResult ObtenerVehiculo(int idVehiculo)
        {
            var response = new
            {
                valid    = true,
                message  = "",
                vehiculo = new VehiculoModel()
            };
            var vehiculo = new ViewModelMapperHelper().ObtenerVehiculo(idVehiculo);

            if (vehiculo.IdVehiculo > 0)
            {
                response = new
                {
                    valid   = true,
                    message = "",
                    vehiculo
                };
            }
            else
            {
                response = new
                {
                    valid    = false,
                    message  = "Vehículo no encontrado",
                    vehiculo = new VehiculoModel()
                };
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult ObtenerServicio(int idServicio)
        {
            var response = new
            {
                valid    = true,
                message  = "",
                servicio = new ServicioModel()
            };
            var servicio = new ViewModelMapperHelper().ObtenerServicio(idServicio);

            if (servicio.IdServicio > 0)
            {
                response = new
                {
                    valid   = true,
                    message = "",
                    servicio
                };
            }
            else
            {
                response = new
                {
                    valid    = false,
                    message  = "Servicio no encontrado",
                    servicio = new ServicioModel()
                };
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
 public SupervisionPlanLegacyController(ISPAdministrationService administrationService, ICatalogService catalogService, ISpNotificationService notificationService)
 {
     _spAdministrationService = administrationService;
     _catalogService          = catalogService;
     _notificationService     = notificationService;
     _viewModelMapperHelper   = new ViewModelMapperHelper(_spAdministrationService, _catalogService, _notificationService);
 }
Пример #4
0
        public JsonResult ObtenerModelos(int idMarca)
        {
            var response = new
            {
                valid   = true,
                message = "",
                modelos = new List <Vista.Models.ComboModel>()
            };
            var modelos = new ViewModelMapperHelper().ListaModelos(idMarca);

            if (modelos.Count > 0)
            {
                response = new
                {
                    valid   = true,
                    message = "",
                    modelos
                };
            }
            else
            {
                response = new
                {
                    valid   = false,
                    message = "No se pueden obtener los modelos",
                    modelos = new List <Vista.Models.ComboModel>()
                };
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public JsonResult CrearReserva(string comunaRetiro, string fechaRetiro, string horaRetiro,
                                       string comunaEntrega, string fechaEntrega, string horaEntrega, int idVehiculo,
                                       List <int> servicios, string nombres, string apellidos, string email, string direccion,
                                       string comuna, string telefono)
        {
            var response = new
            {
                valid   = true,
                message = ""
            };
            var reserva = new ViewModelMapperHelper().CrearReserva(comunaRetiro, fechaRetiro,
                                                                   horaRetiro, comunaEntrega, fechaEntrega, horaEntrega, idVehiculo, servicios,
                                                                   nombres, apellidos, email, direccion, comuna, telefono);

            if (!reserva.EsValido)
            {
                response = new
                {
                    valid   = false,
                    message = reserva.MensajeError
                };
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public InstitutionViewController(ICatalogService catalogService, IInstitutionService institutionService)
        {
            _catalogService     = catalogService;
            _institutionService = institutionService;

            _viewModelMapperHelper = new ViewModelMapperHelper(ViewBag, _institutionService, _catalogService);
        }
Пример #7
0
        public JsonResult ObtenerReserva(int idReserva)
        {
            var response = new
            {
                valid   = true,
                message = "",
                reserva = new ReservaModel()
            };
            var reserva = new ViewModelMapperHelper().ObtenerReserva(idReserva);

            if (reserva.IdReserva > 0)
            {
                response = new
                {
                    valid   = true,
                    message = "",
                    reserva
                };
            }
            else
            {
                response = new
                {
                    valid   = false,
                    message = "Reserva no encontrado",
                    reserva = new ReservaModel()
                };
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Пример #8
0
 public ControlPanelContactsController(IOperationContactsService operationContactsService,
                                       ICatalogService catalogService)
 {
     _operationContactsService = operationContactsService;
     _catalogService           = catalogService;
     _viewModelMapperHelper    = new ViewModelMapperHelper(_operationContactsService,
                                                           _catalogService);
 }
Пример #9
0
 public ActivityProgramController(
     IActivityProgramServices AapServices,
     IAuthorizationManager authorizationManager)
 {
     _AapServices           = AapServices;
     _viewModelMapperHelper = new ViewModelMapperHelper(_AapServices);
     _authorizationManager  = authorizationManager;
 }
        public MissionsReportController(ICatalogService catalogService, IMissionReportService missionReportService, IMissionService missionService)
        {
            var authorizationService = AuthorizationServiceFactory.Current;

            _missionReportService  = missionReportService;
            _missionService        = missionService;
            _viewModelMapperHelper = new ViewModelMapperHelper(ViewBag, catalogService, authorizationService, missionService, missionReportService);
        }
        public virtual JsonResult SaveTemplate()
        {
            var response = new DocumentTemplateResponse
            {
                IsValid = true
            };

            try
            {
                var jsonDataRequest   = PageSerializationHelper.DeserializeJsonForm(Request.Form[0]);
                var viewModelTemplate =
                    PageSerializationHelper.DeserializeObject <TemplateViewModel>(jsonDataRequest.SerializedData);
                viewModelTemplate.UpdateDocumentTemplateViewModel(jsonDataRequest.ClientFieldData);
                viewModelTemplate.SourceDocumentVersion = "1";
                viewModelTemplate.IsValid =
                    DateTime.Compare(viewModelTemplate.DateCreated, viewModelTemplate.DateExpired) <= 0;

                var documentUpload = new UploadRequest();
                if (viewModelTemplate.DocumentTemplateId <= 0)
                {
                    var tempFileName =
                        jsonDataRequest.ClientFieldData.First(e => "templateTempFileName".Equals(e.Name)).Value;
                    var fileName = jsonDataRequest.ClientFieldData.First(e => "templateFileName".Equals(e.Name)).Value;
                    documentUpload = new UploadRequest
                    {
                        File     = System.IO.File.ReadAllBytes(Path.GetTempPath() + @"\" + tempFileName),
                        FileName = fileName
                    };
                    System.IO.File.Delete(Path.GetTempPath() + @"\" + tempFileName);
                }

                var sharePointUrl  = ConfigurationManager.AppSettings.Get("DocumentTemplate_TemplateUrl");
                var templateFolder = ConfigurationManager.AppSettings.Get("DocumentTemplate_TemplateFolder");

                if (viewModelTemplate.TemplateFieldsList == null)
                {
                    viewModelTemplate.TemplateFieldsList = new List <TemplateFieldsViewModel>();
                }

                var templateDto = new ViewModelMapperHelper().TemplateDto(viewModelTemplate);
                templateDto.DataConnection = new DataConnectionRequest
                {
                    Site        = sharePointUrl,
                    Library     = templateFolder,
                    CurrentUser = IDBContext.Current.UserName,
                    IsVer       = false
                };

                response = _documentTemplateServices.SaveDocumentTemplateResponse(documentUpload, templateDto);
                return(Json(response));
            }
            catch (Exception e)
            {
                response.IsValid      = false;
                response.ErrorMessage = e.GetBaseException().Message;
                return(Json(response));
            }
        }
Пример #12
0
 public RolesAndPermissionsViewController(ICatalogService catalogService,
                                          IRolesAndPermissionsService rolesAndPermissionsService,
                                          IEquivalentTypeRoleService equivalentTypeRoleService)
 {
     _catalogService             = catalogService;
     _rolesAndPermissionsService = rolesAndPermissionsService;
     _equivalentTypeRoleService  = equivalentTypeRoleService;
     _viewModelMapperHelper      = new ViewModelMapperHelper(_rolesAndPermissionsService);
 }
Пример #13
0
 public PCRReportController(
     IPCRChecklistService pcrChecklistService,
     ICatalogService catalogService,
     IPCRFollowUpService pcrFollowUpService,
     IAuthorizationService authorizationService)
 {
     _pcrFollowUpService    = pcrFollowUpService;
     _viewModelMapperHelper = new ViewModelMapperHelper(ViewBag, pcrChecklistService, catalogService, authorizationService, _pcrFollowUpService);
 }
Пример #14
0
        // GET: Mantencion/Vehiculos
        public ActionResult Index()
        {
            var vmmh  = new ViewModelMapperHelper();
            var model = new VehiculosViewModel
            {
                ListaVehiculos = vmmh.ListaVehiculos(),
                ListaMarcas    = vmmh.ListaMarcas()
            };

            return(View(model));
        }
Пример #15
0
        public ContactsController(IOperationContactsService operationContactsService,
                                  ICatalogService catalogService,
                                  IAuthorizationManager authorizationManager)
        {
            _operationContactsService = operationContactsService;
            _catalogService           = catalogService;
            _authorizationManager     = authorizationManager;

            _viewModelMapperHelper = new ViewModelMapperHelper(_operationContactsService,
                                                               _catalogService);
        }
 public MatrixChangesController(
     IMatrixChangesService matrixChangesService,
     ICatalogService catalogService,
     ITcmUniverseService tcmUniverseService,
     IDocumentManagementService docManagementService)
 {
     _catalogService        = catalogService;
     _matrixChangesService  = matrixChangesService;
     _viewModelMapperHelper = new ViewModelMapperHelper(_catalogService, null);
     _tcmUniverseService    = tcmUniverseService;
     _docManagementService  = docManagementService;
 }
Пример #17
0
        // GET: Mantencion/Reservas/CrearReserva
        public ActionResult CrearReserva()
        {
            var vmmhAdmin = new ViewModelMapperHelper();
            var model     = new ReservasViewModel
            {
                ListaComunas   = new Vista.Models.ViewModelMapperHelper().ListaComunas(),
                ListaServicios = vmmhAdmin.ListaServicios(),
                ListaVehiculos = vmmhAdmin.ListaVehiculos()
            };

            return(View(model));
        }
 public CorrespondenceViewController(
     ICatalogService catalogService,
     ICorrespondenceService correspondenceService,
     IProxySiscorService proxySiscorService,
     IOperationRepository operationRepository)
 {
     _catalogService        = catalogService;
     _correspondenceService = correspondenceService;
     _proxySiscorService    = proxySiscorService;
     _viewModelMapperHelper = new ViewModelMapperHelper(_catalogService, null, _proxySiscorService, _correspondenceService);
     _operationRepository   = operationRepository;
 }
Пример #19
0
 public ComponentsController(
     IComponentService componentService,
     ICatalogService catalogService,
     ITcmUniverseService tcmUniverseService,
     ILinkPredefinedIndicatorService linkPredefinedIndicatorService)
 {
     _componentService               = componentService;
     _catalogService                 = catalogService;
     _viewModelMapperHelper          = new ViewModelMapperHelper(_catalogService, null);
     _tcmUniverseService             = tcmUniverseService;
     _linkPredefinedIndicatorService = linkPredefinedIndicatorService;
 }
 public SupervisionPlanController(
     ISupervisionPlanService supervisionPlanService,
     ICatalogService catalogService,
     ISPAdministrationService spAdministrationService,
     ISpNotificationService notificationService)
 {
     _supervisionPlanService = supervisionPlanService;
     _catalogService         = catalogService;
     _viewModelMapperHelper  = new ViewModelMapperHelper(
         spAdministrationService,
         catalogService,
         notificationService);
 }
        public virtual JsonResult ValidateSqlScript(string sqlQuery, string opNumber)
        {
            if (string.IsNullOrEmpty(sqlQuery))
            {
                return(Json(Localization.GetText("OP.DTG.TemplateGen.Message.QueryEmpty"), JsonRequestBehavior.AllowGet));
            }

            var response = new ViewModelMapperHelper().VerifySqlCommands(sqlQuery)
                ? new ViewModelMapperHelper().TestSqlQuery(sqlQuery, opNumber)
                : Localization.GetText("OP.DTG.TemplateGen.Message.QueryReservedWords");

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
 public AttributeViewController(ICatalogService catalogService,
                                IAttributesManagementService attributesManagementService,
                                IMasterDataService masterDataService,
                                IConvergencePermissionService convergencePermissionService,
                                IBreRuleService breRuleService,
                                IAttributesEngineService attributesEngineService)
 {
     _masterDataService            = masterDataService;
     _catalogService               = catalogService;
     _attributesManagementService  = attributesManagementService;
     _convergencePermissionService = convergencePermissionService;
     _breRuleService               = breRuleService;
     _viewModelMapperHelper        = new ViewModelMapperHelper(ViewBag, _attributesManagementService, _catalogService, _masterDataService, _convergencePermissionService, _breRuleService);
     _attributesEngineService      = attributesEngineService;
 }
Пример #23
0
 public DelegationViewController(ICatalogService catalogService,
                                 IDelegationService delegationService,
                                 IUserTypeService userTypeService,
                                 IDocumentManagementService documentManagementService,
                                 IAuthorizationManager authorizationManager)
 {
     _catalogService        = catalogService;
     _delegationService     = delegationService;
     _userTypeService       = userTypeService;
     _viewModelMapperHelper =
         new Models.Delegation.ViewModelMapperHelper(ViewBag, _delegationService);
     _authorizeAllViewModelMapperHelper = new ViewModelMapperHelper();
     _documentManagementService         = documentManagementService;
     _authorizationManager = authorizationManager;
 }
Пример #24
0
 public OutcomesController(IOutcomesService outcomesService,
                           ITcmUniverseService tcmUniverseService,
                           ILinkPredefinedIndicatorService linkPredefinedIndicatorService,
                           ICommonTCMService commonTCMService,
                           ICatalogService catalogService,
                           IResultsMatrixRepository resultsMatrixRepository,
                           IGenericRepository <Operation> opRep)
 {
     _outcomesService                = outcomesService;
     _tcmUniverseService             = tcmUniverseService;
     _linkPredefinedIndicatorService = linkPredefinedIndicatorService;
     _commonTCMService               = commonTCMService;
     _resultsMatrixRepository        = resultsMatrixRepository;
     _viewModelMapperHelper          = new ViewModelMapperHelper(catalogService, null);
     _operationRepository            = opRep;
 }
Пример #25
0
 public VirtualEditingRoomController(
     IVerService verService,
     ICatalogService catalogService,
     IVerGenericService verGenericService,
     IVmrGenericService vmrGenericService,
     IVerStepsService verStepsService,
     IVersionHistoryService versionHistoryService,
     IVerTasksService verTasksService,
     IVerDocumentService verDocumentService,
     IVerPermissionsService verPermissionsService,
     IDocumentManagementService documentManagementService,
     IConcurrenceRepository concurrenceRepository,
     IAdUsersRepository adUsersRepository,
     IDisclosureESGDocumentBusinessLogic disclosureESGDocumentBusinessLogic,
     IVerVerifyContentService verVerifyContentService,
     IPolicyWaiverService policyWaiverService,
     IStatusPolicyWaiverService statusPolicyWaiverService,
     IDocumentRepository documentRepository)
 {
     _catalogService        = catalogService;
     _verService            = verService;
     _verGenericService     = verGenericService;
     _vmrGenericService     = vmrGenericService;
     _verStepsService       = verStepsService;
     _versionHistoryService = versionHistoryService;
     _verTasksService       = verTasksService;
     _verDocumentService    = verDocumentService;
     _verPermissionsService = verPermissionsService;
     _concurrenceRepository = concurrenceRepository;
     _adUsersRepository     = adUsersRepository;
     _policyWaiverService   = policyWaiverService;
     _viewModelMapperHelper = new ViewModelMapperHelper(
         ViewBag,
         _verService,
         _catalogService,
         _verTasksService,
         _verPermissionsService,
         _concurrenceRepository,
         _adUsersRepository);
     _documentManagementService          = documentManagementService;
     _disclosureESGDocumentBusinessLogic = disclosureESGDocumentBusinessLogic;
     _verVerifyContentService            = verVerifyContentService;
     _statusPolicyWaiverService          = statusPolicyWaiverService;
     _documentRepository = documentRepository;
 }
Пример #26
0
 public ResponseController(ICatalogService catalogService,
                           ISignatureModelRepository signatureModelRepository,
                           IProxySiscorService proxySiscorService,
                           ISiscorCorrespondenceRepository siscorCorrespondenceRepository,
                           IDocumentSiscorCorrespondenceRepository documentSiscorCorrespondenceRepository,
                           ICorrespondenceService correspondenceService,
                           IOperationDataRepository operationDataRepository,
                           IOperationRepository operationRepository)
 {
     _catalogService                         = catalogService;
     _signatureModelRepository               = signatureModelRepository;
     _proxySiscorService                     = proxySiscorService;
     _viewModelMapperHelper                  = new ViewModelMapperHelper(_catalogService, _signatureModelRepository, _proxySiscorService, _correspondenceService);
     _siscorCorrespondenceRepository         = siscorCorrespondenceRepository;
     _documentSiscorCorrespondenceRepository = documentSiscorCorrespondenceRepository;
     _correspondenceService                  = correspondenceService;
     _operationDataRepository                = operationDataRepository;
     _operationRepository                    = operationRepository;
 }
Пример #27
0
        public ViewController(
            IPCRChecklistService pcrChecklistService,
            ICatalogService catalogService,
            IPCRGuidelineService prcGuidelineService,
            IPCRFollowUpService pcrFollowUpService)
        {
            _authorizationService = AuthorizationServiceFactory.Current;
            _pcrChecklistService  = pcrChecklistService;
            _pcrGuidelineService  = prcGuidelineService;
            _pcrFollowUpService   = pcrFollowUpService;
            _catalogService       = catalogService;

            _viewModelMapperHelper = new ViewModelMapperHelper(
                ViewBag,
                _pcrChecklistService,
                _catalogService,
                _authorizationService,
                _pcrFollowUpService);
        }
Пример #28
0
 public ViewController(
     ICatalogService catalogService,
     IEnumMappingService enumMappingService,
     IMissionService missionService,
     IMissionReportService missionReportService,
     IK2DataService k2DataService,
     IK2IntegrationOpus k2IntegrationOpus,
     IDisclosureESGDocumentBusinessLogic disclosureESGDocumentBusinessLogic)
 {
     _authorizationService  = AuthorizationServiceFactory.Current;
     _missionService        = missionService;
     _catalogService        = catalogService;
     _missionReportService  = missionReportService;
     _enumMappingService    = enumMappingService;
     _k2DataService         = k2DataService;
     _k2IntegrationOpus     = k2IntegrationOpus;
     _viewModelMapperHelper = new ViewModelMapperHelper(ViewBag, _catalogService, _authorizationService, _missionService, missionReportService);
     _disclosureESGDocumentBusinessLogic = disclosureESGDocumentBusinessLogic;
 }
 public MyMeetingsController(ICatalogService catalogService,
                             IVmrService vmrService,
                             IMyMeetingsService myMeetingsService,
                             IVmrGenericService vmrGenericService,
                             ICommentService commentService,
                             ICommentRulesService commentRulesService)
 {
     _catalogService        = catalogService;
     _vmrService            = vmrService;
     _myMeetingsService     = myMeetingsService;
     _vmrGenericService     = vmrGenericService;
     _commentService        = commentService;
     _commentRulesService   = commentRulesService;
     _viewModelMapperHelper = new ViewModelMapperHelper(
         ViewBag,
         _vmrService,
         _catalogService,
         _vmrGenericService,
         _commentService,
         _commentRulesService);
 }
Пример #30
0
 public WorkflowsController(IWorkflowsService workflowsService,
                            ICatalogService catalogService,
                            IK2DataService k2DataService,
                            IGlobalModelRepository GlobalModelRepository,
                            IWorkflowTypeRepository WorkflowTypeRepository,
                            IWorkflowModelRepository workflowModelRepository,
                            IWorkflowManagerService workflowManager,
                            IValidatorService validatorService,
                            IWorkflowInstanceTaskRepository workflowInstanceTaskRepository)
 {
     _workflowsService               = workflowsService;
     _catalogService                 = catalogService;
     _viewModelMapperHelper          = new ViewModelMapperHelper(_catalogService);
     _k2DataService                  = k2DataService;
     _globalModelRepository          = GlobalModelRepository;
     _workflowTypeRepository         = WorkflowTypeRepository;
     _workflowModelRepository        = workflowModelRepository;
     _workflowManager                = workflowManager;
     _validatorService               = validatorService;
     _workflowInstanceTaskRepository = workflowInstanceTaskRepository;
 }