Inheritance: MonoBehaviour
コード例 #1
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
        public ActionResult Create(prueba prueba)
        {
            barcode barcode = new barcode();

            //prueba.pru_codigo = GetCodigo(prueba.pru_registro, prueba.pru_examen);
            //prueba.pru_imagen = barcode.GenerarCodigo(prueba.pru_codigo);

            if (ModelState.IsValid && ExistPrueba(prueba.pru_examen, prueba.pru_registro))
            {
                db.prueba.Add(prueba);
                db.SaveChanges();
                set_codigo(prueba.pru_registro, prueba.pru_examen);
                if (prueba.examen.exa_tipo == "PLANTILLA")
                {
                    CreatePrueba(prueba.pru_examen, prueba.pru_registro);
                }
                else
                {
                    CreateObservacion(prueba.pru_registro, prueba.pru_examen);
                }
            }
            //ModelState.AddModelError("","La información ingresada no es la correcta");
            //return RedirectToAction("Index", new { id = prueba.pru_registro });

            var list_prueba = db.prueba.Include(p => p.registro).Include(p => p.examen).Where(p => p.pru_registro == prueba.pru_registro && p.examen.exa_estado == "ACTIVO");

            return(PartialView("Index", list_prueba.ToList()));
        }
コード例 #2
0
        public void pruebapro(prueba nuevo)
        {
            AccesoDatosManager accesoDatos = new AccesoDatosManager();

            try
            {
                accesoDatos.setearSP("pruebaagregar");
                accesoDatos.Comando.Parameters.Clear();
                accesoDatos.Comando.Parameters.AddWithValue("@id", nuevo.prod);
                accesoDatos.Comando.Parameters.AddWithValue("@cant", nuevo.cant);
                accesoDatos.Comando.Parameters.AddWithValue("@Tota", nuevo.total);


                accesoDatos.abrirConexion();
                accesoDatos.ejecutarAccion();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                accesoDatos.cerrarConexion();
            }
        }
コード例 #3
0
        public override global::System.Data.DataSet Clone()
        {
            prueba cln = ((prueba)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
コード例 #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            prueba prueba = db.pruebas.Find(id);

            db.pruebas.Remove(prueba);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     barraScript  = barra.GetComponent <prueba> ();
     globalScript = global.GetComponent <Global> ();
     rb           = GetComponent <Rigidbody2D> ();
     anim         = GetComponent <Animator> ();
     barra.transform.localPosition = new Vector3(transform.position.x + 0.6f, -3.2f, -2.3f);
 }
コード例 #6
0
        public prueba Cool(string id)
        {
            prueba p = new prueba();

            p.mensaje1 = id;
            p.mensaje2 = "como estas?";

            return(p);
        }
コード例 #7
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
        public JsonResult Modificar(int id, string valor)
        {
            prueba prueba = db.prueba.Find(id);

            prueba.pru_resultado = valor;
            db.SaveChanges();
            return(new JsonResult {
                Data = new { mensaje = "Datos Guardados" }
            });
        }
コード例 #8
0
        public void LoginTest()
        {
            string usuario  = "kevin3316";
            string contra   = "123";
            bool   esperado = true;
            prueba l        = new prueba();
            var    actua    = l.Login(usuario, contra);

            Assert.AreEqual(esperado, actua);
        }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "pruebaID,campoPruena")] prueba prueba)
 {
     if (ModelState.IsValid)
     {
         db.Entry(prueba).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(prueba));
 }
コード例 #10
0
        public ActionResult Create([Bind(Include = "pruebaID,campoPruena")] prueba prueba)
        {
            if (ModelState.IsValid)
            {
                db.pruebas.Add(prueba);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(prueba));
        }
コード例 #11
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
        public ActionResult Delete(int id = 0)
        {
            prueba prueba = db.prueba.Find(id);

            if (prueba.examen.exa_tipo == "PLANTILLA")
            {
                DeleteGrupo(prueba.pru_examen, prueba.pru_registro);
            }
            db.prueba.Remove(prueba);
            db.SaveChanges();
            return(RedirectToAction("Index", new { id = prueba.pru_registro }));
        }
コード例 #12
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            prueba ds = new prueba();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
コード例 #13
0
        public prueba ObtenerNumeros()
        {
            var aleatorio = new Random();

            var numberobject = new prueba
            {
                number1 = aleatorio.Next(-10000, 8),
                number2 = aleatorio.Next(-10000, 8),
                number3 = aleatorio.Next(-10000, 8)
            };

            return(numberobject);
        }
コード例 #14
0
        // GET: pruebas/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            prueba prueba = db.pruebas.Find(id);

            if (prueba == null)
            {
                return(HttpNotFound());
            }
            return(View(prueba));
        }
