public static void savePermisos(permisonegado datos, int idnivel, int idpermiso) { try { var ctx = new DataModel(); nivel nvl = ctx.niveles.Where(r => r.idnivel == idnivel).FirstOrDefault(); ctx.niveles.Attach(nvl); datos.niveles = nvl; permiso perm = ctx.permisos.Where(r => r.idpermiso == idpermiso).FirstOrDefault(); ctx.permisos.Attach(perm); datos.permisos = perm; if (datos.idpermisonegadonivel > 0) //Realiza una actualizacion { ctx.Entry(datos).State = EntityState.Modified; } else { // Agregar ctx.Entry(datos).State = EntityState.Added; } ctx.SaveChanges(); } catch (Exception) { throw; } }
// Use this for initialization void Start() { instNivel = GetComponent <nivel>(); instNivel.HaFinalizadoElNivel += OnNivelFinalizado; instNivel.ELJugadorHaPerdidoElNivel += OnNivelFinalizado; posFondo = new Rect(0, 0, Screen.width, Screen.height); Color colorDeFondo = new Color(1f, 1f, 1f, 0.5f); texturaFondo = new Texture2D(1, 1); texturaFondo.SetPixel(0, 0, colorDeFondo); texturaFondo.Apply(); lang = LanguageManager.Instance; estiloLabelScoreName = estilo.GetStyle("label_score"); estiloScore = estilo.GetStyle("score"); estiloBotonPrincipal = estilo.GetStyle("boton_principal"); estiloBotonCancelar = estilo.GetStyle("boton_cancelar"); posPanelPrincipal = new Rect((Screen.width - anchoPanelPrincipal) / 2, (Screen.height - altoPanelPrincipal) / 2, anchoPanelPrincipal, altoPanelPrincipal); instGuardarPuntaje = GetComponent <GuardarPuntaje>(); if (instGuardarPuntaje == null) { this.gameObject.AddComponent <GuardarPuntaje>(); instGuardarPuntaje = GetComponent <GuardarPuntaje>(); instGuardarPuntaje.Init(this.estilo); } instGuardarPuntaje.enabled = false; this.enabled = false; }
void Awake() { logicalDelNivel = GetComponent <nivel> (); GameObject[] enemigostmp = GameObject.FindGameObjectsWithTag(tagObjetosIniciales); foreach (GameObject enemigo in enemigostmp) { enemigo.GetComponent <Vida>().estaMueriendo += ObjetivoEstaMuriendo; } }
// Use this for initialization void Start() { if (logicaDelNivel != null) { logica = logicaDelNivel.GetComponent <nivel> (); } intVida = this.GetComponent <Vida>(); instMana = this.GetComponent <mana>(); }
private void dgvNiveles_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { idniveles = int.Parse(this.dgvNiveles.Rows[e.RowIndex].Cells[0].Value.ToString()); this.dgvPermisoNegados.DataSource = clsPermisosnegados.GetAllPermisosNegados(idniveles); nivel datos = clsManejoNivel.getNivel(idniveles); textBox1.Text = datos.nombre; textBox2.Text = datos.descripcion; idniveles = datos.idnivel; }
public string update_nivel(nivel obj) { if (obj_nivel.update_nivel(obj)) { return("U200"); } else { return("U500"); } }
public string insert_nivel(nivel obj) { if (obj_nivel.insert_nivel(obj)) { return("I200"); } else { return("I500"); } }
private void btnAgregar_Click(object sender, EventArgs e) { if (textBox1.Text != "" && textBox2.Text != "") { var datos = new nivel(); datos.idnivel = idniveles; datos.nombre = textBox1.Text; datos.descripcion = textBox2.Text; clsManejoNivel.saveNivel(datos); } else { errorProvider1.Clear(); errorProvider1.SetError(textBox1, "Faltan Datos para continuar"); } }
public nivel[] data() { DataTable dt = obj_nivel.get_nivel(); DataRow row; nivel[] nivels = null; if (dt.Rows.Count > 0) { nivels = new nivel[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { row = dt.Rows[i]; nivels[i] = new nivel(Convert.ToInt32(row["nvel_idnivel"].ToString()), row["nvel_nombre"].ToString(), row["nvel_descripcion"].ToString(), row["nvel_estado"].ToString()); } } return(nivels); }
public string AgregarMecanicaNivel(MecanicaNivel mecanica) { using (DbContextJulio db = new DbContextJulio()) { var nivel = new nivel() { descripcion = mecanica.Nombre, porcentaje_acumulacion = mecanica.Porcentaje, valor_nivel_inicial = mecanica.MontoMinimo, valor_nivel_final = mecanica.MontoMaximo }; db.nivel.Add(nivel); db.SaveChanges(); return("Los datos se agregaron correctamente"); } }
public static void saveNivel(nivel datosnivel) { try { var ctx = new DataModel(); if (datosnivel.idnivel > 0) { ctx.Entry(datosnivel).State = EntityState.Modified; } else { ctx.Entry(datosnivel).State = EntityState.Added; } ctx.SaveChanges(); } catch (Exception) { throw; } }
public static void SaveUsers(usuario nUser, int idnivel) { try { var ctx = new DataModel(); nivel nvl = ctx.niveles.Where(r => r.idnivel == idnivel).FirstOrDefault(); ctx.niveles.Attach(nvl); nUser.niveles = nvl; if (nUser.idusuario > 0) //Realiza una actualizacion { ctx.Entry(nUser).State = EntityState.Modified; } else { // Agregar ctx.Entry(nUser).State = EntityState.Added; } ctx.SaveChanges(); } catch (Exception) { throw; } }
void Start() { estiloBotonPrincipal = estilo.GetStyle("boton_principal"); estiloBotonVolverAlMenuPrincipal = estilo.GetStyle("boton_cancelar"); entradaTactil = TouchManager.Instance; colorDeFondo = new Color(1f, 1f, 1f, 0.5f); fondo = new Texture2D(1, 1); fondo.SetPixel(0, 0, colorDeFondo); fondo.Apply(); instNivel = GetComponent <nivel>(); estiloBotonMusicaOff = estilo.GetStyle("boton_musica_off"); estiloBotonMusicaOn = estilo.GetStyle("boton_musica_on"); estiloBotonSonidoOff = estilo.GetStyle("boton_sonido_off"); estiloBotonSonidoOn = estilo.GetStyle("boton_sonido_on"); Configuracion.configuracionGeneral.Load(); CambioTamanoVentanaWindowsStore.cambioTamanoPantalla += OnCambioResolucion; cargarNivel = GameObject.FindObjectOfType <LevelLoader>(); OnCambioResolucion(Screen.width, Screen.height); }