//AGREGAR IDENTIFICACION DEL SOCIO public void agregarIdentificacion(long id, byte[] foto, string lado) { using (var bd = new Conexion()) { identificacion identificacion = new identificacion { ide_asociado = id, ide_identificacion = foto, ide_lado = lado }; long consulta = bd.identificacion.LongCount(); if (consulta == 0) { bd.Database.ExecuteSqlCommand("ALTER TABLE identificacion AUTO_INCREMENT=1"); } else { long maxVal = bd.identificacion.Max(i => i.ide_id) + 1; bd.Database.ExecuteSqlCommand("ALTER TABLE identificacion AUTO_INCREMENT={0}", maxVal); } bd.identificacion.Add(identificacion); bd.SaveChanges(); } }
IEnumerator conect_server() { string dataUrl = "http://192.168.0.14:8000/jugador/api/jugador/"; // Create a form object for sending high score data to the server var form = new WWWForm(); // Assuming the perl script manages high scores for different games form.AddField("nombre", nickname.text); // Create a download object WWW downloadW = new WWW(dataUrl, form); // Wait until the download is done yield return(downloadW); if (!string.IsNullOrEmpty(downloadW.error)) { Debug.Log("Error downloading: " + downloadW.error); } else { id = JsonUtility.FromJson <identificacion>(downloadW.text); info.id = id.id; info.sala = id.sala_id; info.nickname = nickname.text; SceneManager.LoadScene("principal"); } }
public static Boolean saveDocuments(String ruta, String nombre, int idCliente) { byte[] file; using (var stream = new FileStream(ruta, FileMode.Open, FileAccess.Read)) { using (var reader = new BinaryReader(stream)) { file = reader.ReadBytes((int)stream.Length); } } using (FOCUSEntities db = new FOCUSEntities()) { identificacion cd = new identificacion(); cd.cliente = idCliente; cd.nombre = nombre; cd.tipo = "pdf"; cd.archivobinario = file; cd.id_identificaion = totalDocuments() + 1; db.identificacion.Add(cd); db.SaveChanges(); return(true); } }