コード例 #15
0
        public ActionResult Perfil(int reg_paciente, int con_perfil)
        {
            try
            {
                DateTime dd       = DateTime.Today;
                string   fecha    = dd.Date.ToString("d");
                var      consulta = db.registro.Where(r => r.reg_fecha == fecha && r.reg_paciente == reg_paciente && r.reg_estado == true);
                if (consulta.Any())
                {
                    return(RedirectToAction("Message", "Home", new { mensaje = "El registro ya existe, por favor seleccione la opción editar" }));
                }

                barcode        barcode      = new barcode();
                List <control> list_control = db.control.Where(c => c.con_perfil == con_perfil).ToList();

                registro registro = new registro();
                registro.reg_paciente      = reg_paciente;
                registro.reg_fecha         = fecha;
                registro.reg_orden         = GetOrden(fecha);
                registro.reg_estado        = true;
                registro.reg_laboratorista = get_user();
                if (registro.reg_laboratorista == 0)
                {
                    return(RedirectToAction("Message", "Home", new { mensaje = "Su perfil de usuario no permite realizar esta acción " }));
                }
                db.registro.Add(registro);
                db.SaveChanges();
                //return RedirectToAction("Message", "Home", new { mensaje = registro.reg_id.ToString()});
                int reg_id = registro.reg_id;
                foreach (var item in list_control)
                {
                    prueba prueba = new prueba();
                    prueba.pru_examen   = item.con_examen;
                    prueba.pru_registro = reg_id;
                    //prueba.pru_codigo = GetCodigo(reg_id, item.con_examen);
                    //prueba.pru_imagen = barcode.GenerarCodigo(prueba.pru_codigo);
                    set_codigo(prueba.pru_registro, prueba.pru_examen);
                    db.prueba.Add(prueba);
                    db.SaveChanges();
                }
                return(RedirectToAction("Index", "Prueba", new { id = registro.reg_id }));
            }
            catch (Exception ex) {
                return(RedirectToAction("Message", "Home", new { mensaje = ex.Message }));
            }

            //return View();
        }
コード例 #16
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
        private void DeleteGrupo(int exa_id, int reg_id)
        {
            examen        examen   = db.examen.Find(exa_id);
            int           are_id   = db.area.Where(a => a.are_nombre == examen.exa_nombre).First().are_id;
            List <examen> list_exa = new List <examen>();

            list_exa = db.examen.Where(e => e.exa_area == are_id).ToList();
            foreach (var item in list_exa)
            {
                var consulta = db.prueba.Where(p => p.pru_examen == item.exa_id && p.pru_registro == reg_id);
                if (consulta.Any())
                {
                    prueba prueba = db.prueba.Where(p => p.pru_examen == item.exa_id && p.pru_registro == reg_id).First();
                    db.prueba.Remove(prueba);
                }
            }
            db.SaveChanges();
        }
    /*
     * public static void showwindow()
     *  {
     *    EditorWindow.GetWindow<WindowsEditorBullet>("Example");
     *
     *  }
     */


    void OnGUI()
    {
        //GUILayout.Label("This is a label", EditorStyles.boldLabel);
        selectwep = (WeapondSelect)EditorGUILayout.EnumPopup("Seleccione el tipo de arma", selectwep);

        switch (selectwep)
        {
        case WeapondSelect.Pistol:

            damage          = EditorGUILayout.FloatField("Damage", damage);
            chancheCritical = EditorGUILayout.FloatField("Change Critical", chancheCritical);
            dispersion      = EditorGUILayout.FloatField("dispersion", dispersion);
            isreload        = EditorGUILayout.Toggle("Recargando", isreload);
            SecondShoot     = EditorGUILayout.Toggle("Second Shoot", SecondShoot);
            break;

        case WeapondSelect.AsaultRifle:
        {
            damage          = EditorGUILayout.FloatField("Damage", damage);
            chancheCritical = EditorGUILayout.FloatField("Change Critical", chancheCritical);
            dispersion      = EditorGUILayout.FloatField("dispersion", dispersion);
            isreload        = EditorGUILayout.Toggle("Recargando", isreload);
            SecondShoot     = EditorGUILayout.Toggle("Second Shoot", SecondShoot);
            break;
        }


        default:
            Debug.LogError("Unreconoized option");
            break;
        }

        if (GUILayout.Button("Select"))
        {
        }

        prub = (prueba)EditorGUILayout.EnumPopup("Probando los enums", prub);
        if (GUILayout.Button("Imprimir"))
        {
            Debug.Log("Hola Mundo");
        }
    }
