public ActionResult ActionActualizarAreaD(Nivel1 obj) { try { if (ModelState.IsValid) { _context = new BDContext(); unitOfWork = new UnitOfWork(_context); Uppd = unitOfWork.Nivel1.Get(obj.idN); unitOfWork.Nivel1.Update(Uppd); Uppd.nombreN = obj.nombreN; Uppd.descripcionN = obj.descripcionN; _context.Configuration.ValidateOnSaveEnabled = false; unitOfWork.Complete(); return(RedirectToAction("AreaDoc")); } else { return(View("ActualizarAreaD", obj)); } } catch (Exception ex) { Console.WriteLine("Un error ha ocurrido '{0}'", ex); return(View("ActualizarAreaD")); } }
public ActionResult CrearAreaD(Nivel1 obj) { _context = new BDContext(); unitOfWork = new UnitOfWork(_context); return(View(obj)); }
private void button1_Click(object sender, EventArgs e) { Nivel1 a = new Nivel1(); a.Show(); this.Hide(); }
private async void btnAceptar_Click(object sender, EventArgs e) { if (cbxNivel1.SelectedIndex == -1) { return; } Nivel3 pais3 = null; Pais pais = cbxPaises.Items[cbxPaises.SelectedIndex] as Pais; Nivel1 pais1 = cbxNivel1.Items[cbxNivel1.SelectedIndex] as Nivel1; Nivel2 pais2 = cbxNivel2.Items[cbxNivel2.SelectedIndex] as Nivel2; if (cbxNivel3.SelectedIndex != -1) { pais3 = cbxNivel3.Items[cbxNivel3.SelectedIndex] as Nivel3; } cadena = ""; if (pais != null) { cadena += pais.nombre + " - "; ubicacionGeografica.idPais = pais.idPais; } if (pais1 != null) { cadena += pais1.nombre + " - "; ubicacionGeografica.idNivel1 = pais1.idNivel1; } else { ubicacionGeografica.idNivel1 = 0; } if (pais2 != null) { cadena += pais2.nombre + " - "; ubicacionGeografica.idNivel2 = pais2.idNivel2; } else { ubicacionGeografica.idNivel2 = 0; } if (pais3 != null) { cadena += pais3.nombre; ubicacionGeografica.idNivel3 = pais3.idNivel3; } else { cadena = cadena.Substring(0, cadena.Length - 3); ubicacionGeografica.idNivel3 = 0; } Response respuesta = await locationModel.guardarUbigeo(ubicacionGeografica); idUbicacionGeografia = respuesta.id; this.Close(); }
public ActionResult ActualizarAreaD(int idArea) { _context = new BDContext(); unitOfWork = new UnitOfWork(_context); Uppd = unitOfWork.Nivel1.Get(idArea); return(View(Uppd)); }
void Awake() { ImprimeNombreUsuario(); _rutina = new List <ActivaPanelDedos> (); datosNivel1 = new Nivel1(); datosNivel3 = new Nivel3(); panels [0].gameObject.SetActive(true); panels [5].gameObject.SetActive(true); AdminMenu.datosNivel1.nivel = 0; Admin_level0.datosNivel2.nivel = 0; AdminMenu.datosNivel3.nivel = 0; }
public ActionResult ActionAsignarN1(int idUsuario, int idPermiso) { _context = new BDContext(); unitOfWork = new UnitOfWork(_context); Uppd = unitOfWork.TipoDocumento.Get(idUsuario); Nivel1 permiso = unitOfWork.Nivel1.Get(idPermiso); Uppd.N1.Add(permiso); unitOfWork.Complete(); return(RedirectToAction("AsignarRutasN1", new { idArea = idUsuario, perm = true, AQ = 1 })); }
public ActionResult ActionCrearAreaD(Nivel1 obj) { if (ModelState.IsValid) { _context = new BDContext(); unitOfWork = new UnitOfWork(_context); unitOfWork.Nivel1.Add(obj); unitOfWork.Complete(); string path = Path.Combine(Server.MapPath("~/Gestad"), obj.nombreN); Directory.CreateDirectory(path); return(RedirectToAction("AreaDoc")); } else { return(RedirectToAction("CrearAreaD", obj)); } }
// Update is called once per frame void Update() { if (Posicion.position.x <= limMin.transform.position.x) { Cuerpo.velocity = new Vector2(Velocidad, cuerpo.velocity.y); } if (Posicion.position.x >= limMax.transform.position.x) { Cuerpo.velocity = new Vector2(-Velocidad, cuerpo.velocity.y); } if (Input.GetMouseButtonUp(0)) { if (((Posicion.position.x > 0f) && (Posicion.position.x <= 1.65f)) || ((Posicion.position.x < -0.44f) && (Posicion.position.x >= -2.1f))) { Nivel1.PrecisionAtaque = 0.5f; } else if ((Posicion.position.x < -2.1f) || (Posicion.position.x > 1.62f)) { Nivel1.PrecisionAtaque = 0f; } else { Nivel1.PrecisionAtaque = 1f; } Nivel1.Atacar(); Velocidad += 1.5f; Debug.Log(Nivel1.NumAtaques); Debug.Log("Se ha presionado"); } if (Nivel1.NumAtaques <= 0) { TerminarMinijuego(); } }
/// <summary> /// Método que se llama una sola vez, al principio cuando se ejecuta el ejemplo. /// Escribir aquí todo el código de inicialización: cargar modelos, texturas, modifiers, uservars, etc. /// Borrar todo lo que no haga falta /// </summary> public override void init() { //GuiController.Instance: acceso principal a todas las herramientas del Framework //Device de DirectX para crear primitivas Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice; TgcSceneLoader loader = new TgcSceneLoader(); nivel = new Nivel1(); fpsCamara = new Camara(); GuiController.Instance.CurrentCamera = fpsCamara; fpsCamara.MovementSpeed = 1000f; fpsCamara.RotationSpeed = 2f; fpsCamara.setCamera(nivel.posicionInicial(), nivel.orientacionCamara()); fpsCamara.updateViewMatrix(d3dDevice); colisionador = new ManejadorColisiones(fpsCamara, nivel.Obstaculos); //Iniciarlizar PickingRay pickingRay = new TgcPickingRay(); }
public Nivel1Controller(Nivel1 nivel1) { this.nivel1 = nivel1; }
public override string ToString() { return(!Nivel3.Equals("") ? Nivel3 : (!Nivel2.Equals("") ? Nivel2 : (!Nivel1.Equals("") ? Nivel1 : ""))); }
// sobreescribir toString() override public string ToString() { return($"{Subsistema.ToString()}-{Sector.ToString().PadLeft(2, '0')}-{Manzana.ToString().PadLeft(4, '0')}-{Lote.ToString().PadLeft(4, '0')}-{Nivel1.ToString().PadLeft(2, '0')}-{Nivel2.ToString().PadLeft(2, '0')}-{Fraccion.ToString().PadLeft(2, '0')}-{Toma.ToString().PadLeft(2, '0')}"); }
private void GeneraSubMenus(Menu menu, List <ArbolAcceso> lstArboles, DataBaseModelContext db, string url) { try { foreach (ArbolAcceso arbol in lstArboles) { if (arbol.Nivel1 != null) { if (menu.Menu1 == null) { menu.Menu1 = new List <Menu>(); } Nivel1 n = db.Nivel1.SingleOrDefault(s => s.Id == arbol.Nivel1.Id); if (n == null) { continue; } if (!menu.Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel2 != null ? string.Empty : url + arbol.Id }; menu.Menu1.Add(menuNivel1); } } if (arbol.Nivel2 != null) { if (menu.Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1 = new List <Menu>(); } Nivel2 n = db.Nivel2.SingleOrDefault(s => s.Id == arbol.Nivel2.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel3 != null ? string.Empty : url + arbol.Id }; menu.Menu1[0].Menu1.Add(menuNivel1); } } if (arbol.Nivel3 != null) { if (menu.Menu1[0].Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1[0].Menu1 = new List <Menu>(); } Nivel3 n = db.Nivel3.SingleOrDefault(s => s.Id == arbol.Nivel3.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel4 != null ? string.Empty : url + arbol.Id }; menu.Menu1[0].Menu1[0].Menu1.Add(menuNivel1); } } if (arbol.Nivel4 != null) { if (menu.Menu1[0].Menu1[0].Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1[0].Menu1[0].Menu1 = new List <Menu>(); } Nivel4 n = db.Nivel4.SingleOrDefault(s => s.Id == arbol.Nivel4.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1[0].Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel5 != null ? string.Empty : url + arbol.Id }; menu.Menu1[0].Menu1[0].Menu1[0].Menu1.Add(menuNivel1); } } if (arbol.Nivel5 != null) { if (menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 = new List <Menu>(); } Nivel5 n = db.Nivel5.SingleOrDefault(s => s.Id == arbol.Nivel5.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel6 != null ? string.Empty : url + arbol.Id }; menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Add(menuNivel1); } } if (arbol.Nivel6 != null) { if (menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 = new List <Menu>(); } Nivel6 n = db.Nivel6.SingleOrDefault(s => s.Id == arbol.Nivel6.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = arbol.Nivel7 != null ? string.Empty : url + arbol.Id }; menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Add(menuNivel1); } } if (arbol.Nivel7 != null) { if (menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 == null) { menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1 = new List <Menu>(); } Nivel5 n = db.Nivel5.SingleOrDefault(s => s.Id == arbol.Nivel7.Id); if (n == null) { continue; } if (!menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Any(a => a.Id == n.Id)) { Menu menuNivel1 = new Menu { Descripcion = n.Descripcion, Id = n.Id, Url = url + arbol.Id }; menu.Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1[0].Menu1.Add(menuNivel1); } } } } catch (Exception ex) { throw new Exception(ex.Message); } }