/// <summary> /// Obtiene un Persona de la base de datos /// </summary> /// <param name="id"></param> /// <returns></returns> public static Guid ObtenerIdUsuario(Guid idPersona) { Guid idUsuario = Guid.Empty; SqlCommand cmd = null; string query = @"SELECT idUsuario FROM Persona WHERE idPersona=@id and eliminado=1"; try { cmd = OperationsSql.CreateBasicCommand(query); cmd.Parameters.AddWithValue("@id", idPersona); idUsuario = new Guid(OperationsSql.ExcecuteScalarCommand(cmd)); } catch (Exception ex) { OperationsLogs.WriteLogsRelease("PersonaDal", "ObtenerIdUsuario(Get)", string.Format("{0} Error: {1}", DateTime.Now.ToString(), ex.Message)); throw ex; } finally { cmd.Connection.Close(); } return(idUsuario); }