コード例 #18
0
        public List <prueba> pr(string codigo_postal)
        {
            //    var it = from a in db_sindicato.maesoc select a;//where a.MAESOC_NRODOC == "26954776" select a;
            //        //db_sindicato.maeflia.Where(x => x.MAEFLIA_NRODOC == 26954776).Select(x => x.MAEFLIA_NRODOC).ToList();

            //    foreach (var item in it.ToList())
            //    {
            //        prueba p = new prueba();
            //        Func_Utiles func = new Func_Utiles();
            //        p.edad = func.calcular_edad(item.MAESOC_FECHANAC);
            //        p.sexo = item.MAESOC_SEXO.ToString();
            //        pru.Add(p);
            //    }
            //    return pru;


            Func_Utiles funciones_utiles = new Func_Utiles();

            var edad_mochilas = (from a in db_sindicato.soccen
                                 join sf in db_sindicato.socflia on a.SOCCEN_CUIL equals sf.SOCFLIA_CUIL
                                 join flia in db_sindicato.maeflia on sf.SOCFLIA_CODFLIAR equals flia.MAEFLIA_CODFLIAR
                                 join maesocio in db_sindicato.maesoc on a.SOCCEN_CUIL equals maesocio.MAESOC_CUIL
                                 where a.SOCCEN_ESTADO == 1 && (codigo_postal == "0" ? maesocio.MAESOC_CODPOS != codigo_postal : maesocio.MAESOC_CODPOS == codigo_postal)
                                 select new
            {
                sexo = flia.MAEFLIA_SEXO,
                edad = funciones_utiles.calcular_edad(flia.MAEFLIA_FECNAC),
            }).ToList();

            if (edad_mochilas.Count() > 0)
            {
                prueba edad_ = new prueba();
                foreach (var item in edad_mochilas.ToList())
                {
                    edad_.sexo = item.sexo.ToString();
                    edad_.edad = item.edad;
                    pru.Add(edad_);
                }
            }
            return(pru);
        }
コード例 #19
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
        private void CreatePrueba(int exa_id, int reg_id)
        {
            examen        examen   = db.examen.Find(exa_id);
            int           are_id   = db.area.Where(a => a.are_nombre == examen.exa_nombre).First().are_id;
            List <examen> list_exa = new List <examen>();
            barcode       barcode  = new barcode();

            list_exa = db.examen.Where(e => e.exa_area == are_id).ToList();
            foreach (var item in list_exa)
            {
                prueba prueba = new prueba();
                prueba.pru_examen    = item.exa_id;
                prueba.pru_registro  = reg_id;
                prueba.pru_resultado = item.exa_inicial;
                //prueba.pru_codigo = GetCodigo(reg_id, item.exa_id);
                //prueba.pru_imagen = barcode.GenerarCodigo(prueba.pru_codigo);
                set_codigo(prueba.pru_registro, prueba.pru_examen);
                db.prueba.Add(prueba);
                //db.SaveChanges();
            }
            db.SaveChanges();
        }
    void pruebafunction(prueba prueb)
    {
        switch (prueb)
        {
        case prueba.hola:
            GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
            cube.transform.position = Vector3.zero;
            break;

        case prueba.estas:
            GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            sphere.transform.position = Vector3.zero;
            break;

        case prueba.como:
            GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
            plane.transform.position = Vector3.zero;
            break;

        default:
            Debug.LogError("Unrecognized Option");
            break;
        }
    }
コード例 #21
0
ファイル: PruebaController.cs プロジェクト: paul19pv/kinnemed
 private void CreateObservacion(int reg_id, int exa_id)
 {
     try
     {
         int are_id   = db.examen.Find(exa_id).exa_area;
         int obs_id   = db.examen.Where(e => e.exa_area == are_id && e.exa_nombre.Contains("OBSERVACIONES")).First().exa_id;
         var consulta = db.prueba.Where(p => p.pru_examen == obs_id && p.pru_registro == reg_id);
         ModelState.AddModelError("error", obs_id + "");
         if (!consulta.Any())
         {
             //ModelState.AddModelError("error", "if observacion");
             prueba prueba = new prueba();
             prueba.pru_examen   = obs_id;
             prueba.pru_registro = reg_id;
             //prueba.pru_codigo = GetCodigo(reg_id, exa_id);
             //prueba.pru_imagen = barcode.GenerarCodigo(prueba.pru_codigo);
             db.prueba.Add(prueba);
             db.SaveChanges();
         }
     }
     catch (Exception ex) {
         ModelState.AddModelError("error", ex.Message);
     }
 }
コード例 #22
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                prueba ds = new prueba();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "pruebaDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }