예제 #1
0
        private static void ModificarOpcion(CotizacionDirecta cotizacionDirecta, Opcion o, SqlCommand command)
        {
            var com = command.Connection.CreateCommand();

            com.Transaction = command.Transaction;

            com.CommandText = "SP_A_COTIZACION_DIRECTA_OPCIONES";

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@id", o.Id32);
            com.Parameters.AddWithValue("@numero", o.Numero);
            com.Parameters.AddWithValue("@fechaValidezInicio", o.FechaValidezInicio);
            com.Parameters.AddWithValue("@fechaValidezFin", o.FechaValidezFin);
            com.Parameters.AddWithValue("@Naviera", o.Naviera.Id32);
            com.Parameters.AddWithValue("@TiempoTransito", o.TiempoTransito);
            com.Parameters.AddWithValue("@idUsuario", o.Usuario.Id32);
            com.Parameters.AddWithValue("@idTipoServicio", o.TiposServicio.Id32);
            if (o.TipoVia != null)
            {
                com.Parameters.AddWithValue("@idTipoVia", o.TipoVia.Id32);
            }
            else
            {
                com.Parameters.AddWithValue("@idTipoVia", DBNull.Value);
            }

            com.CommandType = CommandType.StoredProcedure;

            com.ExecuteScalar();
            ModificarDetalle(o, command);
            ModificarRelacionPuertos(o, command);
        }
예제 #2
0
        public Opcion Agregar(Opcion opcion)
        {
            try
            {
                Sql = "INSERT INTO OPCION(nombre,descripcion,estado,idModulo) VALUES(@nombre,@descripcion,@estado,@modulo) SELECT @@IDENTITY AS Id ;";
                if (conectar(Sql))
                {
                    cmd.Parameters.AddWithValue("@nombre", opcion.Nombre);
                    cmd.Parameters.AddWithValue("@descripcion", opcion.Descripcion);
                    cmd.Parameters.AddWithValue("@estado", OpcionEnum.Activo);
                    cmd.Parameters.AddWithValue("@modulo", opcion.modulo.Id);
                    var reader = cmd.ExecuteReader();
                    reader.Read();

                    opcion.Id = long.Parse(reader[0].ToString());
                    Console.WriteLine("id generado " + opcion.Id);
                    return(opcion);
                }
                return(null);
            }
            catch (Exception e)
            {
                Console.WriteLine("error mensaje " + e.Message);
                return(null);
            }
            finally
            {
                desConectar();
            }
        }
예제 #3
0
        private void instanceAll(ApplicationDbContext db)
        {
            PreguntaCreacion       = new Pregunta();
            this.ListaPruebas      = this.consultarPruebas(db);
            this.ListaContextos    = this.consultarContextos(db);
            this.ListaCompetencias = this.consultarCompetencias(db);
            OpcionA = new Opcion()
            {
                Correcta = false
            };
            OpcionB = new Opcion()
            {
                Correcta = false
            };
            OpcionC = new Opcion()
            {
                Correcta = false
            };
            OpcionD = new Opcion()
            {
                Correcta = false
            };

            /*OpcionesCreacion.Add(OpcionA);
            *  OpcionesCreacion.Add(OpcionB);
            *  OpcionesCreacion.Add(OpcionC);
            *  OpcionesCreacion.Add(OpcionD);*/
        }
