Example #1
0
 /// <summary>
 /// Valida los datos de Huella
 /// </summary>
 /// <param name="Huella">Huella a validar</param>
 private void Validar(HuellaEntity huella)
 {
     if (huella.Huella == null || huella.Huella.Equals(string.Empty))
     {
         throw new ValidacionException("Falta cargar la huella");
     }
 }
Example #2
0
 /// <summary>
 /// Accion de eliminar una Huella
 /// </summary>
 /// <param name="Huella">Huella a eliminar</param>
 public void Eliminar(HuellaEntity huella)
 {
     using (var huellaData = new HuellaData())
     {
         huellaData.Delete(huella);
     }
 }
Example #3
0
        public HuellaEntity getByHuella(string huellaStr)
        {
            HuellaEntity huella = null;

            using (var huellaData = new HuellaData())
            {
                huella = huellaData.GetBy(huellaStr);
            }
            return(huella);
        }
Example #4
0
        /// <summary>
        /// Obtiene una instancia especifica de Huella
        /// </summary>
        /// <param name="id">Identificador unico de Huella</param>
        /// <returns>Instancia de Huella solicitada</returns>
        public HuellaEntity getById(int legajo, int idHuella)
        {
            HuellaEntity huella = null;

            using (var huellaData = new HuellaData())
            {
                huella = huellaData.GetBy(legajo, idHuella);
            }
            return(huella);
        }
Example #5
0
        private HuellaEntity make(IDataReader reader)
        {
            HuellaEntity huella =
                new HuellaEntity(int.Parse(reader["legajo"].ToString()));

            using (TablaData tablaData = new TablaData())
            {
                int idHuella = int.Parse(reader["idHuella"].ToString());
                huella.DedoHuella = (TablaEntity)tablaData.getById("reloj", 4, idHuella);
            }
            huella.Huella = reader["huella"].ToString();
            return(huella);
        }
Example #6
0
 private void solicitarHuella()
 {
     this.capturando       = true;
     this.lblMensajes.Text = "Por favor, coloque el dedo sobre el lector...";
     WisObj.IdentifyCapture();
     if (this.cmbEmpleados.SelectedValue != null)
     {
         huella = new HuellaEntity(int.Parse(this.cmbEmpleados.SelectedValue.ToString()));
     }
     else
     {
         huella = null;
     }
 }
Example #7
0
 /// <summary>
 /// Acción de insertar una Huella
 /// </summary>
 /// <param name="Huella">Huella a guardar</param>
 public void Guardar(HuellaEntity huella)
 {
     this.Validar(huella);
     using (var huellaData = new HuellaData())
     {
         if (huellaData.GetBy(huella.Legajo, int.Parse(huella.DedoHuella.Contenido.ToString())) == null)
         {
             huellaData.Insert(huella);
         }
         else
         {
             huellaData.Update(huella);
         }
     }
 }
Example #8
0
 private void btnEnrolar_Click(object sender, EventArgs e)
 {
     if (this.cmbEmpleados.SelectedValue == null)
     {
         MessageBox.Show("por favor, seleccione un empleado");
     }
     else
     if (this.idDedo <= 0)   //this.cmbHuella.SelectedValue == null)
     {
         MessageBox.Show("por favor, seleccione una huella");
     }
     else
     {
         huella = this.huellasNegocio.getById(int.Parse(this.cmbEmpleados.SelectedValue.ToString()), this.idDedo);
         if (huella != null)
         {
             DialogResult result = MessageBox.Show("Esa Huella ya se encuentra registrada. Desea Regrabarla ?", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (result == DialogResult.Yes)
             {
                 this.huellasNegocio.Eliminar(huella);
                 this.lblMensajes.Text = "Por favor, coloque la huella " + this.cmbHuella.Text + " sobre el lector...";
                 WisObj.StartEnroll();
             }
         }
         else
         {
             this.lblMensajes.Text = "Por favor, coloque la huella " + this.cmbHuella.Text + " sobre el lector...";
             WisObj.StartEnroll();
         }
     }
     if (this.cmbEmpleados.SelectedValue != null)
     {
         huella = new HuellaEntity(int.Parse(this.cmbEmpleados.SelectedValue.ToString()));
     }
     else
     {
         huella = null;
     }
 }
Example #9
0
        public int Delete(HuellaEntity huella)
        {
            MyLog4Net.Instance.getCustomLog(this.GetType()).Info("Huella idFichada: " + huella.Legajo);
            StringBuilder sql = new StringBuilder();

            try
            {
                sql.Append("DELETE");
                sql.Append(" FROM ");
                sql.Append(this.tabla);
                sql.Append(" WHERE ");
                sql.Append(" legajo = ");
                sql.Append(huella.Legajo);
                sql.Append(" and idHuella = ");
                sql.Append(huella.DedoHuella.Contenido);
                return(Model.DB.ejecutarProceso(Model.TipoComando.Texto, sql.ToString()));
            }
            catch (Exception ex)
            {
                MyLog4Net.Instance.getCustomLog(this.GetType()).Error("delete(). " + ex.Message, ex);
                throw;
            }
        }
Example #10
0
 public int Insert(HuellaEntity huella)
 {
     MyLog4Net.Instance.getCustomLog(this.GetType()).Info("Agregando: " + huella.ToString());
     try
     {
         StringBuilder sql = new StringBuilder();
         sql.Append(" INSERT INTO ");
         sql.Append(this.tabla);
         sql.Append(" VALUES(");
         sql.Append(huella.Legajo);
         sql.Append(", ");
         sql.Append(huella.DedoHuella.Contenido);
         sql.Append(", '");
         sql.Append(huella.Huella);
         sql.Append("') ");
         return(Model.DB.ejecutarProceso(Model.TipoComando.Texto, sql.ToString()));
     }
     catch (Exception ex)
     {
         MyLog4Net.Instance.getCustomLog(this.GetType()).Error("insert(). " + ex.Message, ex);
         throw;
     }
 }
Example #11
0
 public int Update(HuellaEntity huella)
 {
     MyLog4Net.Instance.getCustomLog(this.GetType()).Info("Actualizando: " + huella.ToString());
     try
     {
         StringBuilder sql = new StringBuilder();
         sql.Append(" UPDATE ");
         sql.Append(this.tabla);
         sql.Append(" SET");
         sql.Append(" huella = '");
         sql.Append(huella.Huella);
         sql.Append("' WHERE ");
         sql.Append(" legajo = ");
         sql.Append(huella.Legajo);
         sql.Append(" and idHuella = ");
         sql.Append(huella.DedoHuella.Contenido);
         return(Model.DB.ejecutarProceso(Model.TipoComando.Texto, sql.ToString()));
     }
     catch (Exception ex)
     {
         MyLog4Net.Instance.getCustomLog(this.GetType()).Error("update(). " + ex.Message, ex);
         throw;
     }
 }