public List <estados> GetEstados(ComboBox combo)
        {
            var    listestados = new List <estados>(); //la variable var es generica
            var    ds          = new DataSet();
            string consulta    = "Select * from estados";

            ds = conexion.Obtenerdatos(consulta, "estados");
            combo.DataSource    = ds.Tables[0];
            combo.DisplayMember = "codigo";
            var dt = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow row in dt.Rows)
            {
                //string datos = string.Format("{0}", row.ItemArray[0]);
                //combo.Items.Add(datos);
                var estados = new estados
                {
                    Codigo = row["codigo"].ToString(),
                    Nombre = row["nombre"].ToString(),
                };
                listestados.Add(estados);
            }
            //lenar lista
            return(listestados);
        }
Beispiel #2
0
        public async Task <IHttpActionResult> Postestados(estados estados)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.estados.Add(estados);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (estadosExists(estados.id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = estados.id }, estados));
        }
Beispiel #3
0
        //OPERACIONES DE INSERCION, ACTUALIZACION Y ELIMINACION DE ESTADOS
        public void agregar_Estado(string estado)
        {
            using (var bd = new Conexion())
            {
                estados estados = new estados
                {
                    est_nombreestado = estado
                };

                long consulta = bd.estados.LongCount();

                if (consulta == 0)
                {
                    bd.Database.ExecuteSqlCommand("ALTER TABLE estados AUTO_INCREMENT=1");
                }
                else
                {
                    long maxVal = bd.estados.Max(e => e.est_id) + 1;

                    bd.Database.ExecuteSqlCommand("ALTER TABLE estados AUTO_INCREMENT={0}", maxVal);
                }

                bd.estados.Add(estados);
                bd.SaveChanges();
            }
        }
Beispiel #4
0
 //-------------------------------------------------------------------------------------------
 public void estaHablando(bool hablando)
 {
     if (hablando)
     {
         _estado = estados.hablando;
     }
 }
Beispiel #5
0
    IEnumerator Ataque()
    {
        triggerAtacar        = true;
        StateManager.isAtack = 1;
        float r = Random.Range(0f, 1f);

        if (r < 0.5)
        {
            dc.tipoAtaque = "ad";
            inputHandler.Void_AtaqueDebil();
        }
        else
        {
            dc.tipoAtaque = "af";
            inputHandler.Void_AtaqueFuerte();
        }

        yield return(new WaitForSeconds(0.51f));

        r = Random.Range(0f, 1f);
        if (r < 0.5f)
        {
            maquinaEstados = estados.escudar;
        }
        else
        {
            maquinaEstados = estados.ataque;
        }

        triggerAtacar = false;
    }
Beispiel #6
0
 private void limpiarCampos()
 {
     estadoFormulario            = estados.nuevo;
     verifico                    = false;
     cmb_provincia.SelectedIndex = 0;
     cmb_localidad.DataSource    = null;
     cmb_tipo_doc.SelectedIndex  = 0;
     cmd_tipo_cons.SelectedIndex = 0;
     cmb_cond_iva.SelectedIndex  = 0;
     cmb_sexo.SelectedIndex      = 0;
     dtp_fechaNac.Value          = DateTime.Now;
     txt_apellido.Text           = "";
     txt_barrio.Text             = "";
     txt_calle.Text              = "";
     txt_calle_nro.Text          = "";
     txt_cuit.Text               = "";
     txt_depto.Text              = "";
     txt_mail.Text               = "";
     txt_nombre.Text             = "";
     txt_nro_doc.Text            = "";
     txt_piso.Text               = "";
     txt_razon_social.Text       = "";
     txt_telefono.Text           = "";
     txt_celular.Text            = "";
     bloquearCampos();
 }
