예제 #1
0
        protected void Process(DPFP.Sample Sample)
        {
            contador desplegar = new contador(Change_Label);

            // Draw fingerprint sample image.
            DrawPicture(ConvertSampleToBitmap(Sample));

            //Process(Sample);

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    //MakeReport("The fingerprint feature set was created.");
                    try
                    {
                        Enroller.AddFeatures(features);     // Add feature set to template.
                        //intentos_label.Text = Convert.ToString(intentos - 1);
                        this.Invoke(desplegar);
                    }
                    catch
                    {
                        MessageBox.Show("Error al capturar, vuelva a intentar", "Information", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        intentos           = 4;
                        mensaje_label.Text = Convert.ToString(intentos);
                    }
                }

                finally
                {
                    UpdateStatus();

                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:       // report success and stop capturing
                        OnTemplate(Enroller.Template);
                        //SetPrompt("Click Close, and then click Fingerprint Verification.");
                        Stop();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:      // report failure and restart capturing
                        Enroller.Clear();
                        Stop();
                        UpdateStatus();
                        //OnTemplate(null);
                        Start();
                        break;
                    }
                }
            }
        }
예제 #2
0
        public static bool Update(contador oldcontador,
                                  contador newcontador)
        {
            SqlConnection connection = empresaData.GetConnection();
            string        updateStatement
                = "UPDATE "
                  + "     [contador] "
                  + "SET "
                  + "     [contador_id] = @Newcontador_id "
                  + "    ,[nombre] = @Newnombre "
                  + "    ,[apellido] = @Newapellido "
                  + "    ,[direccion] = @Newdireccion "
                  + "    ,[contacto] = @Newcontacto "
                  + "WHERE "
                  + "     [contador_id] = @Oldcontador_id "
                  + " AND [nombre] = @Oldnombre "
                  + " AND [apellido] = @Oldapellido "
                  + " AND [direccion] = @Olddireccion "
                  + " AND [contacto] = @Oldcontacto "
                  + "";
            SqlCommand updateCommand = new SqlCommand(updateStatement, connection);

            updateCommand.CommandType = CommandType.Text;
            updateCommand.Parameters.AddWithValue("@Newcontador_id", newcontador.contador_id);
            updateCommand.Parameters.AddWithValue("@Newnombre", newcontador.nombre);
            updateCommand.Parameters.AddWithValue("@Newapellido", newcontador.apellido);
            updateCommand.Parameters.AddWithValue("@Newdireccion", newcontador.direccion);
            updateCommand.Parameters.AddWithValue("@Newcontacto", newcontador.contacto);
            updateCommand.Parameters.AddWithValue("@Oldcontador_id", oldcontador.contador_id);
            updateCommand.Parameters.AddWithValue("@Oldnombre", oldcontador.nombre);
            updateCommand.Parameters.AddWithValue("@Oldapellido", oldcontador.apellido);
            updateCommand.Parameters.AddWithValue("@Olddireccion", oldcontador.direccion);
            updateCommand.Parameters.AddWithValue("@Oldcontacto", oldcontador.contacto);
            try
            {
                connection.Open();
                int count = updateCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException)
            {
                return(false);
            }
            finally
            {
                connection.Close();
            }
        }
