// Use this for initialization void Start() { g1 = GameObject.Find("Global1"); g2 = GameObject.Find("Global2"); t1 = g1.GetComponent <VariablesGlobales>(); t2 = g2.GetComponent <VariablesGlobales>(); Tf1 = float.Parse(t1.t.text); Tf2 = float.Parse(t2.t.text); Debug.Log(Tf1); l = ecuacionLong(); f = Tf2; float k = ecuacionK(l); for (int i = 0; i < 33; i++) { xv[i] = ecuacionX(l, i + 1); ve[i] = ecuacionE(xv[i], Tf1, Tf2); vb[i] = ecuacionB(ve[i]); } textL.text = "λ = " + l.ToString() + " m"; textK.text = "K = " + k.ToString() + " rad/m"; }
public void ValidateAndGoToGame() { bool errorControls = false; CharacterSelect problemCharacter = null; if (instance.allChara.Count % 2 != 0) { SetErrorMessage("Le nombre de joueur dans chaque équipe n'est pas le même !"); return; } foreach (CharacterSelect c in instance.allChara) { if (c.GetInfos().GetControls().GetName() == PlayerControls.VIDE) { errorControls = true; problemCharacter = c; } } if (errorControls) { SetErrorMessage("Le joueur " + (problemCharacter.GetSlot() + 1) + " n'a pas de controles"); return; } foreach (CharacterSelect c in instance.allChara) { VariablesGlobales.AddToPlayers(c.GetInfos()); Debug.Log("Add global " + c.GetInfos().GetControls().GetName()); } instance.allChara = new List <CharacterSelect>(); mainMenu.PlayGame(); }
public IActionResult Add(productos model) { if (model.id.HasValue) { model = new productos().GetAllById(model.id.Value).JsonToObj <List <productos> >().FirstOrDefault(); } return(VariablesGlobales.View(View(model), "Administrator")); }
public ActionResult Dashboard() { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; return(View()); }
public void GotoMainMenu() { Time.timeScale = 1; bucketSpawn = false; SceneManager.LoadScene("MainMenu"); VariablesGlobales.Reset(); TileUtils.Reset(); //GameTime.instance = null; }
private void cargaNivel() { if (!this.esNivelFinal()) { ModificarVidas.vidas++; VariablesGlobales.aumentarDificultad(); } SceneManager.LoadScene(nivel); }
public ActionResult Logout() { VariablesGlobales vg = new VariablesGlobales(); vg.LoggedUserId = ""; vg.LoggedUserType = ""; vg.LoggedUser_Nombre = ""; return(RedirectToAction("Login")); }
public IActionResult Detalle(productos model) { if (!model.id.HasValue) { return(Redirect("/Productos")); } model = model.GetAllById(model.id.Value).JsonToObj <List <productos> >().FirstOrDefault(); return(VariablesGlobales.View(View(model), "Administrator")); }
private void SpawnPlayers(int winnerId) { List <PlayerInfos> playerInfosList; playerInfosList = VariablesGlobales.GetAllPlayers(); if (playerInfosList == null) { return; } if (playerInfosList.Count < 3) { //Deux joueurs foreach (PlayerInfos p in playerInfosList) { GameObject playerObject; if (p.GetBoatId() == BLUE_BOAT_ID) { playerObject = Instantiate(GetBlueModel(), new Vector3(0, 100, 0), Quaternion.Euler(0, 180, 0)); } else { playerObject = Instantiate(GetRedModel(), new Vector3(0, 100, 0), Quaternion.Euler(0, 180, 0)); } playerObject.GetComponent <Player>().InstantiateCeleb(p, p.GetBoatId() == winnerId, p.GetBoatId() == winnerId ? 0 : 5); } } else { //4 joueurs playerInfosList.Sort((a, b) => (a.GetBoatId() != b.GetBoatId())? 1 : 0); float blue_offset = 6; float red_offset = 6; foreach (PlayerInfos p in playerInfosList) { GameObject playerObject; if (p.GetBoatId() == BLUE_BOAT_ID) { playerObject = Instantiate(GetBlueModel(), new Vector3(0, 100, 0), Quaternion.Euler(0, 180, 0)); playerObject.GetComponent <Player>().InstantiateCeleb(p, p.GetBoatId() == winnerId, blue_offset); blue_offset = -6; } else { playerObject = Instantiate(GetRedModel(), new Vector3(0, 100, 0), Quaternion.Euler(0, 180, 0)); playerObject.GetComponent <Player>().InstantiateCeleb(p, p.GetBoatId() == winnerId, red_offset); red_offset = -6; } } } }
protected void Page_Load(object sender, EventArgs e) { presenter = new CotizacionPresenter(); variables = new VariablesGlobales(); if (!IsPostBack) { lstMoneda.SelectedIndex = 0; } else { CargarGrilla(); } }
public ActionResult ListarEmpleadosPorProyectos(String id) { Empresa e = Empresa.Instancia(); VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; ViewBag.nombreProyecto = id; ViewBag.lista = e.BuscarProyecto(id).Empleados; return(View()); }
public ActionResult ModificarEmpleado(String idEmpleado, String msg = null) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); ViewBag.Empleado = e.BuscarEmpleado(Int32.Parse(idEmpleado)); ViewBag.Categorias = e.Categorias; ViewBag.msg = msg; return(View()); }
public ActionResult ListarProyectosAdmin(String msg = null) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; ViewBag.msg = msg; Empresa e = Empresa.Instancia(); ViewBag.lista = e.Proyectos; return(View()); }
public ActionResult ListarAusencias() { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); Empleado empleado = e.BuscarEmpleado(Convert.ToInt32(vg.LoggedUserId)); ViewBag.lista = e.ListarAusencias(empleado); return(View()); }
private void SpawnPlayers() { List <PlayerInfos> playerInfosList; playerInfosList = VariablesGlobales.GetAllPlayers(); if (playerInfosList == null) { return; } if (playerInfosList.Count < 3) { //Deux joueurs foreach (PlayerInfos p in playerInfosList) { GameObject playerObject; if (p.GetBoatId() == BLUE_BOAT_ID) { playerObject = Instantiate(GetBlueModel(), new Vector3(0, 100, 0), Quaternion.identity); } else { playerObject = Instantiate(GetRedModel(), new Vector3(0, 100, 0), Quaternion.identity); } playerObject.GetComponent <Player>().Instantiate(p, 0); } } else { //4 joueurs playerInfosList.Sort((a, b) => (a.GetBoatId() != b.GetBoatId())? 1 : 0); float offset = 5; foreach (PlayerInfos p in playerInfosList) { GameObject playerObject; if (p.GetBoatId() == BLUE_BOAT_ID) { playerObject = Instantiate(GetBlueModel(), new Vector3(0, 100, 0), Quaternion.identity); } else { playerObject = Instantiate(GetRedModel(), new Vector3(0, 100, 0), Quaternion.identity); } playerObject.GetComponent <Player>().Instantiate(p, offset); offset = offset - (Mathf.Sign(offset) * 10); } } }
public ActionResult AgregarAusencia(String pNombre) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); Proyecto p = e.BuscarProyecto(pNombre); ViewBag.Proyecto = p; return(View()); }
// GET: Proyectos public ActionResult ListarProyectosPorEmpleado() { VariablesGlobales vg = new VariablesGlobales(); if (vg.LoggedUserType == "Empleado") { Empresa e = Empresa.Instancia(); Empleado empleado = e.BuscarEmpleado(Int32.Parse(vg.LoggedUserId)); List <Proyecto> lista = e.ListarProyectos(empleado); ViewBag.Lista = lista; } ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; return(View()); }
private void btnEntrar_Click(object sender, EventArgs e) { Usuario u = new Usuario(); DataTable dt = new DataTable(); u.login = txtUsuario.Text; u.password = txtPassword.Text; dt = objUsuarioBL.usuarioLogin(u); if (txtUsuario.TextLength > 0) { if (txtPassword.TextLength > 0) { if (dt.Rows.Count == 0) { MessageBox.Show("Usuario ó Contraseña no encontrado", VariablesGlobales.NomSw()); } else { DataRow row = dt.Rows[0]; VariablesGlobales.UsuarioId = (int)row["id_usuario"]; VariablesGlobales.Login = row["login"].ToString(); VariablesGlobales.EstablecimientoDescripcion = row["Descripcion"].ToString(); VariablesGlobales.EstablecimientoId = (int)row["EstablecimientoId"]; VariablesGlobales.EstablecimientoNivel = row["nivel"].ToString(); VariablesGlobales.Login = row["login"].ToString(); VariablesGlobales.Id_Perfil = (int)row["Id_Perfil"]; /************** Nuevo */ VariablesGlobales.DescPerfil = row["DescPerfil"].ToString(); /************** Nuevo */ VariablesGlobales.CatPerfil = (int)row["CatPerfil"]; /************** Nuevo */ this.DialogResult = DialogResult.OK; this.Dispose(); } } else { MessageBox.Show("Ingrese una Contraseña"); } } else { MessageBox.Show("Ingrese un Usuario"); } }
public ActionResult AltaEmpleado(String msg = null) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); ViewBag.Categorias = e.Categorias; if (msg != null) { ViewBag.msg = msg; } return(View()); }
private void InicializarVariables() { Vista.InicializarVariables(); VariablesGlobales.LimpiarVariables(); this.actualizoTreeViews = false; this.progressBar1.Value = 0; this.treeViewRepetidos.Nodes.Clear(); this.lstCarpetasRepetidas.Items.Clear(); this.milisegundos = 0; this.yaIngrese = false; Vista.IgnorarNombres = chkBusquedaSinNombres.Checked ? (int)Estado.Habilitado : (int)Estado.Deshabilitado; Vista.CoincidirBytes = chkCoincidirBytes.Checked ? (int)Estado.Habilitado : (int)Estado.Deshabilitado; Vista.CoincidirPeso = chkCoincidirPeso.Checked ? (int)Estado.Habilitado : (int)Estado.Deshabilitado; LimpiarLabels(); }
// RAFA TIENE VISTA public ActionResult ListarProyectosPorEmpresa() { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); Cliente cliente = e.BuscarCliente(vg.LoggedUserId); foreach (Cliente cli in e.Clientes) { if (vg.LoggedUserId == cli.Rut) { ViewBag.Lista = cli.Proyectos; } } return(View()); }
public ActionResult Login(string txtUsuario, string txtContrasenia) { Empresa empresa = Empresa.Instancia(); Object dev = null; if (txtContrasenia != null && txtUsuario != null) { dev = empresa.Login(txtUsuario, txtContrasenia); } if (dev != null) { VariablesGlobales vg = new VariablesGlobales(); if (dev.GetType().Name == "Administrador") { Administrador adm = (Administrador)dev; vg.LoggedUserId = adm.Id; vg.LoggedUser_Nombre = adm.NombreCompleto; } else if (dev.GetType().Name == "Empleado") { Empleado emp = (Empleado)dev; vg.LoggedUserId = emp.Id.ToString(); vg.LoggedUser_Nombre = emp.NombreCompleto; } else if (dev.GetType().Name == "Cliente") { Cliente cli = (Cliente)dev; vg.LoggedUserId = cli.Rut.ToString(); vg.LoggedUser_Nombre = cli.Nombre; } vg.LoggedUserType = dev.GetType().Name; return(RedirectToAction("Dashboard")); } else { ViewBag.msg = "Usuario y/o contraseña incorrectos."; return(View()); } }
public ActionResult FinalizarProyecto(String pNombre) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); Boolean finaliza = e.FinalizarProyecto(pNombre); String msg; if (finaliza) { msg = "Proyecto finalizado con éxito."; } else { msg = "No se ha podido finalizar el proyecto."; } return(RedirectToAction("ListarProyectosAdmin", new { msg })); }
// GET: Empleado public ActionResult ListarEmpleados(Boolean borrar = false, String nombre = null, String msg = null) { VariablesGlobales vg = new VariablesGlobales(); ViewBag.userID = vg.LoggedUserId; ViewBag.userType = vg.LoggedUserType; ViewBag.nombre = vg.LoggedUser_Nombre; Empresa e = Empresa.Instancia(); if (borrar) { ViewBag.msg = "El empleado \" " + nombre + " \" no puede ser eliminado debido a que está asignado a uno o más proyectos."; } if (msg != null) { ViewBag.msg = msg; } ViewBag.lista = e.Empleados; return(View()); }
public CotizacionPresenter() { model = new CotizacionModel(this); variables = new VariablesGlobales(); }
public List <respuesta> Post() { new VariablesGlobales(); List <respuesta> list = new List <respuesta>(); API cmd = new API(); Parametros parametros = new Parametros(); VariablesGlobales global = new VariablesGlobales(); if (HttpContext.Current.Session["idparticipante"] != null) { HttpRequest request = HttpContext.Current.Request; string text = ""; try { #region subida de archivos //crean la session parametros.idparticipante = Convert.ToInt32(HttpContext.Current.Session["idparticipante"].ToString()); parametros.idconcurso = Convert.ToInt32(HttpContext.Current.Session["idconsurso"].ToString()); #region crea directorio raiz text = ConfigurationManager.ConnectionStrings["Ruta"].ConnectionString + "/" + parametros.idconcurso + "/" + parametros.idparticipante; if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } if (!Directory.Exists(text)) { list.Add(new respuesta { numero = "0", mensaje = "No se pudo crear la ruta para la imagen... Comuníquelo al correo que se encuentra en su perfil.", exito = false }); return(list); } #endregion if (request.Files.Count > 0) { //string name = (string)enumerator.Current; HttpPostedFile httpPostedFile = request.Files[0]; string[] array = httpPostedFile.FileName.Split('°'); parametros.consulta = 3;// valida cupos parametros.idcategoria = Convert.ToInt32(array[3]); if (cmd.sp_galeria_valida_cupo(parametros)) { if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } if (Directory.Exists(text)) { #region valida existen de archivo if (!File.Exists(text + "/" + array[0] + array[1])) { #region inserta archivo nuevo httpPostedFile.SaveAs(text + "/" + array[0] + array[1]); text = text + "/" + array[1] + array[2]; //conulta 2 inserta en base de datos parametros.consulta = 2; parametros.nombre = array[0]; parametros.extencion = array[1]; parametros.descripcion = array[2]; list = cmd.sp_galeria(parametros); // si insert n base de datos envia error elimina el archivo insertado en la carpeta if (!list[0].exito) { File.Delete(text); } #endregion } else { #region envia mensaje de archivo existente parametros.consulta = 15; parametros.nombre = array[1]; parametros.extencion = array[2]; //list = aPILocalModel.sp_evidencias(parametros); list[0].numero = "10"; list[0].mensaje = "Archivo ya existe. si desea eliminelo y vuelva a subirlo"; list[0].exito = false; #endregion } #endregion } } else { list.Add(new respuesta { numero = "0", mensaje = "Usted no posee más cupos para esta categoria...", exito = false }); } return(list); } #endregion } catch (Exception a) { File.Delete(text); list.Add(new respuesta { numero = "0", mensaje = "Error al cargar archivo" + a.Message, exito = false }); } return(list); } else { list.Add(new respuesta { numero = "-1", mensaje = "Session Expirada", exito = false }); return(list); } }
public CotizacionModel(ICotizacionPresenter presenter) { this.presenter = presenter; variables = new VariablesGlobales(); }
public IActionResult Index() { List <productos> productos = JsonConvert.DeserializeObject <List <productos> >(new productos().GetAll()); return(VariablesGlobales.View(View(productos))); }
public void ChangerDeScene(int NumScene) { VariablesGlobales.ResetVariables(); SceneManager.LoadScene(NumScene); }
public IActionResult Index() { return(VariablesGlobales.View(View(VariablesGlobales.LogUser), "Administrator")); }