예제 #4
0
        private static void CrearOpcionDetalle(Opcion opcion, DetalleOpcion detalle, SqlCommand command)
        {
            var com = command.Connection.CreateCommand();

            com.Transaction = command.Transaction;

            com.CommandText = "SP_N_COTIZACION_DIRECTA_OPCIONES_DETALLES";

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@cantidad", detalle.Cantidad);
            com.Parameters.AddWithValue("@costo", detalle.Costo);
            com.Parameters.AddWithValue("@venta", detalle.Venta);
            com.Parameters.AddWithValue("@COTIZACION_MONEDAS_id", detalle.Moneda.Id32);
            com.Parameters.AddWithValue("@COTIZACION_DIRECTA_ITEMS_id", detalle.Unidad.Id32);
            com.Parameters.AddWithValue("@COTIZACION_DIRECTA_CONCEPTO_ID", detalle.Concepto.Id32);
            com.Parameters.AddWithValue("@COTIZACION_DIRECTA_OPCIONES_id", opcion.Id32);
            com.CommandType = CommandType.StoredProcedure;
            var outParam = com.Parameters.Add("@Id", SqlDbType.BigInt);

            outParam.Direction = ParameterDirection.Output;
            com.ExecuteScalar();

            detalle.Id   = Convert.ToInt16(outParam.Value);
            detalle.Id32 = Convert.ToInt32(outParam.Value);
        }
        private void CargarCboMecanismoFinanciamiento()
        {
            List <Opcion> lista   = new List <Opcion>(4);
            Opcion        opcion0 = new Opcion();

            opcion0.clave = string.Empty;
            opcion0.valor = "--SELECCIONE--";
            Opcion opcion1 = new Opcion();

            opcion1.clave = "P";
            opcion1.valor = "PROSPECTIVO";
            Opcion opcion2 = new Opcion();

            opcion2.clave = "R";
            opcion2.valor = "RETROSPECTIVO";
            Opcion opcion3 = new Opcion();

            opcion3.clave = "H";
            opcion3.valor = "PROSPECTIVO/RETROSPECTIVO";
            lista.Add(opcion0);
            lista.Add(opcion1);
            lista.Add(opcion2);
            lista.Add(opcion3);
            cboMecanismoFinanciamiento.DataSource    = lista;
            cboMecanismoFinanciamiento.ValueMember   = "clave";
            cboMecanismoFinanciamiento.DisplayMember = "valor";
        }
        public TipoArticuloWindows(Opcion op, TipoArticuloClass tipoArticulo, ref List <TipoArticuloWindows> ventanas)
        {
            InitializeComponent();

            opcion            = op;
            this.tipoArticulo = null;
            if (op != Opcion.nuevo)
            {
                this.tipoArticulo = tipoArticulo;
            }

            _ventanas = ventanas;


            //Inicializar componentes de la pantalla
            switch (op)
            {
            case Opcion.nuevo:
                this.InicializarComponentesNuevo();


                break;

            case Opcion.modificar:
                this.InicializarComponentesModificar();
                this.CargarDatosModificar();
                break;

            case Opcion.consultar:
                this.InicializarComponentesConsultar();
                this.CargarDatosConsultar();
                break;
            }
        }
예제 #7
0
파일: OpcionBl.cs 프로젝트: RSEANCAS/aprif
        public bool MantenerOpcion(Opcion opcion)
        {
            OpcionDa opcionDa  = new OpcionDa();
            bool     respuesta = false;

            try
            {
                cn.Open();
                respuesta = opcionDa.MantenerOpcion(opcion, cn);
                cn.Close();
            }
            catch (Exception ex)
            {
                respuesta = false;
            }
            finally
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                }
            }

            return(respuesta);
        }
        private void CargarCboTipoEstadistica()
        {
            List <Opcion> lista   = new List <Opcion>(4);
            Opcion        opcion0 = new Opcion();

            opcion0.clave = string.Empty;
            opcion0.valor = "--SELECCIONE--";
            Opcion opcion1 = new Opcion();

            opcion1.clave = "1";
            opcion1.valor = "ATENDIDOS POR REGION";
            Opcion opcion2 = new Opcion();

            opcion2.clave = "2";
            opcion2.valor = "ATENDIDOS POR CATEGORIA";
            Opcion opcion3 = new Opcion();

            opcion3.clave = "3";
            opcion3.valor = "ATENDIDOS POR REGION/CATEGORIA";
            lista.Add(opcion0);
            lista.Add(opcion1);
            lista.Add(opcion2);
            lista.Add(opcion3);
            cboTipoEstadistica.DataSource    = lista;
            cboTipoEstadistica.ValueMember   = "clave";
            cboTipoEstadistica.DisplayMember = "valor";
        }