예제 #3
0
        public static bool Add(contador contador)
        {
            SqlConnection connection = empresaData.GetConnection();
            string        insertStatement
                = "INSERT "
                  + "     [contador] "
                  + "     ( "
                  + "     [contador_id] "
                  + "    ,[nombre] "
                  + "    ,[apellido] "
                  + "    ,[direccion] "
                  + "    ,[contacto] "
                  + "     ) "
                  + "VALUES "
                  + "     ( "
                  + "     @contador_id "
                  + "    ,@nombre "
                  + "    ,@apellido "
                  + "    ,@direccion "
                  + "    ,@contacto "
                  + "     ) "
                  + "";
            SqlCommand insertCommand = new SqlCommand(insertStatement, connection);

            insertCommand.CommandType = CommandType.Text;
            insertCommand.Parameters.AddWithValue("@contador_id", contador.contador_id);
            insertCommand.Parameters.AddWithValue("@nombre", contador.nombre);
            insertCommand.Parameters.AddWithValue("@apellido", contador.apellido);
            insertCommand.Parameters.AddWithValue("@direccion", contador.direccion);
            insertCommand.Parameters.AddWithValue("@contacto", contador.contacto);
            try
            {
                connection.Open();
                int count = insertCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException)
            {
                return(false);
            }
            finally
            {
                connection.Close();
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            //ES UN PEQUEÑO CODIGO PARA PRACTICAR
            //SI HAY ALGUN ERROR POR FAVOR ME AYUDAN
            //AOENAS ESTOY INICIANDO EN EL MUNDO DE LA PROGRAMACION EN ESTE LENGUAJE

            String nombre1, nombre2, nombre3, nombre4, nombre5;

            Console.WriteLine("!BIENVENIDO¡");
            Console.WriteLine("");
            Console.WriteLine("DIGITE SU NOMBRE...");
            nombre1 = Convert.ToString(Console.ReadLine());


            Console.WriteLine("");
            Console.WriteLine("DIGITE SU NOMBRE...");
            nombre2 = Convert.ToString(Console.ReadLine());


            Console.WriteLine("");
            Console.WriteLine("DIGITE SU NOMBRE...");
            nombre3 = Convert.ToString(Console.ReadLine());


            Console.WriteLine("");
            Console.WriteLine("DIGITE SU NOMBRE...");
            nombre4 = Convert.ToString(Console.ReadLine());

            Console.WriteLine("");
            Console.WriteLine("DIGITE SU NOMBRE...");
            nombre5 = Convert.ToString(Console.ReadLine());
            Console.WriteLine();


            persona[] personas = new persona[5];
            personas[0] = new alumno(nombre1);
            personas[1] = new empleado(nombre2);
            personas[2] = new contador(nombre3);
            personas[3] = new profesor(nombre4);
            personas[4] = new abogado(nombre5);


            for (int i = 0; i < personas.Length; i++)
            {
                Console.WriteLine(personas[i].saludar());
            }


            Console.ReadKey();
        }
예제 #5
0
        public static contador Select_Record(contador contadorPara)
        {
            contador      contador   = new contador();
            SqlConnection connection = empresaData.GetConnection();
            string        selectStatement
                = "SELECT "
                  + "     [contador_id] "
                  + "    ,[nombre] "
                  + "    ,[apellido] "
                  + "    ,[direccion] "
                  + "    ,[contacto] "
                  + "FROM "
                  + "     [contador] "
                  + "WHERE "
                  + "     [contador_id] = @contador_id "
                  + "";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            selectCommand.CommandType = CommandType.Text;
            selectCommand.Parameters.AddWithValue("@contador_id", contadorPara.contador_id);
            try
            {
                connection.Open();
                SqlDataReader reader
                    = selectCommand.ExecuteReader(CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    contador.contador_id = System.Convert.ToInt32(reader["contador_id"]);
                    contador.nombre      = System.Convert.ToString(reader["nombre"]);
                    contador.apellido    = System.Convert.ToString(reader["apellido"]);
                    contador.direccion   = System.Convert.ToString(reader["direccion"]);
                    contador.contacto    = System.Convert.ToString(reader["contacto"]);
                }
                else
                {
                    contador = null;
                }
                reader.Close();
            }
            catch (SqlException)
            {
                return(contador);
            }
            finally
            {
                connection.Close();
            }
            return(contador);
        }
예제 #6
0
        public void button1_Click(object sender, EventArgs e,List<Filmes> filmes,contador a)
        {
            Filmes f = new Filmes();
            //contador s;
            //List<Filmes> filme;

            if (textBox1.Text != "" || comboBox1.Text != "" || maskedTextBox1.Text != "" || textBox3.Text != "")
            {
                f.nome = textBox1.Text;
                f.genero = comboBox1.Text;
                f.data = maskedTextBox1.Text;
                f.local = textBox3.Text;
                filmes.Add(f);
                a.i++;
            }
        }
예제 #7
0
        public static bool Delete(contador contador)
        {
            SqlConnection connection = empresaData.GetConnection();
            string        deleteStatement
                = "DELETE FROM "
                  + "     [contador] "
                  + "WHERE "
                  + "     [contador_id] = @Oldcontador_id "
                  + " AND [nombre] = @Oldnombre "
                  + " AND [apellido] = @Oldapellido "
                  + " AND [direccion] = @Olddireccion "
                  + " AND [contacto] = @Oldcontacto "
                  + "";
            SqlCommand deleteCommand = new SqlCommand(deleteStatement, connection);

            deleteCommand.CommandType = CommandType.Text;
            deleteCommand.Parameters.AddWithValue("@Oldcontador_id", contador.contador_id);
            deleteCommand.Parameters.AddWithValue("@Oldnombre", contador.nombre);
            deleteCommand.Parameters.AddWithValue("@Oldapellido", contador.apellido);
            deleteCommand.Parameters.AddWithValue("@Olddireccion", contador.direccion);
            deleteCommand.Parameters.AddWithValue("@Oldcontacto", contador.contacto);
            try
            {
                connection.Open();
                int count = deleteCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException)
            {
                return(false);
            }
            finally
            {
                connection.Close();
            }
        }
예제 #8
0
        public ActionResult DeleteConfirmed(
            Int32?contador_id
            )
        {
            contador contador = new contador();

            contador.contador_id = System.Convert.ToInt32(contador_id);
            contador             = contadorData.Select_Record(contador);

            bool bSucess = false;

            bSucess = contadorData.Delete(contador);
            if (bSucess == true)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", "Can Not Delete");
            }
            return(null);
        }
예제 #9
0
        // GET: /contador/Delete/<id>
        public ActionResult Delete(
            Int32?contador_id
            )
        {
            if (
                contador_id == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }


            contador contador = new contador();

            contador.contador_id = System.Convert.ToInt32(contador_id);
            contador             = contadorData.Select_Record(contador);

            if (contador == null)
            {
                return(HttpNotFound());
            }
            return(View(contador));
        }
예제 #10
0
        public ActionResult Edit(contador contador)
        {
            contador ocontador = new contador();

            ocontador.contador_id = System.Convert.ToInt32(contador.contador_id);
            ocontador             = contadorData.Select_Record(contador);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = contadorData.Update(ocontador, contador);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }

            return(View(contador));
        }
예제 #11
0
        public ActionResult Create([Bind(Include =
                                             "contador_id"
                                             + "," + "nombre"
                                             + "," + "apellido"
                                             + "," + "direccion"
                                             + "," + "contacto"
                                         )] contador contador)
        {
            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = contadorData.Add(contador);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Insert");
                }
            }

            return(View(contador));
        }
예제 #12
0
 public Form1()
 {
     InitializeComponent();
     List<Filmes> filmes = new List<Filmes>();
        contador a = new contador();
 }
예제 #13
0
파일: blas.cs 프로젝트: JonaSilva/cozcyt
	override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
		cont = GameObject.Find("/contador").GetComponent<contador>();
		cont.jarrones++;
		Debug.Log ("Jarrones" + cont.jarrones);
	}