Beispiel #7
0
        public async Task <IActionResult> Putestados(int id, estados estados)
        {
            if (id != estados.idestado)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #8
0
    IEnumerator Retroceder()
    {
        triggerRetroceder       = true;
        StateManager.doesItMove = 0;
        StateManager.isAtack    = 0;
        while (Vector3.Distance(NPC.position, this.transform.position) < 3)
        {
            inputHandler.Void_Mover(-0.85f, 0);
            yield return(null);
        }
        yield return(new WaitForSeconds(1));

        float r = Random.Range(0f, 1f);

        if (r < 0.7f)
        {
            maquinaEstados = estados.acercarse;
        }
        else
        {
            maquinaEstados = estados.quieto;
        }



        triggerRetroceder = false;
    }
        public int IniciarWorkflow(int idWorkflow)
        {
            try
            {
                workflow workflowCreate = db.workflow.Where(x => x.id == idWorkflow).FirstOrDefault();

                if (workflowCreate == null)
                {
                    throw new IndexOutOfRangeException("El workflow " + idWorkflow + " no existe en el sistema");
                }

                estados estado = db.estados.FirstOrDefault(x => x.id_workflow == idWorkflow && x.estado_inicial == true);

                if (estado == null)
                {
                    throw new IndexOutOfRangeException("El estado inicial no se encuentra configurado para el workflow " + workflowCreate.nombre);
                }

                var change = db.proceso_workflow.Add(new proceso_workflow());
                change.id_workflow      = workflowCreate.id;
                change.id_estado_actual = estado.id;
                db.SaveChanges();
                trackAsync.Add(Task.Run(() => TrackAsync("resultado", "IniciarWorkflow", change.id.ToString(), "id:" + change.id + ",estadoInicial:" + estado.id + ",nombreWorkflow:" + workflowCreate.nombre)));
                return(change.id);
            }
            catch (Exception ex)
            {
                trackAsync.Add(Task.Run(() => TrackAsync("excepcion", "IniciarWorkflow", ex.ToString(), "")));
                throw ex;
            }
        }
Beispiel #10
0
        public async Task <ActionResult <estados> > Postarticulo(estados estados)
        {
            _context.estados.Add(estados);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Get", new { id = estados.idestado }, estados));
        }
        public string getNombreEstadoToParametro(int idProcesoWorkflow, string parametro)
        {
            try
            {
                var    idWorkflow     = db.proceso_workflow.Find(idProcesoWorkflow).id_workflow;
                var    idEstadoActual = db.proceso_workflow.Find(idProcesoWorkflow).id_estado_actual;
                string nombre         = "";
                if (!string.IsNullOrEmpty(parametro))
                {
                    var idSiguienteEstado = this.getParametroSecuenciaEstado(idWorkflow, idEstadoActual, parametro).id_estado_siguiente;
                    nombre = db.estados.Find(idSiguienteEstado).nombre;
                }
                else
                {
                    var     idSiguienteEstado = db.estado_dependencia.FirstOrDefault(x => x.id_workflow == idWorkflow && x.id_estado_desde == idEstadoActual).id_estado_hasta;
                    estados estadoSiguiente   = db.estados.Find(idSiguienteEstado);

                    if (estadoSiguiente == null)
                    {
                        throw new Exception("El estado siguiente no fue encontrado: Id " + idSiguienteEstado);
                    }

                    nombre = estadoSiguiente.nombre;
                }
                trackAsync.Add(Task.Run(() => TrackAsync("resultado", "getNombreEstadoToParametro", nombre, "idProcesoWorkflow:" + idProcesoWorkflow + ",parametro:" + parametro)));
                return(nombre);
            }
            catch (Exception ex)
            {
                trackAsync.Add(Task.Run(() => TrackAsync("excepcion", "getNombreEstadoToParametro", ex.ToString(), "idProcesoWorkflow:" + idProcesoWorkflow + ",parametro:" + parametro)));
                return("");
            }
        }
 private void limpiarCampos()
 {
     txt_nombre_producto.Text         = "";
     txt_descripcion_producto.Text    = "";
     txt_stock_riesgo.Text            = "";
     txt_precio_minorista.Text        = "";
     cmb_categoria.SelectedIndex      = 0;
     cmb_unidad_medida.SelectedIndex  = 0;
     cmb_tiempo.SelectedIndex         = 0;
     cmbTipoMaquinarias.SelectedIndex = 0;
     estadoFormulario = estados.nuevo;
     pb_foto.Image    = Vista.Properties.Resources.photo3;
     pb_foto.SizeMode = PictureBoxSizeMode.CenterImage;
     bloquearCampos();
     darFoco();
     txt_Precio_Mayorista.Text    = "";
     txtHorasHombre.Text          = "";
     lbl_tipo_maquinaria.Visible  = false;
     lbl_precio_minorista.Visible = false;
     lbl_precio_mayorista.Visible = false;
     txt_Precio_Mayorista.Visible = false;
     txt_precio_minorista.Visible = false;
     cmbTipoMaquinarias.Visible   = false;
     grb_Horas.Visible            = false;
 }
Beispiel #13
0
        public IHttpActionResult Putestados(int id, estados estados)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != estados.id)
            {
                return(BadRequest());
            }

            db.Entry(estados).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!estadosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            estados estados = db.estados.Find(id);

            db.estados.Remove(estados);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #15