예제 #9
0
파일: OpcionBl.cs 프로젝트: RSEANCAS/aprif
        public Opcion ObtenerOpcion(int plataformaId, int opcionId)
        {
            OpcionDa opcionDa  = new OpcionDa();
            Opcion   respuesta = null;

            try
            {
                cn.Open();
                respuesta = opcionDa.ObtenerOpcion(plataformaId, opcionId, cn);
                cn.Close();
            }
            catch (Exception ex)
            {
                respuesta = null;
            }
            finally
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                }
            }

            return(respuesta);
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Nombre,CaracteristicaID")] Opcion opcion)
        {
            if (id != opcion.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(opcion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OpcionExists(opcion.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CaracteristicaID"] = new SelectList(_context.Caracteristicas, "ID", "ID", opcion.CaracteristicaID);
            return(View(opcion));
        }
예제 #11
0
        private static int PideDatos(Opcion opcion)
        {
            ICalculadora calc = new Calculadora();
            int          num1, num2, resultado = 0;

            Console.WriteLine("Introduce el primer número de la operación");
            num1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Introduce el segundo número de la operación");
            num2 = Convert.ToInt32(Console.ReadLine());


            switch (opcion)
            {
            case Opcion.Suma:
                return(calc.Suma(num1, num2));

            case Opcion.Resta:
                return(calc.Resta(num1, num2));

            case Opcion.Multiplicacion:
                return(calc.Multiplicacion(num1, num2));

            case Opcion.Division:
                return(calc.Division(num1, num2));

            default:
                return(resultado);
            }
        }
예제 #12
0
        public Opcion Actualizar(Opcion opcion)
        {
            try
            {
                Sql = "UPDATE OPCION SET nombre=@nombre,descripcion=@descripcion,estado=@estado WHERE id=@id;";
                if (conectar(Sql))
                {
                    cmd.Parameters.AddWithValue("@nombre", opcion.Nombre);
                    cmd.Parameters.AddWithValue("@descripcion", opcion.Descripcion);
                    cmd.Parameters.AddWithValue("@estado", opcion.Estado);
                    cmd.Parameters.AddWithValue("@id", opcion.Id);
                    cmd.ExecuteReader();

                    return(opcion);
                }
                return(null);
            }
            catch (Exception e)
            {
                Console.WriteLine("error mensaje " + e.Message);
                return(null);
            }
            finally
            {
                desConectar();
            }
        }
예제 #13
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var boton      = dataGridView1.Rows[e.RowIndex].Cells["Detalle"].Selected;
            var nombretipo = dataGridView1.Rows[e.RowIndex].Cells["Departamento"].Value;

            // ReSharper disable once PossibleNullReferenceException
            if (boton && nombretipo != null && nombretipo.ToString() != "TOTAL INVENTARIO:")
            {
                Departamento.DetalleDepartamento(json =>
                {
                    _listadetalle = Opcion.JsonaListaGenerica <DepartamentoDetalle>(json);
                    var addIn     = Globals.ThisAddIn;
                    addIn.DetalleDepartamento(_listadetalle);
                },
                                                 new ReporteGenerico
                {
                    idSucursal  = cbSucursales.SelectedValue.ToString(),
                    fechaInicio = dtFechaIni.Value,
                    fechaFin    = dtFechaFin.Value,
                    //fecha = dtFechaFin.Value,
                    busqueda   = nombretipo.ToString(),
                    idConcepto = 2
                });
            }
        }
예제 #14
0
        public async Task <bool> DeleteOpcion(Opcion value)
        {
            context.Remove(value);
            await context.SaveChangesAsync();

            return(true);
        }
예제 #15
0
        public List <Opcion> ConsultarMenu(int Modulo)
        {
            DbCommand     dbConsulta;
            List <Opcion> _opciones = new List <Opcion>();
            Opcion        _opt;

            try
            {
                dbConsulta = conexionDB.GetStoredProcCommand("PRC_CONSULTARMENU");
                conexionDB.AddInParameter(dbConsulta, "@modulo", DbType.Int16, Modulo);
                using (IDataReader dr = conexionDB.ExecuteReader(dbConsulta))
                {
                    while (dr.Read())
                    {
                        _opt             = new Opcion();
                        _opt.Consecutivo = Convert.ToInt32(dr["identificador"]);
                        _opt.nombre      = dr["nombre"].ToString();
                        _opt.url         = dr["url"].ToString();
                        _opt.padre       = Convert.ToInt32(dr["padre"]);
                        _opt.modulo      = Convert.ToInt32(dr["modulo"]);
                        _opciones.Add(_opt);
                    }
                }
            }
            catch (Exception ex)
            {
                CLS_Error error = new CLS_Error(ex.Message + "-" + ex.StackTrace);
            }
            return(_opciones);
        }
예제 #16
0
        public void AjustarInventario(IRestResponse restResponse)
        {
            Application.ScreenUpdating = false;
            var rrg = Opcion.JsonaListaGenerica <AjusteArticulo>(restResponse);

            _rowCount = (rrg.Count + 1);
            _reporte  = InicializarExcelConTemplate("AjusteInventario"); //TODO traer de la base de datos

            if (_reporte != null)
            {
                var oRng = _reporte.Range["A1", "T" + _rowCount];
                //    oRng.Cells.AutoFilter(1, Type.Missing, Excel.XlAutoFilterOperator.xlAnd, Type.Missing, true);
                var rowlength = Int32.Parse(Globals.ThisAddIn.Application.ActiveSheet.Cells.Find("*", Missing.Value,
                                                                                                 Missing.Value, Missing.Value, Excel.XlSearchOrder.xlByRows,
                                                                                                 Excel.XlSearchDirection.xlPrevious, false, Missing.Value,
                                                                                                 Missing.Value)
                                            .Row.ToString());
                if (rowlength > 1)
                {
                    _reporte.Range[
                        "A" + 2 + ":T" + Globals.ThisAddIn.Application.ActiveSheet.Cells.Find("*", Missing.Value,
                                                                                              Missing.Value, Missing.Value, Excel.XlSearchOrder.xlByRows,
                                                                                              Excel.XlSearchDirection.xlPrevious, false, Missing.Value,
                                                                                              Missing.Value)
                        .Row].Value2 = "";
                }
                _reporte.Range["A" + 2 + ":L" + _rowCount].Value2 = InicializarLista(rrg);
                _reporte.Range["A" + 2 + ":L" + _rowCount].Validation.Delete();
                Application.ScreenUpdating = true;
            }
            else
            {
                //  MessageBox.Show(@"No se encontraron resultados con la busqueda indicada");
            }
        }
        public async Task <ActionResult <Opcion> > PostOpcion(Opcion opcion)
        {
            _context.Opciones.Add(opcion);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetOpcion", new { id = opcion.ID }, opcion));
        }
예제 #18
0
        public async Task <Opcion> AddOpcion(Opcion value)
        {
            await context.Opcion.AddAsync(value);

            context.SaveChanges();
            return(value);
        }
예제 #19
0
 public ReporteDepartamentoCabecero()
 {
     InitializeComponent();
     Sucursal.Consultar(json => {
         Opcion.CargarComboBox(this, cbSucursales, json);
     });
 }
예제 #20
0
        /// <summary>
        /// Obtener las opciones de un perfil.
        /// </summary>
        /// <param name="p">Perfilol para el cual se obtienen las opciones</param>
        public void obtenerOpcionesPerfil(ref Perfil p)
        {
            SqlCommand    comando    = _manejador.obtenerProcedimiento("SelectOpcionesPorPerfil");
            SqlDataReader datareader = null;

            _manejador.agregarParametro(comando, "@perfil", p, SqlDbType.TinyInt);

            try
            {
                datareader = _manejador.ejecutarConsultaDatos(comando);

                while (datareader.Read())
                {
                    byte   id     = (byte)datareader["pk_ID"];
                    string nombre = (string)datareader["Nombre"];
                    string boton  = (string)datareader["Boton"];

                    Opcion opcion = new Opcion(id, nombre, boton);

                    p.agregarOpcion(opcion);
                }

                comando.Connection.Close();
            }
            catch (Exception)
            {
                comando.Connection.Close();
                throw new Excepcion("ErrorDatosConexion");
            }
        }
        private void CargarCboTipoEstadistica()
        {
            List <Opcion> lista   = new List <Opcion>(4);
            Opcion        opcion0 = new Opcion();

            opcion0.clave = string.Empty;
            opcion0.valor = "--SELECCIONE--";
            Opcion opcion1 = new Opcion();

            opcion1.clave = "1";
            opcion1.valor = "ATENCIONES SUPERVISADAS";
            Opcion opcion2 = new Opcion();

            opcion2.clave = "2";
            opcion2.valor = "ATENCIONES SUPERVISADAS POR IPRESS";
            Opcion opcion3 = new Opcion();

            opcion3.clave = "3";
            opcion3.valor = "ATENCIONES SUPERVISADAS POR AUDITOR";
            lista.Add(opcion0);
            lista.Add(opcion1);
            lista.Add(opcion2);
            lista.Add(opcion3);
            cboTipoEstadistica.DataSource    = lista;
            cboTipoEstadistica.ValueMember   = "clave";
            cboTipoEstadistica.DisplayMember = "valor";
        }
예제 #22
0
        public frmMantenimientoPerfiles(Perfil perfil)
        {
            InitializeComponent();

            _perfil = perfil;

            txtNombre.Text = _perfil.Nombre;

            try
            {
                // Cargar las opciones de acceso

                this.cargarDatos();

                // Asignar las opciones actuales del perfil

                for (int i = 0; i < clbOpciones.Items.Count; i++)
                {
                    Opcion opcion = (Opcion)clbOpciones.Items[i];
                    bool   estado = _perfil.Opciones.Contains(opcion);

                    clbOpciones.SetItemChecked(i, estado);
                }
            }
            catch (Exception ex)
            {
                this.Close();
                throw ex;
            }
        }
예제 #23
0
        private void CargarCboTipoEstadistica()
        {
            List <Opcion> lista   = new List <Opcion>(5);
            Opcion        opcion0 = new Opcion();

            opcion0.clave = string.Empty;
            opcion0.valor = "--SELECCIONE--";
            Opcion opcion1 = new Opcion();

            opcion1.clave = "1";
            opcion1.valor = "AUTORIZACIONES POR AÑO";
            Opcion opcion2 = new Opcion();

            opcion2.clave = "2";
            opcion2.valor = "AUTORIZACIONES POR AÑO/MES";
            Opcion opcion3 = new Opcion();

            opcion3.clave = "3";
            opcion3.valor = "AUTORIZACIONES POR IPRESS";
            Opcion opcion4 = new Opcion();

            opcion4.clave = "4";
            opcion4.valor = "AUTORIZACIONES POR PACIENTE";
            lista.Add(opcion0);
            lista.Add(opcion1);
            lista.Add(opcion2);
            lista.Add(opcion3);
            lista.Add(opcion4);
            cboTipoEstadistica.DataSource    = lista;
            cboTipoEstadistica.ValueMember   = "clave";
            cboTipoEstadistica.DisplayMember = "valor";
        }
예제 #24
0
        public Opcion Agregar(Opcion ent)
        {
            galaxyContext.Opciones.Add(ent);
            galaxyContext.SaveChanges();

            return(ent);
        }
예제 #25
0
        public void ResumenMensual(Office.IRibbonControl control)
        {
            var      addIn     = Globals.ThisAddIn;
            DateTime fecha     = DateTime.Now;
            var      iniciomes = new DateTime(fecha.Year, fecha.Month, 1).ToShortDateString();                 //primer dia del mes actual
            var      finmes    = new DateTime(fecha.Year, fecha.Month + 1, 1).AddDays(-1).ToShortDateString(); //ultimo dia del mes actual

            //var inicio = Convert.ToDateTime(iniciomes).ToString("yyyy-MM-dd");
            //var fin = Convert.ToDateTime(finmes).ToString("yyyy-MM-dd");
            Opcion.EjecucionAsync(x =>
            {
                var times = new General
                {
                    FechaFin = Convert.ToDateTime(finmes),
                    FechaIni = Convert.ToDateTime(iniciomes)
                };
                Reporte.AvanceSemanal(x, times);
            }, jsonResult =>
            {
                if (jsonResult != null)
                {
                    var listaSemana    = Opcion.JsonaListaGenerica <DatosSemanal>(jsonResult).ToList();
                    ListaDatosSemanals = listaSemana;
                    addIn.ResumenSemanal(listaSemana);
                }
                else
                {
                    MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                }
            });
        }
예제 #26
0
        /// <summary>
        /// Listar las opciones del sistema.
        /// </summary>
        /// <returns>Lista de las opciones del sistema</returns>
        public BindingList <Opcion> listarOpciones()
        {
            BindingList <Opcion> opciones = new BindingList <Opcion>();

            SqlCommand    comando    = _manejador.obtenerProcedimiento("SelectOpciones");
            SqlDataReader datareader = null;

            try
            {
                datareader = _manejador.ejecutarConsultaDatos(comando);

                while (datareader.Read())
                {
                    byte   id     = (byte)datareader["pk_ID"];
                    string nombre = (string)datareader["Nombre"];
                    string boton  = (string)datareader["Boton"];

                    Opcion opcion = new Opcion(id, nombre, boton);

                    opciones.Add(opcion);
                }

                comando.Connection.Close();
            }
            catch (Exception)
            {
                comando.Connection.Close();
                throw new Excepcion("ErrorDatosConexion");
            }

            return(opciones);
        }
예제 #27
0
        public void Test1()
        {
            Modulo modulos = new Modulo
            {
                Nombre      = "Permiso",
                Descripcion = "NINGUNA",
                Estado      = ModulosEnum.Activo,
                Id          = 1
            };

            Opcion opcion = new Opcion
            {
                Nombre      = "opcion 1",
                Descripcion = "descripcion prueba",
                Estado      = OpcionEnum.Activo,
                modulo      = modulos
            };

            Rol rol = new Rol
            {
                Nombre      = "Admnistrador",
                Descripcion = "Todo los permisos",
                Estado      = RolEstado.Activo
            };

            DatoRol       Drol          = new DatoRol();
            DatoModulos   datoModulos   = new DatoModulos();
            DatoOpciones  datoOpciones  = new DatoOpciones();
            DatoUsuario   datoUsuario   = new DatoUsuario();
            DatoRol       datoRol       = new DatoRol();
            LogicaUsuario logicaUsuario = new LogicaUsuario();
            DatoPermiso   datoPermiso   = new DatoPermiso();

            Assert.IsTrue(datoPermiso.Denegar(2, 1));
        }
예제 #28
0
        public static void SeleccionarTradePerdedor(Action <IRestResponse> callback, General fechas)
        {
            try
            {
                var rest = new Rest(Local.Api.UrlApi, Resumen.Anual.TradeLoss, Method.POST);
                rest.Peticion.AddHeader(Constantes.Http.ObtenerTipoDeContenido, Constantes.Http.TipoDeContenido.Json);
                rest.Peticion.AddJsonBody(fechas);
                rest.Cliente.ExecuteAsync(rest.Peticion, response =>
                {
                    switch (response.StatusCode)
                    {
                    case HttpStatusCode.OK:
                        callback(response);
                        break;

                    default:
                        callback(null);
                        break;
                    }
                });
            }
            catch (Exception e)
            {
                Opcion.Log(Log.Interno.ResSemanal, "EXCEPCION: " + e.Message);
            }
        }
예제 #29
0
        public static void Guardar(Action <IRestResponse> callback, List <Guardar> guardar)
        {
            try
            {
                var rest = new Rest(Local.Api.UrlApi, Resumen.Semanal.GuardarResumen, Method.POST);
                rest.Peticion.AddHeader(Constantes.Http.ObtenerTipoDeContenido, Constantes.Http.TipoDeContenido.Json);
                rest.Peticion.AddJsonBody(guardar);
                rest.Cliente.ExecuteAsync(rest.Peticion, response =>
                {
                    switch (response.StatusCode)
                    {
                    case HttpStatusCode.OK:
                        callback(response);
                        break;

                    default:
                        throw new Exception(@"error al buscar articulo");
                    }
                });
            }
            catch (Exception e)
            {
                Opcion.Log(Log.Interno.ResMensual, "EXCEPCION: " + e.Message);
                // callback("CONTINUAR");
            }
        }
        public async Task <IActionResult> PutOpcion(int id, Opcion opcion)
        {
            if (id != opcion.ID)
            {
                return(BadRequest());
            }

            _context.Entry(opcion).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OpcionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #31
0
 public MainMenu(Game game)
     : base(game)
 {
     _spriteBatch = new SpriteBatch(GraphicsDevice);
     _opcionActual = Opcion.Jugar;
     _movementTime = TimeSpan.FromSeconds(.20f);
     _songStart = false;
 }
예제 #32
0
        public void CreateAChildTreeNode()
        {
            var node = new Opcion { ParentID = 1, OpcionID = 1, Descripcion = "description" };

            var newNode = _TreeViewBinder.CreateTreeNode(node);

            Assert.That(newNode.Text, Is.EqualTo(string.Format(
                                @"<span class=""SubTema"">{0}</span>",
                                node.Descripcion)));

            TestCommonTreeNodeProperties(newNode, node);
        }
예제 #33
0
 private static void TestCommonTreeNodeProperties(TreeNode newNode, Opcion node)
 {
     Assert.That(newNode.Value, Is.EqualTo(node.OpcionID.ToString()));
     Assert.That(newNode.ToolTip, Is.EqualTo(node.Descripcion));
 }
예제 #34
0
파일: Menu.cs 프로젝트: seguame/kibus
    public void Mostrar()
    {
        do
        {
            imagenDeFondo.Dibujar(0,0);

            Hardware.EscribirTexto("Ve a casa Kibus!!:",
                         310, 300);

            Hardware.EscribirTexto("1.- Practica 1",
                         250, 390);

            Hardware.EscribirTexto("2.- Practica 2",
                         250, 410);

            Hardware.EscribirTexto("3.- Practica 3",
                         250, 430);

            Hardware.EscribirTexto("4.- Practica 4",
                         250, 450);

            Hardware.EscribirTexto("C.- Crear Nivel",
                         250, 470);

            Hardware.EscribirTexto("S.- Salir",
                         250, 490);

            Hardware.RefrescarPantalla();

            Hardware.Pausar(20);

        } while (!Hardware.TeclaPulsada(Sdl.SDLK_1)
                 && !Hardware.TeclaPulsada(Sdl.SDLK_2)
                 && !Hardware.TeclaPulsada(Sdl.SDLK_3)
                 && !Hardware.TeclaPulsada(Sdl.SDLK_4)
                 && !Hardware.TeclaPulsada(Sdl.SDLK_c)
                 && !Hardware.TeclaPulsada(Sdl.SDLK_s));

        if(Hardware.TeclaPulsada(Sdl.SDLK_1)) OpcionElegida = Opcion.PRACTICA_1;
        else if(Hardware.TeclaPulsada(Sdl.SDLK_2)) OpcionElegida = Opcion.PRACTICA_2;
        else if(Hardware.TeclaPulsada(Sdl.SDLK_3)) OpcionElegida = Opcion.PRACTICA_3;
        else if(Hardware.TeclaPulsada(Sdl.SDLK_4)) OpcionElegida = Opcion.PRACTICA_4;
        else if(Hardware.TeclaPulsada(Sdl.SDLK_c)) OpcionElegida = Opcion.CREAR_NIVEL;
        else if (Hardware.TeclaPulsada(Sdl.SDLK_s)) OpcionElegida = Opcion.SALIR;
    }
예제 #35
0
        public override void Update(GameTime gameTime)
        {
            if (!_songStart)
            {
                MediaPlayer.Play(_menuSound);
                _songStart = true;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.W) || Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                if (gameTime.TotalGameTime - _previousGameTime > _movementTime)
                {
                    _previousGameTime = gameTime.TotalGameTime;
                    if (_opcionActual == Opcion.Salir)
                    {
                        _opcionActual = Opcion.Opciones;
                        _menuIter.Play();
                    }
                    else if(_opcionActual==Opcion.Opciones)
                    {
                        _opcionActual = Opcion.Jugar;
                        _menuIter.Play();
                    }
                }
            }
            if (Keyboard.GetState().IsKeyDown(Keys.S) || Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                if (gameTime.TotalGameTime - _previousGameTime > _movementTime)
                {
                    _previousGameTime = gameTime.TotalGameTime;
                    if (_opcionActual == Opcion.Jugar)
                    {
                        _opcionActual = Opcion.Opciones;
                        _menuIter.Play();
                    }
                    else if(_opcionActual==Opcion.Opciones)
                    {
                        _opcionActual = Opcion.Salir;
                        _menuIter.Play();
                    }
                }
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Enter) || Keyboard.GetState().IsKeyDown(Keys.Space))
            {
                _menuSelect.Play();
                switch (_opcionActual)
                {
                    case Opcion.Jugar:
                        Manager.Estados[GameStates.PrePlayState].Initialize();
                        Manager.Estados[GameStates.PrePlayState].LoadContent();
                        Manager._estadoActual = GameStates.PrePlayState;
                        break;
                    case Opcion.Salir:
                        this.Game.Exit();
                        break;
                }
            }
        }