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 } ); }
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(); }
public caFaces saveFace(caFaces model) { this.db.caFaces.Add(model); this.db.SaveChanges(); return(model); }