0
 public void begin(int pos)
 {
     if (pos < 6)
     {
         ordenPos = pos;
         _estado  = estados.bajoOrdenes;
     }
 }
Beispiel #16
0
    //-----------------------------------------------------------------------------------------------
    void Start()
    {
        _estado     = estados.esperando;
        _prota      = GameObject.Find("Prota");
        _dialogoBox = GetComponentInChildren <DialogoBox>();

        _dialogoBox.setInicioDialogo(dialogos[_dialogoIndex].lineas, dialogos[_dialogoIndex].dialogoInteractivo);
        NpcAni = transform.GetChild(0).GetComponent <Animator>();
    }
Beispiel #17
0
 public void muerte()
 {
     if (estado_actual != estados.dead) //Si no estaba muerto, muere
     {
         velocidad.x = 0;
         GetComponent <Animator>().SetInteger("estado", 6); //Cambio estado 1 (animacion caminar)
         estado_actual = estados.dead;
         Destroy(gameObject, 1.0f);
     }
 }
Beispiel #18
0
 void femeninooSeleccionado()
 {
     modelManager = new ModelManager(this, ModelManager.sexo.Femenino, screenHeight, screenWidth);
     Components.Add(modelManager);
     spriteManager.Enabled = false;
     spriteManager.Visible = false;
     botonManager          = new BotonManager(this, modelManager.models, screenHeight, screenWidth);
     Components.Add(botonManager);
     estado = estados.juego;
 }
 public ActionResult Edit(estados estados)
 {
     if (ModelState.IsValid)
     {
         db.Entry(estados).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(estados));
 }
        public ActionResult Create(estados estados)
        {
            if (ModelState.IsValid)
            {
                db.estados.Add(estados);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(estados));
        }
Beispiel #21
0
        public string getEstadosNome(int id)
        {
            string estadosNome = "";

            estados estados = new estados();

            estados     = db.estados.Find(id);
            estadosNome = estados.nome;

            return(estadosNome);
        }
Beispiel #22
0
        public IHttpActionResult Getestados(int id)
        {
            estados estados = db.estados.Find(id);

            if (estados == null)
            {
                return(NotFound());
            }

            return(Ok(estados));
        }
Beispiel #23
0
        public async Task <IHttpActionResult> Getestados(int id)
        {
            estados estados = await db.estados.FindAsync(id);

            if (estados == null)
            {
                return(NotFound());
            }

            return(Ok(estados));
        }
