public RequestParser(byte[] boundary, System.Text.Encoding encoding, Areas.Lib.UploadProgress.Upload.RequestStateStore requestStateStore)
 {
     this._boundary = boundary;
     this._encoding = encoding;
     this._requestStateStore = requestStateStore;
     this._searchedContentBoundary = this.FirstBoundary;
 }
 private void Clean() {
     this.Sysid = null;
     this.Areasysid = null;
     this.Tag = string.Empty;
     this.Createdate = null;
     this.Active = null;
     this.Areas = null;
 }
 private void Clean() {
     this.Sysid = null;
     this.Publicid = null;
     this._areasysid = null;
     this.Keypath = string.Empty;
     this.Keyvalue = string.Empty;
     this.Active = null;
     this.Areas = null;
 }
    /// <summary>
    /// Listen area changes
    /// if enter ladder climb
    /// if leave ladder resume horizontal movement
    /// </summary>
    void OnAreaChange(Areas before, Areas after) {
      if ((after & Areas.Ladder) == Areas.Ladder) {
        if (character.ladder.IsAboveTop(character, character.feet)) {
          aiInput.SetY(-1);
        } else {
          aiInput.SetY(1);
        }

        aiInput.SetX(0);
        UpdateManager.SetTimeout(ContinueMoving, 2.5f);
      }
    }
 public static Areas Load(System.Nullable<int> SysId) {
     resourceSchema.Dal.Areas dbo = null;
     try {
         dbo = new resourceSchema.Dal.Areas();
         System.Data.DataSet ds = dbo.Areas_Select_One(SysId);
         Areas obj = null;
         if (GlobalTools.IsSafeDataSet(ds)) {
             if ((ds.Tables[0].Rows.Count > 0)) {
                 obj = new Areas();
                 obj.Fill(ds.Tables[0].Rows[0]);
             }
         }
         return obj;
     }
     catch (System.Exception ) {
         throw;
     }
     finally {
         if ((dbo != null)) {
             dbo.Dispose();
         }
     }
 }
