Ejemplo n.º 1
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            DAL.actions.post _dalPost = new DAL.actions.post();

            caUsers model = _dalPost.saveUser(
                new caUsers
            {
                caPerson = new caPerson
                {
                    fIns  = DateTime.Now,
                    ap1   = this.txtAp1.Text.Trim().ToUpper(),
                    ap2   = this.txtAp2.Text.Trim().ToUpper(),
                    names = this.txtNames.Text.Trim().ToUpper(),
                },
                nip      = this.txtNip.Text.Trim(),
                username = this.txtUserName.Text.Trim(),
                active   = true,
                fIns     = DateTime.Now
            }
                );

            caFaces face = _dalPost.saveFace(
                new caFaces
            {
                fIns   = DateTime.Now,
                idUsr  = model.id,
                face   = this._capture.getPictureByte,
                active = true
            }
                );
        }
Ejemplo n.º 2
0
        public void deactivateFace(int idFace)
        {
            caFaces model = this.db.caFaces.FirstOrDefault(qry => qry.id.Equals(idFace));

            if (model == null)
            {
                throw new Exception("Rostro no encontrado en la base de datos");
            }

            model.active = false;

            this.db.caFaces.Add(model);
            this.db.Entry(model).State = EntityState.Modified;
            this.db.SaveChanges();
        }
Ejemplo n.º 3
0
 public caFaces saveFace(caFaces model)
 {
     this.db.caFaces.Add(model);
     this.db.SaveChanges();
     return(model);
 }