Beispiel #24
0
    //-------------------------------------------------------------------------------------------
    void OnParticleCollision(GameObject other)
    {
        if (other.tag == "BalaE" && _estado != estados.esquivando)
        {
            if (_stats.applyDamage(other.GetComponent <DañoBalas>().getDaño()))
            {
                _estado = estados.muriendo;
            }

            _barraVida.fillAmount = _stats.VidaActual / _stats.health;
        }
    }
Beispiel #25
0
 void abrirTablero()
 {
     _estado = estados.mostrando;
     _prota.estaHablando(true);
     _menuPausa.enabled = false;
     fondo.enabled      = true;
     for (int i = 0; i < sliders.Length; i++)
     {
         sliders[i].enabled = true;
     }
     botonAceptar.SetActive(true);
 }
Beispiel #26
0
        public IHttpActionResult Postestados(estados estados)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.estados.Add(estados);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = estados.id }, estados));
        }
Beispiel #27
0
    IEnumerator Acercarse()
    {
        StateManager.doesItMove = 0;
        triggerAcercarse        = true;
        StateManager.isAtack    = 0;
        while (Vector3.Distance(NPC.position, this.transform.position) > 2)
        {
            inputHandler.Void_Mover(0.75f, 0);
            yield return(null);
        }
        inputHandler.Void_Mover(0, 0);
        yield return(new WaitForSeconds(0.15f));

        float r = Random.Range(0f, 1f);

        if (modoAtaque == true)
        {
            if (r > 0.25f)
            {
                maquinaEstados = estados.ataque;
            }
            else
            {
                maquinaEstados = estados.escudar;
            }
        }

        if (modoDefensa == true)
        {
            if (r > 0.75f)
            {
                maquinaEstados = estados.ataque;
            }
            else
            {
                maquinaEstados = estados.escudar;
            }
        }
        else
        {
            if (r > 0.5f)
            {
                maquinaEstados = estados.ataque;
            }
            else
            {
                maquinaEstados = estados.escudar;
            }
        }

        triggerAcercarse = false;
    }
Beispiel #28
0
 public void muerte()
 {
     if (estado_actual != estados.dead)                     //Si no estaba muerto, entonces muere
     {
         GetComponent <Animator>().SetInteger("estado", 5); //Cambio estado 1 (animacion caminar)
         spr_sup.GetComponent <Animator>().SetInteger("estado", 7);
         estado_actual = estados.dead;
         GameObject.Find("GameHandler").GetComponent <game_handler>().set_vidas(-1, player_n - 1); //Quitamos vida al jugador
         string nombre_spawn = "spawn_j" + player_n;
         GameObject.Find(nombre_spawn).transform.position = Camera.main.transform.position;
         Destroy(gameObject, 2.0f);
     }
 }
Beispiel #29
0
    IEnumerator Esquivar()
    {
        triggerEsquivar      = true;
        StateManager.isAtack = 0;
        int t = 0;

        while (t < 60)
        {
            t += 1;
            inputHandler.Void_Esquivar();
            yield return(new WaitForEndOfFrame());
        }
        yield return(new WaitForSeconds(1));

        float r = Random.Range(0f, 1f);

        if (modoAtaque == true)
        {
            if (r < 0.2f)
            {
                maquinaEstados = estados.acercarse;
            }
            else
            {
                maquinaEstados = estados.ataque;
            }
        }
        else if (modoDefensa == true)
        {
            if (r < 0.45f)
            {
                maquinaEstados = estados.acercarse;
            }
            else
            {
                maquinaEstados = estados.ataque;
            }
        }
        else
        {
            if (r < 0.5f)
            {
                maquinaEstados = estados.acercarse;
            }
            else
            {
                maquinaEstados = estados.ataque;
            }
        }
        triggerEsquivar = false;
    }
Beispiel #30
0
        public IHttpActionResult Deleteestados(int id)
        {
            estados estados = db.estados.Find(id);

            if (estados == null)
            {
                return(NotFound());
            }

            db.estados.Remove(estados);
            db.SaveChanges();

            return(Ok(estados));
        }