示例#6
0
        public Boolean AdicionarProgramaAPresupuesto(Decimal ID_PROGRAMA_GENERAL,
            Decimal ID_EMPRESA,
            Areas AREA,
            Decimal ID_PRESUPUESTO,
            Int32 ANNO,
            String DESCRIPCION,
            Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            IdPrograma = 0;
            IdDetalleSubPrograma = 0;
            IdDetalleActividad = 0;

            sql = "usp_prog_maestra_programas_adicionar ";

            if (ID_PROGRAMA_GENERAL != 0)
            {
                sql += ID_PROGRAMA_GENERAL + ", ";
                informacion += "ID_PROGRAMA_GENERAL = '" + ID_PROGRAMA_GENERAL + "', ";
            }
            else
            {
                MensajeError += "El campo ID_PROGRAMA_GENERAL no puede ser nulo\n";
                ejecutar = false;
            }

            if (ID_EMPRESA != 0)
            {
                sql += ID_EMPRESA + ", ";
                informacion += "ID_EMPRESA = '" + ID_EMPRESA + "', ";
            }
            else
            {
                MensajeError += "El campo ID_EMPRESA no puede ser nulo\n";
                ejecutar = false;
            }

            sql += "'" + AREA.ToString() + "', ";
            informacion += "AREA = '" + AREA.ToString() + "', ";

            if (ID_PRESUPUESTO != 0)
            {
                sql += ID_PRESUPUESTO + ", ";
                informacion += "ID_PRESUPUESTO = '" + ID_PRESUPUESTO + "', ";
            }
            else
            {
                MensajeError += "El campo ID_PRESUPUESTO no puede ser nulo\n";
                ejecutar = false;
            }

            if (ANNO != 0)
            {
                sql += ANNO + ", ";
                informacion += "ANNO = '" + ANNO + "', ";
            }
            else
            {
                MensajeError += "El campo ANNO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(DESCRIPCION) == false)
            {
                sql += "'" + DESCRIPCION + "', ";
                informacion += "DESCRIPCION = '" + DESCRIPCION + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "DESCRIPCION = 'NULL', ";
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_CRE = '" + Usuario.ToString() + "'";

            if (ejecutar)
            {
                try
                {
                    IdPrograma = Convert.ToDecimal(conexion.ExecuteScalar(sql));

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PROG_MAESTRA_PROGRAMAS, tabla.ACCION_ADICIONAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    IdPrograma = 0;
                }
            }

            if (IdPrograma == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
示例#7
0
        public static NavBarItem CreateNavBarItem(this IGstoreDb db, Areas.StoreAdmin.ViewModels.NavBarItemEditAdminViewModel viewModel, StoreFront storeFront, UserProfile userProfile)
        {
            NavBarItem record = db.NavBarItems.Create();

            record.Action = viewModel.Action;
            record.ActionIdParam = viewModel.ActionIdParam;
            record.Area = viewModel.Area;
            record.Controller = viewModel.Controller;
            record.ForAnonymousOnly = viewModel.ForAnonymousOnly;
            record.ForRegisteredOnly = viewModel.ForRegisteredOnly;
            record.htmlAttributes = viewModel.htmlAttributes;
            record.IsAction = viewModel.IsAction;
            record.IsLocalHRef = viewModel.IsLocalHRef;
            record.IsPage = viewModel.IsPage;
            record.IsRemoteHRef = viewModel.IsRemoteHRef;
            record.LocalHRef = viewModel.LocalHRef;
            record.Name = viewModel.Name;
            record.OpenInNewWindow = viewModel.OpenInNewWindow;
            record.Order = viewModel.Order;
            record.PageId = viewModel.PageId;
            record.ParentNavBarItemId = viewModel.ParentNavBarItemId;
            record.RemoteHRef = viewModel.RemoteHRef;
            record.UseDividerAfterOnMenu = viewModel.UseDividerAfterOnMenu;
            record.UseDividerBeforeOnMenu = viewModel.UseDividerBeforeOnMenu;

            record.StoreFrontId = storeFront.StoreFrontId;
            record.ClientId = storeFront.ClientId;
            record.IsPending = viewModel.IsPending;
            record.StartDateTimeUtc = viewModel.StartDateTimeUtc;
            record.EndDateTimeUtc = viewModel.EndDateTimeUtc;

            record.UpdateAuditFields(userProfile);

            db.NavBarItems.Add(record);
            db.SaveChanges();

            return record;
        }
示例#8
0
        public DataTable ObtenerProgramasGeneralesPorArea(Areas AREA)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_general_maestra_obtenerTodosPorIdArea ";

            sql += "'" + AREA.ToString() + "'";

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
示例#9
0
        public Boolean TerminarProgDetallesActividad(Decimal ID_DETALLE,
            Decimal PRESUPUESTO_FINAL,
            Int32 PERSONALFINAL,
            EstadosDetalleActividad ID_ESTADO,
            String RESULTADOS_ENCUESTA,
            List<Asistencia> listaAsistencia,
            Byte[] ARCHIVO_ENCUESTA,
            Int32 ARCHIVO_ENCUESTA_TAMANO,
            String ARCHIVO_ENCUESTA_EXTENSION,
            String ARCHIVO_ENCUESTA_TYPE,
            Byte[] ARCHIVO_ASISTENCIA,
            Int32 ARCHIVO_ASISTENCIA_TAMANO,
            String ARCHIVO_ASISTENCIA_EXTENSION,
            String ARCHIVO_ASISTENCIA_TYPE,
            List<EntidadColaboradora> listaEntidadesColaboradoras,
            String CONCLUSIONES,
            String DIR_IMAGEN_REPRESENTATIVA,
            List<MaestraCompromiso> listaCompromisos,
            Areas ID_AREA)
        {
            Boolean correcto = true;

            Conexion conexion = new Conexion(Empresa);
            conexion.IniciarTransaccion();

            try
            {
                if (TerminarDetalleActividad(ID_DETALLE, PRESUPUESTO_FINAL, PERSONALFINAL, ID_ESTADO, RESULTADOS_ENCUESTA, CONCLUSIONES, DIR_IMAGEN_REPRESENTATIVA, conexion) == false)
                {
                    conexion.DeshacerTransaccion();
                    correcto = false;
                }
                else
                {
                    foreach (Asistencia a in listaAsistencia)
                    {
                        if (AdicionarRegistroControlAsistencia(ID_DETALLE, a.ID_EMPLEADO, a.ID_SOLICITUD, conexion) == false)
                        {
                            correcto = false;
                            conexion.DeshacerTransaccion();
                            break;
                        }
                    }

                    if (correcto == true)
                    {
                        if (ARCHIVO_ENCUESTA != null)
                        {
                            if (conexion.ExecuteEscalarParaAdicionarDocsAdjuntosDetalleActividad(ID_DETALLE, TiposArchivo.ENCUESTA.ToString(), ARCHIVO_ENCUESTA, ARCHIVO_ENCUESTA_EXTENSION, ARCHIVO_ENCUESTA_TAMANO, ARCHIVO_ENCUESTA_TYPE, Usuario, null, null) <= 0)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                            }
                        }
                    }

                    if (correcto == true)
                    {
                        if (ARCHIVO_ASISTENCIA != null)
                        {
                            if (conexion.ExecuteEscalarParaAdicionarDocsAdjuntosDetalleActividad(ID_DETALLE, TiposArchivo.ASISTENCIA.ToString(), ARCHIVO_ASISTENCIA, ARCHIVO_ASISTENCIA_EXTENSION, ARCHIVO_ASISTENCIA_TAMANO, ARCHIVO_ASISTENCIA_TYPE, Usuario, null, null) <= 0)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                            }
                        }
                    }

                    if (correcto == true)
                    {
                        foreach (EntidadColaboradora e in listaEntidadesColaboradoras)
                        {
                            if (AdicionarRegistroEntidadQueColaboroEnActividad(ID_DETALLE, e.ID_ENTIDAD, e.DESCRIPCION, conexion) == false)
                            {
                                correcto = false;
                                conexion.DeshacerTransaccion();
                                break;
                            }
                        }

                        if (correcto == true)
                        {
                            foreach (MaestraCompromiso compromiso in listaCompromisos)
                            {
                                if (AdicionarRegistroCompromisoEnActividad(compromiso.ID_ACTIVIDAD_GENERA, compromiso.NOMBRE_ACTIVIDAD_GENERA, compromiso.TIPO_GENERA, compromiso.COMPROMISO, compromiso.USU_LOG_RESPONSABLE, compromiso.FECHA_P, compromiso.OBSERVACIONES, compromiso.ESTADO, ID_AREA.ToString(), conexion) <= 0)
                                {
                                    correcto = false;
                                    conexion.DeshacerTransaccion();
                                    break;
                                }
                            }
                        }
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch (Exception ex)
            {
                MensajeError = ex.Message;
                correcto = false;
                conexion.DeshacerTransaccion();
            }
            finally
            {
                conexion.Desconectar();
            }

            return correcto;
        }
示例#10
0
        public DataTable ObtenerCompromisosPendientes(Areas ID_AREA)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_compromisos_obtenerPendientes_para_semaforo ";

            sql += "'" + ID_AREA.ToString() + "', ";

            sql += "'" + Usuario + "'";

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
示例#11
0
        public DataTable ObtenerHistorialProgramasEmpresaYArea(Areas area, Decimal id_empresa)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_maestra_programas_obtenerPorIdEmpresaIdArea ";

            sql += "'" + area.ToString() + "', " + id_empresa.ToString();

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
示例#12
0
        public Address(string address)
        {
            address = address.ToUpper();

            if (address.Length >= 1 && address[0] == 'M') this.area = Areas.M;
            //else if (address.Length >= 1 && address[0] == 'P') this.AddressArea = AddressArea.P;
            else if (address.Length >= 1 && address[0] == 'I') this.area = Areas.I;
            else if (address.Length >= 1 && address[0] == 'Q') this.area = Areas.Q;
            //else if (address.Length >= 1 && address[0] == 'L') this.AddressArea = AddressArea.L;
            else if (address.Length >= 2 && address.Substring(0, 2) == "DB") this.area = Areas.DB;
            //else if (address.Length >= 2 && address.Substring(0, 2) == "DI") this.AddressArea = AddressArea.DI;
            //else if (address.Length >= 2 && address.Substring(0, 2) == "VL") this.AddressArea = AddressArea.VL;
            else throw new InvalidDataException("Invalid Address");

            if (this.area == Areas.DB)
            {
                address = address.Substring(2);
                this.dataBlock = ushort.Parse(address.Substring(0, address.IndexOf('.')));
                address = address.Substring(address.IndexOf('.') + 1);

                if (address.Substring(0, 2) != "DB") throw new InvalidDataException("Invalid DB Address");
                address = address.Substring(2);

            }
            else
            {
                address = address.Substring(1);
                this.dataBlock = 0;
            }

            if (address.Length > 1 && address[0] == 'D') this.length = 4*8;
            else if (address.Length > 1 && address[0] == 'W') this.length = 2*8;
            else if (address.Length > 1 && address[0] == 'B') this.length = 1*8;
            else if (address.Length > 1 && this.area == Areas.DB && address[0] == 'X') this.length = 1;
            else if (address.Length > 1 && this.area != Areas.DB && StringHelper.IsNumeric(address[0])) this.length = 1;
            else throw new InvalidDataException("Invalid Address Type");

            if (this.length == 1)
            {
                this.transportType = TransportType.Bit;
            }
            else
            {
                this.transportType = TransportType.Byte;
            }

            if (this.length > 1 || this.area == Areas.DB && address[0] == 'X') address = address.Substring(1);

            // verify valid address
            if (!address.IsNumeric()) throw new InvalidDataException("Invalid address location");

            // bit address verification
            if (this.length == 1 && address.IndexOf('.') == -1) throw new InvalidDataException("Invalid bit address location");
            if (this.length == 1 && int.Parse(address.Substring(address.IndexOf('.') + 1)) > 7) throw new InvalidDataException("Invalid bit address location");

            // non bit address verification
            if (this.length != 1 && address.IndexOf('.') != -1) throw new InvalidDataException("Invalid non-bit address location");

            var startAddress = double.Parse(address);
            this.byteAdddress = (ushort)Math.Floor(startAddress);
            this.bitAddress = (ushort)((Math.Round(startAddress - (double)this.byteAdddress, 2)) * 10);

            this.startAddress = (uint)(this.byteAdddress * 8) + this.bitAddress;

            this.byteLength = (ushort)(this.length / 8);
        }
示例#13
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            // Verificar que se hayan seleccionado los datos

            if (cboColaborador.Text.Equals(string.Empty))
            {
                Excepcion.mostrarMensaje("ErrorRequerimientoMantenimientoDatosRegistro");
                return;
            }

            try
            {
                EquipoTesoreria   equipo         = (EquipoTesoreria)cboEquipo.SelectedItem;
                Colaborador       solicitante    = (Colaborador)cboColaborador.SelectedItem;
                DateTime          fechasolicitud = dtpFechaSolicitud.Value;
                Areas             area           = (Areas)cboArea.SelectedIndex;
                TipoMantenimiento mantenimiento  = TipoMantenimiento.Preventivo;
                if (rbtnCorrectivo.Checked == true)
                {
                    mantenimiento = TipoMantenimiento.Correctivo;
                }
                string descripcionsolicitud = txtDescRequerimiento.Text;


                //para cuando ya se realizó el mantenimiento
                Evaluacion evaluacion = Evaluacion.Pendiente;
                if (rbtnBueno.Checked == true)
                {
                    evaluacion = Evaluacion.Bueno;
                }
                else if (rbtnMalo.Checked == true)
                {
                    evaluacion = Evaluacion.Malo;
                }
                else if (rbtnRegular.Checked == true)
                {
                    evaluacion = Evaluacion.Regular;
                }
                else if (rbtnExcelente.Checked == true)
                {
                    evaluacion = Evaluacion.Excelente;
                }

                //para cuando se contacta con el proveedor
                DateTime fechaproveedor      = dtpFechaProveedor.Value;
                DateTime fechaservicio       = dtpFechaEjecucion.Value;
                string   descripcionservicio = txtDescServicio.Text;
                string   sap = txtSAP.Text;

                if (evaluacion != Evaluacion.Pendiente)
                {
                    _estado = EstadoRequerimiento.Evaluado;
                }

                if (_requerimiento == null)
                {
                    if (Mensaje.mostrarMensajeConfirmacion("MensajeRequerimientoMantenimientoRegistro") == DialogResult.Yes)
                    {
                        RequerimientoMantenimiento nueva = new RequerimientoMantenimiento(equipo: equipo, solicitante: solicitante, fechasolicitud: fechasolicitud,
                                                                                          area: area, mantenimiento: mantenimiento, descripcionsolicitud: descripcionsolicitud, evaluacion: evaluacion,
                                                                                          fechaproveedor: fechaproveedor, fechaservicio: fechaservicio, descripcionservicio: descripcionservicio, sap: sap, estado: (EstadoRequerimiento)_estado);

                        _manejador.agregarRequerimientoMantenimiento(ref nueva);
                        _padre.agregarRequerimientoMantenimiento(nueva);

                        Mensaje.mostrarMensaje("MensajeRequerimientoMantenimientoConfirmacionRegistro");
                        this.Close();
                    }
                }
                else
                {
                    RequerimientoMantenimiento copia = new RequerimientoMantenimiento(id: _requerimiento.ID, equipo: equipo, solicitante: solicitante, fechasolicitud: fechasolicitud,
                                                                                      area: area, mantenimiento: mantenimiento, descripcionsolicitud: descripcionsolicitud, evaluacion: evaluacion,
                                                                                      fechaproveedor: fechaproveedor, fechaservicio: fechaservicio, descripcionservicio: descripcionservicio, sap: sap, estado: (EstadoRequerimiento)_estado);

                    _manejador.actualizarRequerimientoMantenimiento(copia);

                    _requerimiento.Equipo               = equipo;
                    _requerimiento.Solicitante          = solicitante;
                    _requerimiento.Area                 = area;
                    _requerimiento.Estado               = _estado;
                    _requerimiento.FechaSolicitud       = fechasolicitud;
                    _requerimiento.Mantenimiento        = mantenimiento;
                    _requerimiento.DescripcionSolicitud = descripcionsolicitud;
                    _requerimiento.DescripcionServicio  = descripcionservicio;
                    _requerimiento.SAP            = sap;
                    _requerimiento.Evaluacion     = evaluacion;
                    _requerimiento.FechaProveedor = fechaproveedor;
                    _requerimiento.FechaServicio  = fechaservicio;

                    _padre.actualizarLista();
                    Mensaje.mostrarMensaje("MensajeRequerimientoMantenimientoConfirmacionActualizacion");
                    this.Close();
                }
            }
            catch (Excepcion ex)
            {
                ex.mostrarMensaje();
            }
        }
 public ActionResult VolumeUpload(Areas.Storage_Pool.Models.Storage_Volume_Upload d)
 {
     return View(d);
 }
 public static double AverageTemperatureBetweenTwoDays(Areas area, int dayOne, int dayTwo)
 {
     return AverageTemperatureBetweenTwoDays(SELECTED_MEANS[(int)area], SELECTED_PEAKS[(int)area], dayOne, dayTwo);
 }
示例#16
0
        private byte[] ReadWriteMessage(Action action, Areas addressArea, ushort dataBlock, uint startAddress, ushort length, TransportType transportType)
        {
            var message = new byte[] {(byte)action, 0x1};

            // item helder
            message = IO.Combine(message, new byte[] { 0x12, 0x0A, 0x10 });

            // transport type
            message = IO.Combine(message, new byte[] { (byte)transportType });

            // length (bytes)
            message = IO.Combine(message, IO.Split(length));

            // DB number
            if (addressArea != Areas.DB) dataBlock = 0;
            message = IO.Combine(message, IO.Split(dataBlock));

            // address area
            message = IO.Combine(message, new byte[] { (byte)addressArea });

            // start address
            message = IO.Combine(message, IO.SubSet(IO.Split(startAddress), 1, 3));

            return message;
        }
示例#17
0
        protected override void Execute(IPluginExecutionContext context, IOrganizationServiceFactory serviceFactory, IOrganizationService adminService, IOrganizationService userService)
        {
            IOrganizationService service = serviceFactory.CreateOrganizationService(null);

            try
            {
                switch (context.GetMessageName())
                {
                case PluginBase.MessageName.Create:

                    if (context.PostEntityImages.Contains("imagem") && context.PostEntityImages["imagem"] is Entity)
                    {
                        var        entidade   = context.PostEntityImages["imagem"];
                        Ocorrencia ocorrencia = entidade.Parse <Ocorrencia>(context.OrganizationName, context.IsExecutingOffline, adminService);

                        //Verifica se tem intervenção técnica
                        var        e = context.GetContextEntity();
                        Ocorrencia ocorrenciacreate = (new Domain.Servicos.RepositoryService(context.OrganizationName, false, service)).Ocorrencia.Retrieve(e.Id);
                        VerificaIntervencao(ocorrenciacreate, context, service);
                        VerificaDataDeIntalacao(ocorrenciacreate, context, service);

                        if (ocorrencia.IntegraAstec == (int)IntegrarASTEC.Sim)
                        {
                            string lstResposta = new Domain.Servicos.OcorrenciaService(context.OrganizationName, context.IsExecutingOffline, service).IntegracaoBarramento(ocorrencia);
                        }

                        if (ocorrencia.RazaoStatus.Value != (int)StatusDaOcorrencia.Fechada)
                        {
                            return;
                        }
                        var ocorrenciaService = new OcorrenciaService(context.OrganizationName, context.IsExecutingOffline);
                        ocorrenciaService.Ocorrencia = ocorrencia;
                        Areas area = ocorrenciaService.IdentificarAreaDeAtendimento();
                        if (area == Areas.ISOL)
                        {
                            ocorrenciaService.AtualizarVigenciaContrato();
                        }
                    }



                    break;

                case PluginBase.MessageName.Update:
                    if (context.PostEntityImages.Contains("imagem") && context.PostEntityImages["imagem"] is Entity)
                    {
                        var        entidade   = context.PostEntityImages["imagem"];
                        Ocorrencia ocorrencia = entidade.Parse <Ocorrencia>(context.OrganizationName, context.IsExecutingOffline, adminService);

                        //Verifica se tem intervenção técnica
                        var        eupdate          = context.GetContextEntity();
                        Ocorrencia ocorrenciaupdate = (new Domain.Servicos.RepositoryService(context.OrganizationName, false, service)).Ocorrencia.Retrieve(eupdate.Id);
                        VerificaIntervencao(ocorrenciaupdate, context, service);
                        VerificaDataDeIntalacao(ocorrenciaupdate, context, service);

                        if (ocorrencia.IntegraAstec == (int)IntegrarASTEC.Sim)
                        {
                            string lstResposta = new Domain.Servicos.OcorrenciaService(context.OrganizationName, context.IsExecutingOffline, service).IntegracaoBarramento(ocorrencia);
                        }


                        Ocorrencia entidadePre = ((Entity)context.PreEntityImages["imagem"]).Parse <Ocorrencia>(context.OrganizationName, context.IsExecutingOffline, adminService);
                        if (ocorrencia.EmpresaExecutanteId == null && entidadePre.EmpresaExecutanteId != null)
                        {
                            ocorrencia.AtualizarOperacoesSuporte = true;
                            ocorrencia.Atualizar();
                        }

                        if (ocorrencia.RazaoStatus.Value != (int)StatusDaOcorrencia.Fechada)
                        {
                            return;
                        }
                        var ocorrenciaService = new OcorrenciaService(context.OrganizationName, context.IsExecutingOffline);
                        ocorrenciaService.Ocorrencia = ocorrencia;
                        Areas area = ocorrenciaService.IdentificarAreaDeAtendimento();
                        if (area == Areas.ISOL)
                        {
                            ocorrenciaService.AtualizarVigenciaContrato();
                        }
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException(ex.Message);
            }
        }
示例#18
0
        public static ValueList CreateValueList(this IGstoreDb db, Areas.StoreAdmin.ViewModels.ValueListEditAdminViewModel viewModel, Client client, UserProfile userProfile)
        {
            ValueList record = db.ValueLists.Create();

            record.Name = viewModel.Name;
            record.Order = viewModel.Order;
            record.Description = viewModel.Description;
            record.ClientId = client.ClientId;
            record.Client = client;
            record.IsPending = viewModel.IsPending;
            record.StartDateTimeUtc = viewModel.StartDateTimeUtc;
            record.EndDateTimeUtc = viewModel.EndDateTimeUtc;

            record.UpdateAuditFields(userProfile);

            db.ValueLists.Add(record);
            db.SaveChanges();

            return record;
        }
示例#19
0
        public Decimal AdicionarRegistromaestraProgramaGeneral(String TITULO,
            String TEXTO_CABECERA,
            String TEXTO_FINAL,
            Int32 ANNO,
            Areas ID_AREA,
            String DIR_IMAGEN)
        {
            tools _tools = new tools();

            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            Decimal ID_PROGRAMA_GENERAL = 0;

            sql = "usp_prog_general_maestra_adicionar ";

            if (String.IsNullOrEmpty(TITULO) == false)
            {
                sql += "'" + TITULO + "', ";
                informacion += "TITULO = '" + TITULO + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "TITULO = 'null', ";
            }

            if (String.IsNullOrEmpty(TEXTO_CABECERA) == false)
            {
                sql += "'" + TEXTO_CABECERA + "', ";
                informacion += "TEXTO_CABECERA = '" + TEXTO_CABECERA + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "TEXTO_CABECERA = 'null', ";
            }

            if (String.IsNullOrEmpty(TEXTO_FINAL) == false)
            {
                sql += "'" + TEXTO_FINAL + "', ";
                informacion += "TEXTO_FINAL = '" + TEXTO_FINAL + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "TEXTO_FINAL = 'null', ";
            }

            if (ANNO != 0)
            {
                sql += ANNO + ", ";
                informacion += "ANNO = '" + ANNO + "', ";
            }
            else
            {
                MensajeError += "El campo AÑO no puede ser nulo ni cero 0.\n";
                ejecutar = false;
            }

            sql += "'" + ID_AREA.ToString() + "', ";
            informacion += "ID_AREA = '" + ID_AREA.ToString() + "', ";

            sql += "'" + Usuario + "', ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "', ";

            if (String.IsNullOrEmpty(DIR_IMAGEN) == false)
            {
                sql += "'" + DIR_IMAGEN + "'";
                informacion += "DIR_IMAGEN = '" + DIR_IMAGEN + "'";
            }
            else
            {
                sql += "null";
                informacion += "DIR_IMAGEN = 'null'";
            }

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);

                try
                {
                    ID_PROGRAMA_GENERAL = Convert.ToDecimal(conexion.ExecuteScalar(sql));

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PROG_GENERAL_MAESTRA, tabla.ACCION_ADICIONAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    IdDetalleActividad = 0;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return ID_PROGRAMA_GENERAL;
        }
 /// <summary>
 /// Not used atm
 /// </summary>
 public virtual void OnAreaChange(Areas before, Areas after) {
   //Debug.LogFormat("area change {1} vs {2}", before, after);
 }
示例#21
0
        public DataTable ObtenerActividadesALasQueAsistioEmpleadoPorArea(Areas AREA, Decimal ID_EMPLEADO)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_control_asistencia_actividades_obtenerPorIdEMpleadoIdArea ";

            sql += "'" + AREA.ToString() + "', " + ID_EMPLEADO.ToString();

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
示例#22
0
        public void Load(string filePath)
        {
            string jsonString;

            using (FileStream fs = new FileStream(filePath, FileMode.Open))
            {
                using (StreamReader sr = new StreamReader(fs))
                {
                    jsonString = sr.ReadToEnd();
                }
            }

            JsonSerializerOptions jso = new JsonSerializerOptions
            {
                WriteIndented = true
            };

            jso.Converters.Add(new TNodeJsonConverter());
            jso.Converters.Add(new AreaJsonConverter());
            jso.Converters.Add(new ChoiceJsonConverter());
            jso.Converters.Add(new StatementJsonConverter());
            jso.Converters.Add(new UnitConverter());
            jso.Converters.Add(new OtherJsonConverter());
            ValidateLogic vl = JsonSerializer.Deserialize <ValidateLogic>(jsonString, jso);

            TNodes    = vl.TNodes;
            Areas     = vl.Areas;
            Name      = vl.Name;
            StartNode = TNodes[vl.StartNode.ID];
            for (int i = 0; i < Areas.Count; i++)
            {
                if (Areas[i].StartNode != null)
                {
                    Areas[i].StartNode = TNodes[(Areas[i].StartNode as IDNode).ID];
                }
                if (Areas[i].Parent != null)
                {
                    if (Name == (Areas[i].Parent as IDArea).Name)
                    {
                        Areas[i].Parent = this;
                    }
                    else
                    {
                        Areas[i].Parent = Areas.Find(m => m.Name == (Areas[i].Parent as IDArea).Name);
                    }
                }
            }

            foreach (KeyValuePair <string, TNode> kv in TNodes)
            {
                if (kv.Value.NextNode != null)
                {
                    kv.Value.NextNode = TNodes[(kv.Value.NextNode as IDNode).ID];
                }
                if (kv.Value.Parent != null)
                {
                    if (Name == (kv.Value.Parent as IDArea).Name)
                    {
                        kv.Value.Parent = this;
                    }
                    else
                    {
                        kv.Value.Parent = Areas.Find(m => m.Name == (kv.Value.Parent as IDArea).Name);
                    }
                }
                if (kv.Value is Status st)
                {
                    for (int i = 0; i < st.Choices.Count; i++)
                    {
                        st.Choices[i].Node = st.Choices[i].Node != null ?
                                             TNodes[(st.Choices[i].Node as IDNode).ID] : null;
                    }
                }
            }
        }
示例#23
0
        public DataTable ObtenerDetalleActividadesPorFecha(DateTime fecha,
            Areas area,
            String encargado,
            String idEmpresa,
            String regional,
            String ciudad,
            String estado)
        {
            tools _tools = new tools();

            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_detalle_actividades_obtenerPorFecha ";

            sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(fecha) + "', '" + area.ToString() + "', ";
            sql += "'" + encargado + "', '" + idEmpresa + "', '" + regional + "', '" + ciudad + "', '" + estado + "', ";
            sql += "'" + Usuario + "'";

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
 private void Clean() {
     this.Sysid = null;
     this.Publicid = null;
     this._parentareasysid = null;
     this._childareasysid = null;
     this.Linkpath = string.Empty;
     this.Createdate = null;
     this.Lastmodifieddate = null;
     this.Active = null;
     this.Areas = null;
     this.Areas2 = null;
 }
示例#25
0
        public DataTable ObtenerPresupuestosYProgramasPorEmpresaYArea(Decimal ID_EMPRESA, Areas AREA)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_prog_presupuestos_obtenerProgramas ";

            sql += ID_EMPRESA + ", '" + AREA.ToString() + "'";

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            _dataTable.Columns.Add("CON_PROGRAMA");

            for (int i = 0; i < _dataTable.Rows.Count; i++)
            {
                DataRow fila = _dataTable.Rows[i];

                if (DBNull.Value.Equals(fila["ID_PROGRAMA"]) == false)
                {
                    fila["CON_PROGRAMA"] = "Tiene Programa Asignado";
                }
                else
                {
                    fila["CON_PROGRAMA"] = "No Tiene Programa Asignado";
                }
            }

            return _dataTable;
        }
 public int[] GetPosInArea(Areas _area)
 {
     RangeArea area = specificAreas.Find (sa => sa.areaType == _area);
     return new int[2]{Random.Range (area.startFear, area.endFear + 1), Random.Range (area.startRespect, area.endRespect + 1)};
 }
示例#27
0
        public DataTable ObtenerUsuariosProgramasRseSaludBienestar(Areas AREA)
        {
            Conexion conexion = new Conexion(Empresa);
            DataSet _dataSet = new DataSet();
            DataView _dataView = new DataView();
            DataTable _dataTable = new DataTable();
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_crt_usuarios_obtenerUsuariosRseBienestarSaludOperaciones ";

            sql += "'" + AREA.ToString() + "'";

            if (ejecutar)
            {
                try
                {
                    _dataSet = conexion.ExecuteReader(sql);
                    _dataView = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            return _dataTable;
        }
        public async Task Select_FallandoAreasyTiposInversiones()
        {
            // Arrange
            using (context) //Set the test case will use the inMemory database created in the constructor
            {
                var controller = new AccountController(null, null, null, null, context);

                //Areas
                var areaEsperada = new Areas[18] {
                    new Areas {
                        AreasId = 1, Nombre = "Sanidad"
                    }, new Areas {
                        AreasId = 2, Nombre = "Consultoria"
                    }, new Areas {
                        AreasId = 3, Nombre = "Educación"
                    }, new Areas {
                        AreasId = 4, Nombre = "Seguridad"
                    }, new Areas {
                        AreasId = 5, Nombre = "Construcción"
                    }, new Areas {
                        AreasId = 6, Nombre = "Transporte"
                    }, new Areas {
                        AreasId = 7, Nombre = "TIC"
                    }, new Areas {
                        AreasId = 8, Nombre = "Ingeniería"
                    }, new Areas {
                        AreasId = 9, Nombre = "Hogar"
                    }, new Areas {
                        AreasId = 10, Nombre = "Alimentación"
                    }, new Areas {
                        AreasId = 11, Nombre = "Textil"
                    }, new Areas {
                        AreasId = 12, Nombre = "Comercio"
                    }, new Areas {
                        AreasId = 13, Nombre = "Hosteleria"
                    }, new Areas {
                        AreasId = 14, Nombre = "Administración"
                    }, new Areas {
                        AreasId = 15, Nombre = "Automóviles"
                    }, new Areas {
                        AreasId = 16, Nombre = "Reparaciones"
                    }, new Areas {
                        AreasId = 17, Nombre = "Banca"
                    }, new Areas {
                        AreasId = 18, Nombre = "Maquinaría"
                    }
                };

                //TiposInversiones
                var tipoEsperado = new TiposInversiones[3] {
                    new TiposInversiones {
                        TiposInversionesId = 1, Nombre = "Business Angels"
                    }, new TiposInversiones {
                        TiposInversionesId = 2, Nombre = "Crownfunding"
                    }, new TiposInversiones {
                        TiposInversionesId = 3, Nombre = "Venture Capital"
                    }
                };

                //Rating
                var ratingEsperado = new Rating[4] {
                    new Rating {
                        Nombre = "A"
                    }, new Rating {
                        RatingId = 2, Nombre = "B"
                    }, new Rating {
                        RatingId = 3, Nombre = "C"
                    }, new Rating {
                        RatingId = 4, Nombre = "D"
                    }
                };

                string[] idAreas = new string[1] {
                    "1"
                };
                string[] idRating = new string[1] {
                    "1"
                };
                string[] idTiposInversion = new string[1] {
                    "1"
                };

                SelectedPreferenciasForInversor preferencias = new SelectedPreferenciasForInversor
                {
                    IdsToAddAreas          = null,
                    IdsToAddRating         = idRating,
                    IdsToAddTiposInversion = null
                };

                //Act
                var result = controller.SelectPreferenciasForInversor(preferencias);

                //Assert

                var viewResult = Assert.IsType <ViewResult>(result);
                SelectPreferenciasForInversorViewModel model = viewResult.Model as SelectPreferenciasForInversorViewModel;

                Assert.Equal(areaEsperada, model.Areas, Comparer.Get <Areas>((a1, a2) => a1.Nombre == a2.Nombre));
                Assert.Equal(tipoEsperado, model.TiposInversiones, Comparer.Get <TiposInversiones>((t1, t2) => t1.Nombre == t2.Nombre));
                Assert.Equal(ratingEsperado, model.Rating, Comparer.Get <Rating>((r1, r2) => r1.Nombre == r2.Nombre));
            }
        }
示例#29
0
        public Boolean AdicionarDetalleActividad(Decimal ID_PROGRAMA_GENERAL,
            Decimal ID_PROGRAMA,
            Decimal ID_EMPRESA,
            Areas AREA,
            Decimal ID_PRESUPUESTO,
            Int32 ANNO,
            Decimal ID_ACTIVIDAD,
            DateTime FECHA_ACTIVIDAD,
            String HORA_INICIO,
            String HORA_FIN,
            Decimal PRESUPUESTO_APROBADO,
            Int32 PERSONAL_CITADO,
            String ENCARGADO,
            String ID_CIUDAD,
            String RESUMEN_ACTIVIDAD,
            Decimal ID_DETALLE_GENERAL)
        {
            Boolean correcto = true;

            Conexion conexion = new Conexion(Empresa);
            conexion.IniciarTransaccion();

            try
            {
                if (ID_PROGRAMA == 0)
                {
                    if (AdicionarProgramaAPresupuesto(ID_PROGRAMA_GENERAL, ID_EMPRESA, AREA, ID_PRESUPUESTO, ANNO, null, conexion) == false)
                    {
                        conexion.DeshacerTransaccion();
                        correcto = false;
                    }
                    else
                    {
                        ID_PROGRAMA = IdPrograma;
                    }
                }
                else
                {
                    IdPrograma = ID_PROGRAMA;
                }

                if (correcto == true)
                {
                    if (AdicionarRegistroDetalleActividad(ID_PROGRAMA, ID_DETALLE_GENERAL, ID_ACTIVIDAD, RESUMEN_ACTIVIDAD, FECHA_ACTIVIDAD, HORA_INICIO, HORA_FIN, PRESUPUESTO_APROBADO, PERSONAL_CITADO, ENCARGADO, ID_CIUDAD, conexion) == false)
                    {
                        conexion.DeshacerTransaccion();
                        correcto = false;
                    }
                }

                if (correcto == true)
                {
                    conexion.AceptarTransaccion();
                }
            }
            catch (Exception ex)
            {
                correcto = false;
                conexion.DeshacerTransaccion();
                MensajeError = ex.Message;
            }
            finally
            {
                conexion.Desconectar();
            }

            return correcto;
        }
 public static AreasCollection GetAll() {
     resourceSchema.Dal.Areas dbo = null;
     try {
         dbo = new resourceSchema.Dal.Areas();
         System.Data.DataSet ds = dbo.Areas_Select_All();
         AreasCollection collection = new AreasCollection();
         if (GlobalTools.IsSafeDataSet(ds)) {
             for (int i = 0; (i < ds.Tables[0].Rows.Count); i = (i + 1)) {
                 Areas obj = new Areas();
                 obj.Fill(ds.Tables[0].Rows[i]);
                 if ((obj != null)) {
                     collection.Add(obj);
                 }
             }
         }
         return collection;
     }
     catch (System.Exception ) {
         throw;
     }
     finally {
         if ((dbo != null)) {
             dbo.Dispose();
         }
     }
 }
示例#31
0
 public bool EditArea(Areas page)
 {
     return Containner.SaveChanges() > 0;
 }
示例#32
0
        public static NavBarItem UpdateNavBarItem(this IGstoreDb db, Areas.StoreAdmin.ViewModels.NavBarItemEditAdminViewModel viewModel, StoreFront storeFront, UserProfile userProfile)
        {
            //find existing record, update it
            NavBarItem record = storeFront.NavBarItems.SingleOrDefault(p => p.NavBarItemId == viewModel.NavBarItemId);
            if (record == null)
            {
                throw new ApplicationException("Nav Bar Item not found in storefront Nav Bar Items . Nav Bar Item Id: " + viewModel.NavBarItemId);
            }

            record.Action = viewModel.Action;
            record.ActionIdParam = viewModel.ActionIdParam;
            record.Area = viewModel.Area;
            record.Controller = viewModel.Controller;
            record.ForAnonymousOnly = viewModel.ForAnonymousOnly;
            record.ForRegisteredOnly = viewModel.ForRegisteredOnly;
            record.htmlAttributes = viewModel.htmlAttributes;
            record.IsAction = viewModel.IsAction;
            record.IsLocalHRef = viewModel.IsLocalHRef;
            record.IsPage = viewModel.IsPage;
            record.IsRemoteHRef = viewModel.IsRemoteHRef;
            record.LocalHRef = viewModel.LocalHRef;
            record.Name = viewModel.Name;
            record.OpenInNewWindow = viewModel.OpenInNewWindow;
            record.Order = viewModel.Order;
            record.PageId = viewModel.PageId;
            record.ParentNavBarItemId = viewModel.ParentNavBarItemId;
            record.RemoteHRef = viewModel.RemoteHRef;
            record.UseDividerAfterOnMenu = viewModel.UseDividerAfterOnMenu;
            record.UseDividerBeforeOnMenu = viewModel.UseDividerBeforeOnMenu;

            record.IsPending = viewModel.IsPending;
            record.StartDateTimeUtc = viewModel.StartDateTimeUtc;
            record.EndDateTimeUtc = viewModel.EndDateTimeUtc;
            record.UpdatedBy = userProfile;
            record.UpdateDateTimeUtc = DateTime.UtcNow;

            db.NavBarItems.Update(record);
            db.SaveChanges();

            return record;
        }
示例#33
0
 public bool AddAreas(Areas area)
 {
     Containner.AddToAreas(area);
     return Containner.SaveChanges() > 0;
 }
        public async Task Select_ConParametros()
        {
            // Arrange
            using (context) //Set the test case will use the inMemory database created in the constructor
            {
                var controller = new AccountController(null, null, null, null, context);

                //Areas
                var areaEsperada = new Areas[18] {
                    new Areas {
                        AreasId = 1, Nombre = "Sanidad"
                    }, new Areas {
                        AreasId = 2, Nombre = "Consultoria"
                    }, new Areas {
                        AreasId = 3, Nombre = "Educación"
                    }, new Areas {
                        AreasId = 4, Nombre = "Seguridad"
                    }, new Areas {
                        AreasId = 5, Nombre = "Construcción"
                    }, new Areas {
                        AreasId = 6, Nombre = "Transporte"
                    }, new Areas {
                        AreasId = 7, Nombre = "TIC"
                    }, new Areas {
                        AreasId = 8, Nombre = "Ingeniería"
                    }, new Areas {
                        AreasId = 9, Nombre = "Hogar"
                    }, new Areas {
                        AreasId = 10, Nombre = "Alimentación"
                    }, new Areas {
                        AreasId = 11, Nombre = "Textil"
                    }, new Areas {
                        AreasId = 12, Nombre = "Comercio"
                    }, new Areas {
                        AreasId = 13, Nombre = "Hosteleria"
                    }, new Areas {
                        AreasId = 14, Nombre = "Administración"
                    }, new Areas {
                        AreasId = 15, Nombre = "Automóviles"
                    }, new Areas {
                        AreasId = 16, Nombre = "Reparaciones"
                    }, new Areas {
                        AreasId = 17, Nombre = "Banca"
                    }, new Areas {
                        AreasId = 18, Nombre = "Maquinaría"
                    }
                };

                //TiposInversiones
                var tipoEsperado = new TiposInversiones[3] {
                    new TiposInversiones {
                        TiposInversionesId = 1, Nombre = "Business Angels"
                    }, new TiposInversiones {
                        TiposInversionesId = 2, Nombre = "Crownfunding"
                    }, new TiposInversiones {
                        TiposInversionesId = 3, Nombre = "Venture Capital"
                    }
                };

                //Rating
                var ratingEsperado = new Rating[4] {
                    new Rating {
                        Nombre = "A"
                    }, new Rating {
                        RatingId = 2, Nombre = "B"
                    }, new Rating {
                        RatingId = 3, Nombre = "C"
                    }, new Rating {
                        RatingId = 4, Nombre = "D"
                    }
                };

                string[] idAreas = new string[1] {
                    "1"
                };
                string[] idRating = new string[1] {
                    "1"
                };
                string[] idTiposInversion = new string[1] {
                    "1"
                };

                SelectedPreferenciasForInversor preferencias = new SelectedPreferenciasForInversor
                {
                    IdsToAddAreas          = idAreas,
                    IdsToAddRating         = idRating,
                    IdsToAddTiposInversion = idTiposInversion
                };

                //Act
                var result = controller.SelectPreferenciasForInversor(preferencias);

                //Assert
                var viewResult              = Assert.IsType <RedirectToActionResult>(result);
                var currentAreas            = viewResult.RouteValues.Values.First();
                var currentRating           = viewResult.RouteValues.Values.First();
                var currentTiposInversiones = viewResult.RouteValues.Values.First();

                Assert.Equal(preferencias.IdsToAddAreas, currentAreas);
                Assert.Equal(preferencias.IdsToAddRating, currentRating);
                Assert.Equal(preferencias.IdsToAddTiposInversion, currentTiposInversiones);
            }
        }