public Tarjeta(Tarjeta original)            // Crea un copia de la tarjeta en el constructor.
 {
     tarjeta             = original.tarjeta;
     OrgID               = original.OrgID;
     id                  = original.id;
     idEmpleado          = original.idEmpleado;
     estado              = original.estado;
     accessLevels        = original.accessLevels;
     ultimaActualizacion = original.ultimaActualizacion;
     activationDate      = original.activationDate;
     deactivationDate    = original.deactivationDate;
     isVisitor           = original.isVisitor;
     PIN                 = original.PIN;
     idTipoTarjeta       = original.idTipoTarjeta;
     lnlbadgekey         = original.lnlbadgekey;
 }
예제 #2
0
        private void btnBadgeSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtBadgeSearch.Text.Trim()))
                {
                    string errDesc = "";
                    int    errCode = (int)StatusCode.NOT_IMPLEMENTED;
                    datosEmpleado = WebServiceAPI.GetInstance().ObtenerDatosEmpleadoYTarjeta(txtBadgeSearch.Text.Trim(), out errDesc, out errCode);
                    if ((datosEmpleado.Key != null) && (datosEmpleado.Value != null))
                    {
                        lblNombre.Text   = datosEmpleado.Key.Nombre;
                        lblApellido.Text = datosEmpleado.Key.Apellido;
                        lblCI.Text       = datosEmpleado.Key.NumeroDocumento;
                        lblTarjeta.Text  = datosEmpleado.Value.tarjeta;
                        btnLink.Enabled  = true;
                        searchedEmployee = datosEmpleado.Key;
                        searchedBadge    = datosEmpleado.Value;

                        if (datosEmpleado.Key.imageDataBytes != null)
                        {
                            picSearchedEmp.Image = Tools.GetInstance().ByteToImage(datosEmpleado.Key.imageDataBytes, datosEmpleado.Key.imageDataBytes.Length);
                        }
                        else
                        {
                            picSearchedEmp.Image = null;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Cardholder associated to the badge: " + txtBadgeSearch.Text + " not found.");
                        btnLink.Enabled = false;
                    }
                }
                else
                {
                    MessageBox.Show("Please insert a valid badge");
                }
            }
            catch (Exception ex)
            {
                Tools.GetInstance().DoLog("Excepcion al buscar empleado: " + ex.Message);
            }
        }