Beispiel #31
0
 public Guerrero(bandos bando, int[] pos)
 {
     //Atributos de Unidad
     this.icono = "æ";
     this.posicion = pos;
     this.tipo = Tipo.terrestre;
     this.hpInicial = 300 + randy.Next(-20, 20);
     this.hpActual = this.hpInicial;
     this.dañoMecanico = 40 + randy.Next(-5, 5);
     this.dañoNoMecanico = 50 + randy.Next(-10, 10);
     this.rango = 1;
     this.velocidad = 7;
     this.bandera = bando;
     //Atributos de guerrero
     this.armadura = 200 + randy.Next(-100, 100);
     this.estado = estados.ofensivo;
 }
Beispiel #32
0
 public Sesion(string nombre)
 {
     this.nombre = nombre;
     estado = estados.LIBRE;
     IDSocio = -1;
 }
        private void limpiarCampos()
        {
            estadoFormulario = estados.nuevo;
            verifico = false;
            cmb_provincia.SelectedIndex = 0;
            cmb_localidad.DataSource = null;
            txt_apellido.Text = "";
            txt_barrio.Text = "";
            txt_calle.Text = "";
            txt_calle_nro.Text = "";
            txt_cuit.Text = "";
            txt_mail.Text = "";
            txt_nombre.Text = "";
            txt_razon_social.Text = "";
            txt_telefono.Text = "";

            bloquearCampos();
        }
 public void limpiarCampos()
 {
     dtp_creacion_OT.Value = DateTime.Now.Date;
     dgv_detalle.Rows.Clear();
     txt_cantidad.Text = "";
     txt_mail .Text = "";
     txt_monto_total.Text = "";
     txt_contacto .Text = "";
     txt_celular .Text = "";
     txt_contacto .Text = "";
     cmb_proveedores.SelectedValue = 0;
     estadoFormulario = estados.nuevo;
     txt_celular.Text = "";
 }
 private void limpiarCampos()
 {
     txt_nombre_producto.Text = "";
     txt_descripcion_producto.Text = "";
     txt_stock_riesgo.Text = "";
     txt_precio_minorista.Text = "";
     cmb_categoria.SelectedIndex = 0;
     cmb_unidad_medida.SelectedIndex = 0;
     cmb_tiempo.SelectedIndex = 0;
     cmbTipoMaquinarias.SelectedIndex = 0;
     estadoFormulario = estados.nuevo;
     pb_foto.Image = Vista.Properties.Resources.photo3;
     pb_foto.SizeMode = PictureBoxSizeMode.CenterImage;
     bloquearCampos();
     darFoco();
     txt_Precio_Mayorista.Text = "";
     txtHorasHombre.Text = "";
     lbl_tipo_maquinaria.Visible = false;
     lbl_precio_minorista.Visible = false;
     lbl_precio_mayorista.Visible = false;
     txt_Precio_Mayorista.Visible = false;
     txt_precio_minorista.Visible = false;
     cmbTipoMaquinarias.Visible = false;
     grb_Horas.Visible = false;
 }
Beispiel #36
0
 public override List<Unidad> ObjetivosProximos(Mapa mapa)
 {
     List<Unidad> u = new List<Unidad>();
     mapa.encontrarPosAlcanzable(this.posicion, this.velocidad, this.tipo, true);
     foreach (int[] i in mapa.alcanzables)
     {
         var adyacentes = objetivosDisparables(i, mapa);
         if (adyacentes.Count != 0)
         {
             foreach (Unidad a in adyacentes)
             {
                 if (!(u.Contains(a)))
                 {
                     u.Add(a);
                 }
             }
         }
     }
     if (u.Count == 0)
     {
         this.estado = estados.defensivo;
     }
     else
     {
         this.estado = estados.ofensivo;
     }
     return u;
 }
 public void limpiarCampos()
 {
     dtp_fecha_pedido.Value = DateTime.Now.Date;
     dtp_fecha_necesidad.Value = dtp_fecha_pedido.Value.AddDays(1);
     dgv_detalle.Rows.Clear();
     txt_apellido.Text = "";
     txt_cantidad.Text = "";
     txt_cuit.Text = "";
     txt_monto_total.Text = "";
     txt_nombre.Text = "";
     txt_nro_doc.Text = "";
     txt_razon_social.Text = "";
     txt_dir_entrega.Text = "";
     cmb_tipo_doc.SelectedValue = 0;
     resultado = null;
     estadoFormulario = estados.nuevo;
     txt_celular.Text = "";
     habilitarPantalla();
     txt_nro_doc.Focus();
     productosEliminados.Clear();
 }
 private void limpiarCampos()
 {
     estadoFormulario = estados.nuevo;
     verifico = false;
     cmb_provincia.SelectedIndex = 0;
     cmb_localidad.DataSource = null;
     cmb_tipo_doc.SelectedIndex = 0;
     cmd_tipo_cons.SelectedIndex = 0;
     cmb_cond_iva.SelectedIndex = 0;
     cmb_sexo.SelectedIndex = 0;
     dtp_fechaNac.Value = DateTime.Now;
     txt_apellido.Text = "";
     txt_barrio.Text = "";
     txt_calle.Text = "";
     txt_calle_nro.Text = "";
     txt_cuit.Text = "";
     txt_depto.Text = "";
     txt_mail.Text = "";
     txt_nombre.Text = "";
     txt_nro_doc.Text = "";
     txt_piso.Text = "";
     txt_razon_social.Text = "";
     txt_telefono.Text = "";
     txt_celular.Text = "";
     bloquearCampos();
 }
Beispiel #39
0
 void masculinoSeleccionado()
 {
     modelManager = new ModelManager(this, ModelManager.sexo.Masculino, screenHeight, screenWidth);
     Components.Add(modelManager);
     spriteManager.Enabled = false;
     spriteManager.Visible = false;
     botonManager = new BotonManager(this, modelManager.models, screenHeight, screenWidth);
     Components.Add(botonManager);
     estado = estados.juego;
 }
Beispiel #40
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            MouseState mouseState = Mouse.GetState();

            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            // TODO: Add your update logic here
            try
            {
                KeyboardState keyboardState = Keyboard.GetState();
                if (keyboardState.IsKeyDown(Keys.Escape))
                    this.Exit();
            }
            catch
            {
            }

            switch (estado)
            {
                case estados.seleccion:
                    tiempoPasado++;
                    if (tiempoPasado > tiempoEspera)
                    {

                        if (mouseState.LeftButton == ButtonState.Pressed)
                        {
                            tiempoPasado = 0;
                            tiempoEspera = 100;
                            modelManager = null;
                            botonManager = null;
                            if (mouseState.X > (screenWidth / 2))
                            {
                                femeninooSeleccionado();
                            }
                            else
                            {
                                masculinoSeleccionado();
                            }
                        }
                    }

                    break;
                case estados.juego:
                    if (botonManager.estado == estados.fin)
                        estado = estados.fin;
                    break;
                case estados.fin:
                    tiempoPasado++;
                    if (tiempoPasado > tiempoEspera*2)
                        if (mouseState.LeftButton == ButtonState.Pressed)
                        {
                            estado = estados.seleccion;
                            botonManager.estado = estados.seleccion;
                            modelManager.estado = estados.seleccion;
                            spriteManager.Enabled = true;
                            spriteManager.Visible = true;
                            tiempoPasado = 0;
                            tiempoEspera = 10;
                        }
                    break;
            }
            base.Update(gameTime);
        }
Beispiel #41
0
 public Sesion(estados estado, int IDSocio)
 {
     this.estado = estado;
     this.IDSocio = IDSocio;
 }